From report at bugs.python.org Tue Jun 1 00:02:14 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Jun 2021 04:02:14 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622520134.04.0.626774589295.issue44275@roundup.psfhosted.org> Inada Naoki added the comment: I confirmed this fixes the mojibake: ``` PS > $OutputEncoding = [System.Text.Encoding]::GetEncoding("UTF-8") PS > [System.Console]::OutputEncoding = $OutputEncoding PS > [System.Console]::InputEncoding = $OutputEncoding ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 01:08:47 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Tue, 01 Jun 2021 05:08:47 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) Message-ID: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> New submission from Kshitiz Arya : Replace if-elif-else with match-case for pattern matching, which is generally faster and more intuitive. ---------- components: Library (Lib) messages: 394839 nosy: Kshitiz17 priority: normal severity: normal status: open title: Replace if-elif-else structure with match-case (PEP634) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 01:16:24 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 01 Jun 2021 05:16:24 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622524584.56.0.951110462713.issue44276@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is done on a case by case basis and in places necessary in future code. Modifying existing code can pollute git history, make backports hard, might introduce subtle bugs etc. This is similar to proposal to use walrus operator, f-strings, etc. throughout the codebase. ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 01:24:26 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 01 Jun 2021 05:24:26 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622525066.36.0.885899719224.issue44276@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 01:39:20 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Jun 2021 05:39:20 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622525960.21.0.654739745293.issue44275@roundup.psfhosted.org> Eryk Sun added the comment: > PS > [System.Console]::InputEncoding = $OutputEncoding If changing the console input codepage to UTF-8 fixes the mojibake problem, then probably you're running Python in UTF-8 mode. pydoc.tempfilepager() encodes the temporary file with the preferred encoding, which normally would not be UTF-8. There are possible variations in how your system and the console are configured, so I can't say for sure. tempfilepager() could temporarily set the console's input codepage to UTF-8 via SetConsoleCP(65001). However, if python.exe is terminated or crashes before it can reset the codepage, the console will be left in a bad state. By bad state, I mean that leaving the input code page set to UTF-8 is broken. Legacy console applications rely on the input codepage for reading input via ReadFile() and ReadConsoleA(), but the console host (conhost.exe or openconsole.exe) doesn't support reading input as UTF-8. It simply replaces each non-ASCII character (i.e. characters that require 2-4 bytes as UTF-8) with a null byte, e.g. "ab?cd" is read as "ab\x00cd". If you think the risk of crashing is negligible, and the downside of breaking legacy applications in the console session is trivial, then paging with full Unicode support is easily possible. Implement _winapi.GetConsoleCP() and _winapi.SetConsoleCP(). Write UTF-8 text to the temporary file. Change the console input codepage to UTF-8 before spawning "more.com". Revert to the original input codepage in the finally block. A more conservative fix would be to change tempfilepager() to encode the file using the console's current input codepage, GetConsoleCP(). At least there's no mojibake. > PS > $OutputEncoding = [System.Text.Encoding]::GetEncoding("UTF-8") FYI, $OutputEncoding in PowerShell has nothing to do with the python.exe and more.com processes, nor the console session to which they're attached. > PS > [System.Console]::OutputEncoding = $OutputEncoding The console output code page is irrelevant since more.com writes wide-character text via WriteConsoleW() and decodes the file using the console input code page, GetConsoleCP(). The console output codepage from GetConsoleOutputCP() isn't used for anything here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 01:56:02 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 01 Jun 2021 05:56:02 +0000 Subject: [issue44277] cpython forks are spammed with dependabot PRs Message-ID: <1622526962.42.0.431881645294.issue44277@roundup.psfhosted.org> New submission from Anthony Sottile : for example: https://github.com/asottile/cpython/pull/1 ---------- messages: 394842 nosy: Anthony Sottile priority: normal severity: normal status: open title: cpython forks are spammed with dependabot PRs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 03:15:25 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Tue, 01 Jun 2021 07:15:25 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622531725.84.0.699759302016.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: Pardon my ignorance here but can I start working on this issue? I am a new contributor therefore I am unsure about how to proceed from here ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 05:14:36 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 09:14:36 +0000 Subject: [issue44265] Create an MSI Package In-Reply-To: <1622325187.57.0.0411972707678.issue44265@roundup.psfhosted.org> Message-ID: <1622538876.88.0.565167231381.issue44265@roundup.psfhosted.org> Steve Dower added the comment: Thanks, Eric. Anyone may feel free to create and release their own MSI distro of CPython. I don't even mind if you use the binaries from our releases, as those are signed and your users will be able to know that they aren't modified (it's a little harder to verify the stdlib against the catalog files, but possible for those who care). (Also, anyone may feel free to *demand payment* for creating an MSI distro. Only do as much for free as you are willing, and no more!) ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 05:17:37 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 09:17:37 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622539057.17.0.470156892974.issue44275@roundup.psfhosted.org> Steve Dower added the comment: > If changing the console input codepage to UTF-8 fixes the mojibake problem, then probably you're running Python in UTF-8 mode. I forget where I saw them, but there are some places where we incorrectly use stdin encoding for writing to stdout (I suppose assuming that they'll always match). This may be being impacted by one of those. ---------- assignee: docs at python -> versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 05:18:55 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 09:18:55 +0000 Subject: [issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value In-Reply-To: <1532509080.28.0.56676864532.issue34219@psf.upfronthosting.co.za> Message-ID: <1622539135.16.0.809728380921.issue34219@roundup.psfhosted.org> Steve Dower added the comment: distutils is deprecated and no further bugs will be fixed (other than newly discovered release blockers). You will want to report this to setuptools instead. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 05:19:03 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 09:19:03 +0000 Subject: [issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value In-Reply-To: <1532509080.28.0.56676864532.issue34219@psf.upfronthosting.co.za> Message-ID: <1622539143.25.0.962209145041.issue34219@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 05:20:35 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 09:20:35 +0000 Subject: [issue25957] sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets) In-Reply-To: <1451158541.36.0.577449474291.issue25957@psf.upfronthosting.co.za> Message-ID: <1622539235.83.0.494490064421.issue25957@roundup.psfhosted.org> Change by Steve Dower : ---------- nosy: -steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:22:01 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Tue, 01 Jun 2021 10:22:01 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622542921.92.0.580186585443.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: This is a relatively simple example of how this will improve readability of the code. (This example is form Lib/json/encoder.py) Original ------------------------------------------------------------------------- if isinstance(value, str): yield _encoder(value) elif value is None: yield 'null' elif value is True: yield 'true' elif value is False: yield 'false' elif isinstance(value, int): yield _intstr(value) elif isinstance(value, float): yield _floatstr(value) else: if isinstance(value, (list, tuple)): chunks = _iterencode_list(value, _current_indent_level) elif isinstance(value, dict): chunks = _iterencode_dict(value, _current_indent_level) else: chunks = _iterencode(value, _current_indent_level) yield from chunks -------------------------------------------------------------------------- Suggested -------------------------------------------------------------------------- match value: case str(): yield _encoder(value) case None: yield 'null' case True: yield 'true' case False: yield 'false' case int(): # see comment for int/float in _make_iterencode yield _intstr(value) case float(): # see comment for int/float in _make_iterencode yield _floatstr(value) case _: match value: case list()|tuple(): chunks = _iterencode_list(value, _current_indent_level) case dict(): chunks = _iterencode_dict(value, _current_indent_level) case _: chunks = _iterencode(value, _current_indent_level) yield from chunks ---------------------------------------------------------------------------- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:29:38 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 01 Jun 2021 10:29:38 +0000 Subject: [issue44079] [sqlite3] remove superfluous statement weak ref list from connection object In-Reply-To: <1620503004.28.0.3842383449.issue44079@roundup.psfhosted.org> Message-ID: <1622543378.87.0.342111545439.issue44079@roundup.psfhosted.org> Erlend E. Aasland added the comment: Also, note that if identical SQL statements are created in multiple cursors belonging to the same connection, they will currently _not_ be added to the connection weak ref list. See the if (self->statement->in_use) in the middle of _pysqlite_query_execute(). Thus, the current code actually fails to register _all_ statements in the "all statements" weak ref list. IMO, this is yet another argument to abandon that list. Side note: This branch is not exercised in the unit test suite. Adding the following test will cover this branch: diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index c17f911fa1..8e53c657a6 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -526,6 +526,10 @@ def test_last_row_id_insert_o_r(self): ] self.assertEqual(results, expected) + def test_same_query_in_multiple_cursors(self): + cursors = [self.cx.execute("select 1") for _ in range(3)] + for cu in cursors: + self.assertEqual(cu.fetchall(), [(1,)]) class ThreadTests(unittest.TestCase): def setUp(self): See bpo-43553 for sqlite3 coverage improvements. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:36:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Jun 2021 10:36:54 +0000 Subject: [issue44278] Improve syntax error message for assigning to "..." Message-ID: <1622543814.93.0.384857928409.issue44278@roundup.psfhosted.org> New submission from Serhiy Storchaka : Some users can be confused by syntax error message for assigning to ellipsis [1]: >>> ... = 1 File "", line 1 ... = 1 ^^^ SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='? because Ellipsis is a name of a builtin variable Ellipsis, and it is possible to assign to variable named Ellipsis. >>> Ellipsis = 1 >>> Ellipsis 1 I think that using lowercase spelling of "ellipsis" will eliminate confusion. [1] https://mail.python.org/archives/list/python-ideas at python.org/thread/KDQ3OHALLXVZJIGPC4BMPVS2XH3VFPJV/ ---------- components: Interpreter Core messages: 394849 nosy: pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Improve syntax error message for assigning to "..." type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:40:32 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 01 Jun 2021 10:40:32 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622544032.37.0.36889079501.issue44276@roundup.psfhosted.org> Steven D'Aprano added the comment: match-case has not even reached a stable version of Python yet, it is only available in Python 3.10 which is still in beta. Are we sure that it is faster in all cases and how do you know it is more intuitive when the vast majority of Python users have likely not even heard of match-case yet? Personally, I am looking forward to using match-case, but I can see myself having to write lots of comments explaining what the code is doing for many years to come. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:40:47 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 01 Jun 2021 10:40:47 +0000 Subject: [issue44278] Improve syntax error message for assigning to "..." In-Reply-To: <1622543814.93.0.384857928409.issue44278@roundup.psfhosted.org> Message-ID: <1622544047.61.0.72321556124.issue44278@roundup.psfhosted.org> Batuhan Taskaya added the comment: I think this is a duplicate of issue 44273. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:41:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Jun 2021 10:41:06 +0000 Subject: [issue44278] Improve syntax error message for assigning to "..." In-Reply-To: <1622543814.93.0.384857928409.issue44278@roundup.psfhosted.org> Message-ID: <1622544066.41.0.992600162433.issue44278@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25071 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:41:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Jun 2021 10:41:20 +0000 Subject: [issue44278] Improve syntax error message for assigning to "..." In-Reply-To: <1622543814.93.0.384857928409.issue44278@roundup.psfhosted.org> Message-ID: <1622544080.24.0.769860474779.issue44278@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:43:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Jun 2021 10:43:16 +0000 Subject: [issue44278] Improve syntax error message for assigning to "..." In-Reply-To: <1622543814.93.0.384857928409.issue44278@roundup.psfhosted.org> Message-ID: <1622544196.59.0.0863496844935.issue44278@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Assigning to Ellipsis should be the same as assigning to __debug__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:43:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 01 Jun 2021 10:43:36 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622544216.04.0.844676581914.issue44273@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +25072 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 06:47:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Jun 2021 10:47:41 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622544461.41.0.718285191649.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset fffa0f92adaaed0bcb3907d982506f78925e9052 by Erlend Egeberg Aasland in branch 'main': bpo-42972: Track sqlite3 statement objects (GH-26475) https://github.com/python/cpython/commit/fffa0f92adaaed0bcb3907d982506f78925e9052 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 07:07:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 01 Jun 2021 11:07:32 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622545652.54.0.504912206019.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 39dd141a4ba68bbb38fd00a65cdcff711acdafb5 by Serhiy Storchaka in branch 'main': bpo-44273: Improve syntax error message for assigning to "..." (GH-26477) https://github.com/python/cpython/commit/39dd141a4ba68bbb38fd00a65cdcff711acdafb5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 07:13:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 01 Jun 2021 11:13:17 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622545997.7.0.267905375427.issue44273@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25073 pull_request: https://github.com/python/cpython/pull/26478 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 07:14:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 01 Jun 2021 11:14:23 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622546063.7.0.415673806969.issue44273@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 Jun 1 07:20:00 2021 From: report at bugs.python.org (Pooja Warhekar) Date: Tue, 01 Jun 2021 11:20:00 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622546400.1.0.0783233834561.issue40395@roundup.psfhosted.org> Pooja Warhekar added the comment: Similar issue on windows 8.1 with Python 3.9.5. Repairing also did not work. ---------- nosy: +poojawarhekar2012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 08:21:44 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Tue, 01 Jun 2021 12:21:44 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622550104.76.0.186178761864.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: I guess we will have to wait until Python 3.10 is released and we have more conclusive data about speed and readability of match-case before we can go ahead with this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 09:18:28 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 13:18:28 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622553508.83.0.964892588898.issue40395@roundup.psfhosted.org> Steve Dower added the comment: Pooja, could you share your install logs? Details are in my post directly above yours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 10:06:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 01 Jun 2021 14:06:38 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1622556398.8.0.667093599964.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +25074 pull_request: https://github.com/python/cpython/pull/26479 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 10:11:52 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 01 Jun 2021 14:11:52 +0000 Subject: [issue44277] cpython forks are spammed with dependabot PRs In-Reply-To: <1622526962.42.0.431881645294.issue44277@roundup.psfhosted.org> Message-ID: <1622556712.96.0.826125894993.issue44277@roundup.psfhosted.org> Zachary Ware added the comment: This seems like a Dependabot bug; is there anything we can even do about it? ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 10:14:47 2021 From: report at bugs.python.org (Jesse Silverman) Date: Tue, 01 Jun 2021 14:14:47 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622556887.9.0.834840246.issue44275@roundup.psfhosted.org> Jesse Silverman added the comment: Thank you so much Inada and Eryk and Steve! I was one of the people who mistakenly thought that Python 3 operating in the new Windows Terminal was going to magically leave us sitting happily in completely UTF-8 compatible territory on Windows, not realizing the complex long-term dependencies and regressions that still remain problematic. I had spent a lot of time paying attention to the Python 2 vs. 3 debates with people shouting "I don't care about Unicode!" and mistook dedication to preventing regressions and breakages for a lesser appreciation of the value of UTF-8 support. I have been schooled. We all want the same thing, but getting there on Windows from where we are at the moment remains non-trivial. Heartfelt appreciation to all on the front lines of dealing with this complex and sticky situation. ?????? Also, much love to those who had put in the work to have much more help than I realized existed even when one finds oneself isolated on a single disconnected machine with only the standard docs as a guide? -- I didn't realize the pages I found mojibake on even existed until this weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 10:44:50 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 01 Jun 2021 14:44:50 +0000 Subject: [issue23903] Generate PC/python3.def by scraping headers In-Reply-To: <1428637761.13.0.348463350169.issue23903@psf.upfronthosting.co.za> Message-ID: <1622558690.98.0.274866787679.issue23903@roundup.psfhosted.org> Petr Viktorin added the comment: PEP 652 (bpo-43795) is now in; I'm closing this issue. A cross-platform C parser/checker would still be an improvement, but the constraints (no external dependencies in CPython) and benefits (not many compared to the goal of strict separation of internal/public/stable headers) aren't really aligned in its favor. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 10:49:53 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 01 Jun 2021 14:49:53 +0000 Subject: [issue29086] Document C API that is not part of the limited API In-Reply-To: <1482865319.03.0.627052322458.issue29086@psf.upfronthosting.co.za> Message-ID: <1622558993.3.0.540029024301.issue29086@roundup.psfhosted.org> Petr Viktorin added the comment: PEP 652 is now in, and with it a list of everything that *is* in the stable ABI: https://docs.python.org/3.10/c-api/stable.html#contents-of-limited-api I'm closing the issue. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 12:23:20 2021 From: report at bugs.python.org (Pooja Warhekar) Date: Tue, 01 Jun 2021 16:23:20 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622564600.94.0.707621245812.issue40395@roundup.psfhosted.org> Pooja Warhekar added the comment: Please find the attached log files. ---------- Added file: https://bugs.python.org/file50079/Python log files.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 12:42:15 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 01 Jun 2021 16:42:15 +0000 Subject: [issue37766] IDLE autocomplete: revise fetch_completions, add htest In-Reply-To: <1565037293.97.0.42173755359.issue37766@roundup.psfhosted.org> Message-ID: <1622565735.53.0.518141993878.issue37766@roundup.psfhosted.org> Change by E. Paine : ---------- nosy: +epaine versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 12:57:01 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 01 Jun 2021 16:57:01 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622566621.69.0.135473502481.issue44275@roundup.psfhosted.org> Eryk Sun added the comment: > I was one of the people who mistakenly thought that Python 3 operating > in the new Windows Terminal was going to magically leave us sitting > happily in completely UTF-8 compatible territory on Windows, not > realizing the complex long-term dependencies and regressions that > still remain problematic. Windows Terminal provides a tab-based UI that supports font fallback and complex scripts, which is a significant improvement over the builtin terminal that conhost.exe provides. Each tab is a headless (conpty) console session that's hosted by an instance of OpenConsole.exe. The latter is based on the same source tree as the system conhost.exe, but typically it's a more recent build. The console host is what implements most of the API for client applications. That the host is in headless mode and connected to an alternate terminal doesn't matter from the perspective of client applications. The console has been Unicode (UCS-2) back to its initial release in 1993. Taking advantage of this requires reading and writing wide-character strings via ReadConsoleW and WriteConsoleW, as Python's does in 3.6+ (except not for os.read and os.write). Many console applications instead use encoded byte strings with ReadFile / ReadConsoleA and WriteFile / WriteConsoleA. Updating the console host to support UTF-8 for this has been a drawn-out process. It finally has full support for writing UTF-8 in Windows 10, including splitting a sequence across multiple writes. But reading non-ASCII UTF-8 is still broken. "more.com" uses the console input codepage to decode the file, so a workaround is to run `chcp.com 65001` and run Python in UTF-8 mode, e.g. `py -X utf8=1`. Since reading non-ASCII UTF-8 is broken, you'll have to switch back to the old input codepage if you need to enter non-ASCII characters in an app that reads from the console via ReadFile or ReadConsoleA. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 14:02:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 18:02:31 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise Message-ID: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> New submission from Irit Katriel : "suppresses any of the specified exceptions if they occur in the body of a with statement" Should be: "suppresses any of the specified exceptions if they are raised in the body of a with statement" ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 394863 nosy: docs at python, iritkatriel priority: normal severity: normal status: open title: doc: contextlib.suppress documentation is imprecise versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 14:02:58 2021 From: report at bugs.python.org (MapleCCC) Date: Tue, 01 Jun 2021 18:02:58 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622570578.22.0.620856238547.issue44279@roundup.psfhosted.org> Change by MapleCCC : ---------- keywords: +patch nosy: +MapleCCC nosy_count: 2.0 -> 3.0 pull_requests: +25075 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26428 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 14:38:54 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Tue, 01 Jun 2021 18:38:54 +0000 Subject: [issue44262] tarfile: some content different output In-Reply-To: <1622216364.56.0.487056278945.issue44262@roundup.psfhosted.org> Message-ID: <1622572734.7.0.0132904123353.issue44262@roundup.psfhosted.org> Change by Filipe La?ns : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 15:29:05 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 19:29:05 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622575745.33.0.438030727084.issue40395@roundup.psfhosted.org> Steve Dower added the comment: It still seems like pyexpat is not installing properly. My best guess is that some virus scanner is silently blocking that file from being installed. Do you know what scanner you have enabled? If you can disable it, can you try doing an uninstall/reinstall with it disabled? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 15:42:48 2021 From: report at bugs.python.org (Peter Hawkins) Date: Tue, 01 Jun 2021 19:42:48 +0000 Subject: [issue44280] unittest filters out too many assertion stack frames from context/cause chains Message-ID: <1622576568.02.0.771904699767.issue44280@roundup.psfhosted.org> New submission from Peter Hawkins : Example repro: ``` import unittest def d(): assert 2 == 3 def c(): d() def b(): c() def a(): try: b() except Exception as e: assert 1 == 2 class MyTest(unittest.TestCase): def testException(self): a() if __name__ == '__main__': unittest.main() ``` Example output from Python 3.9.0: ``` $ python atest.py F ====================================================================== FAIL: testException (__main__.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/private/tmp/atest.py", line 15, in a b() File "/private/tmp/atest.py", line 11, in b c() AssertionError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/private/tmp/atest.py", line 23, in testException a() File "/private/tmp/atest.py", line 17, in a assert 1 == 2 AssertionError ---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (failures=1) ``` Too many frames have been filtered out of the `__context__` exception, including a number of relevant frames for `c` and `d`. I believe this happens because unittest sets a `limit` here based on the contents of the main traceback: https://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/unittest/result.py#L182 but that limit applies recursively to the `__context__` and `__cause__` chains, when the intent of the limit was presumably only to filter the main exception. ---------- messages: 394865 nosy: peter.hawkins priority: normal severity: normal status: open title: unittest filters out too many assertion stack frames from context/cause chains versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 15:52:00 2021 From: report at bugs.python.org (Peter Hawkins) Date: Tue, 01 Jun 2021 19:52:00 +0000 Subject: [issue44280] unittest filters out too many assertion stack frames from context/cause chains In-Reply-To: <1622576568.02.0.771904699767.issue44280@roundup.psfhosted.org> Message-ID: <1622577120.11.0.061722063783.issue44280@roundup.psfhosted.org> Change by Peter Hawkins : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:15:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 20:15:37 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622578537.18.0.494428698026.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 87272b70f157af76cb14ff90d73dfc5d9bfb945a by MapleCCC in branch 'main': bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) https://github.com/python/cpython/commit/87272b70f157af76cb14ff90d73dfc5d9bfb945a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:16:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 01 Jun 2021 20:16:59 +0000 Subject: [issue44281] Links on top of collections doc not in the order of sections Message-ID: <1622578619.23.0.835840856741.issue44281@roundup.psfhosted.org> New submission from Andrei Kulakov : https://docs.python.org/3.11/library/collections.html Links are not in the same order as the sections below. It creates some dissonance for the reader to first read the section names above and then continue reading expecting them to be in the same order through the page. Seems like would be an easy fix to reorder them. ---------- assignee: docs at python components: Documentation messages: 394867 nosy: andrei.avk, docs at python priority: normal severity: normal status: open title: Links on top of collections doc not in the order of sections type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:19:34 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 01 Jun 2021 20:19:34 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server In-Reply-To: <1622019183.28.0.514153258509.issue44238@roundup.psfhosted.org> Message-ID: <1622578774.01.0.427493015954.issue44238@roundup.psfhosted.org> Steve Dower added the comment: Unfortunately, I've got no idea whether it's failing to uninstall the MSI or if it's specific to removing the PATH environment variable. If you've still got the rest (no more than 2-3 I'd expect) of the uninstall log files in your %TEMP% directory that may show something. Have you successfully installed/uninstalled other versions of Python before on this machine/OS? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:27:47 2021 From: report at bugs.python.org (Jesse Silverman) Date: Tue, 01 Jun 2021 20:27:47 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622579267.84.0.797754795889.issue44275@roundup.psfhosted.org> Jesse Silverman added the comment: "more.com" uses the console input codepage to decode the file, so a workaround is to run `chcp.com 65001` and run Python in UTF-8 mode, e.g. `py -X utf8=1`. Since reading non-ASCII UTF-8 is broken, you'll have to switch back to the old input codepage if you need to enter non-ASCII characters in an app that reads from the console via ReadFile or ReadConsoleA. Confirmed that this workaround done in Windows Terminal causes all mojibake to immediately evaporate, leaving me with the most readable and enjoyable more/console experience I have ever had since first hitting a spacebar on MS-DOS. (Windows Terminal and the open-sourcing of the CONSOLE code is in a three-way tie with open-sourcing of .Net Core and the C++ STL for changing how I feel about Windows. I keep finding new reasons to love it, except for reading non-ASCII UTF-8 being broken which I just learned about today.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:38:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 01 Jun 2021 20:38:25 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures Message-ID: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> New submission from Terry J. Reedy : idlelib.idle_test.test_colordelagator.ColorDelegatorTest.test_incremental_editing has failed on at least on the following machines. Pip32 CI Pipelines Win32 Gen3x https://buildbot.python.org/all/#/builders/464 x86 Gentoo Installed with X 3.x GenPR https://buildbot.python.org/all/#/builders/465 x86 Gentoo Installed with X PR Failures seen. Since tests are sequential without subtesting, failure means successors are not tested. line keyword start want got 569 ('BUILTIN', '1.0'), ('1.0', '1.3') () Gen3x, x3; GenPR 573 ('BUILTIN', '1.0'), ('1.0', '1.3') () Gen3x, x5 586 ('BUILTIN', '1.0'), ('1.0', '1.3') () GenPR 597 ('KEYWORD', '1.0'), () ('1.0', '1.1') Pip32, x2 As far as I can tell, looking at Windows buildbots, the 1 failure on Win32 has not been repeated. If there have been any on CI machines, I have not been informed. A few years ago, I believe Gentoo was the only *nix buildbot running tkinter and IDLE tests. It has a problem with a builtin at the beginning of the line about 10-20% of test runs. This are the majority of its failures in the last week. Perhaps there is a timing issue we can fix. ---------- assignee: terry.reedy components: IDLE, Tests messages: 394870 nosy: taleinat, terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: ColorDelegatorTest test_incremental_editing failures type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:40:37 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 01 Jun 2021 20:40:37 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622580037.66.0.363175984586.issue44282@roundup.psfhosted.org> Terry J. Reedy added the comment: Followup to PR-26404, which added the tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 16:41:34 2021 From: report at bugs.python.org (Tal Einat) Date: Tue, 01 Jun 2021 20:41:34 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622580094.96.0.690376596828.issue44282@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch pull_requests: +25076 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26404 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:36:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 21:36:26 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622583386.21.0.177083581608.issue44279@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25077 pull_request: https://github.com/python/cpython/pull/26480 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:37:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Jun 2021 21:37:17 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622583437.25.0.34169058006.issue44263@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ee7637596d8de25f54261bbeabc602d31e74f482 by Victor Stinner in branch 'main': bpo-44263: Py_TPFLAGS_HAVE_GC requires tp_traverse (GH-26463) https://github.com/python/cpython/commit/ee7637596d8de25f54261bbeabc602d31e74f482 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:37:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 21:37:40 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622583460.87.0.409832914057.issue44279@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25078 pull_request: https://github.com/python/cpython/pull/26481 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:39:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 01 Jun 2021 21:39:22 +0000 Subject: [issue44263] Better explain the GC contract for PyType_FromSpecWithBases In-Reply-To: <1622246431.18.0.725069449061.issue44263@roundup.psfhosted.org> Message-ID: <1622583562.56.0.032064620464.issue44263@roundup.psfhosted.org> STINNER Victor added the comment: I made sure that it's no longer possible to create a type with Py_TPFLAGS_HAVE_GC flag set but with no traverse function (tp_traverse=NULL). I close again the issue. ---------- components: +C API, Interpreter Core resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:58:12 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 01 Jun 2021 21:58:12 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements Message-ID: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> New submission from Dennis Sweeney : Anecdotally, a few people I've talked to have expected that match-case statements would improve performance in the same way that switch-cases sometimes do in C-like languages. While this is impossible in general without changing semantics (since, for example, __eq__ can have side effects), it would be nice if a jump table was implemented in certain safe cases. My idea was to implement this whenever the list of cases begins with 2 or more of the following in a row: (1) ints (2) strings (3) None (4) OR (`|`) patterns of any of the above (5?) potentially later add support for tuples Example: match x: case 10: # safe print("A") case 20: # safe print("B") case 30 | 31: # safe print("C") case 40: # safe print("D") case MyClass(10, 20): # unsafe print("E") case []: # unsafe print("F") case whatever: # unsafe print("G") This would compile to something like LOAD_FAST (x) LOAD_CONST 16 ({10: 16, 20: 38, 30: 80, 31: 80, 40: 102}) ATTEMPT_SAFE_MATCH 110 ... all the rest of the code is the same ... Where the new opcode would be would be something like case TARGET(ATTEMPT_SAFE_MATCH): { PyObject *jump_dict = POP(); PyObject *x = TOP(); if (PyLong_CheckExact(x) || PyUnicode_CheckExact(x) || Py_Is(x, Py_None)) { PyObject *boxed = PyDict_GetItemWithError(jump_dict, x); Py_DECREF(jump_dict); if (res == NULL) { if (PyErr_Occurred()) { goto error; } else { JUMPBY(oparg); } } assert(PyLong_CheckExact(boxed)); int target = (int)PyLong_AsLong(boxed); JUMPBY(target); } else { // fall back to general matching code Py_DECREF(jump_dict); DISPATCH(); } } I can work on an implementation in the next couple of weeks. ---------- components: Interpreter Core messages: 394874 nosy: Dennis Sweeney priority: normal severity: normal status: open title: Add jump table for certain safe match-case statements type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 17:58:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 21:58:13 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622584693.64.0.294268488502.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 6563ea5c60be2e4896df52eff777aa93743f1551 by Irit Katriel in branch '3.10': [3.10] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26480) https://github.com/python/cpython/commit/6563ea5c60be2e4896df52eff777aa93743f1551 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 18:15:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 22:15:55 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622585755.83.0.875334155328.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 9a688624973a2b753b84f892b65268543c7ff67d by Irit Katriel in branch '3.9': [3.9] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26481) https://github.com/python/cpython/commit/9a688624973a2b753b84f892b65268543c7ff67d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 18:16:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 01 Jun 2021 22:16:20 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622585780.76.0.105694321738.issue44279@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 Jun 1 18:26:49 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 01 Jun 2021 22:26:49 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622586409.07.0.270034686744.issue44275@roundup.psfhosted.org> Inada Naoki added the comment: >> PS > $OutputEncoding = [System.Text.Encoding]::GetEncoding("UTF-8") > FYI, $OutputEncoding in PowerShell has nothing to do with the python.exe and more.com processes, nor the console session to which they're attached. >> PS > [System.Console]::OutputEncoding = $OutputEncoding > The console output code page is irrelevant since more.com writes wide-character text via WriteConsoleW() and decodes the file using the console input code page, GetConsoleCP(). The console output codepage from GetConsoleOutputCP() isn't used for anything here. Yes, both are unrelated to this specific issue. But both are highly recommended for using Python with UTF-8 mode. Now many people want to use Python with UTF-8 mode in PowerShell in Windows Terminal. And they don't want to care about legacy encoding at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 19:48:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 01 Jun 2021 23:48:57 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622591337.93.0.430550337779.issue44283@roundup.psfhosted.org> Raymond Hettinger added the comment: Big +1 from me. This would make use of match-case more compelling. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 20:03:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 00:03:18 +0000 Subject: [issue44281] Links on top of collections doc not in the order of sections In-Reply-To: <1622578619.23.0.835840856741.issue44281@roundup.psfhosted.org> Message-ID: <1622592198.23.0.35492198674.issue44281@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- priority: normal -> low _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 20:03:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 00:03:11 +0000 Subject: [issue44281] Links on top of collections doc not in the order of sections In-Reply-To: <1622578619.23.0.835840856741.issue44281@roundup.psfhosted.org> Message-ID: <1622592191.1.0.254739620969.issue44281@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 20:06:36 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 00:06:36 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622592396.87.0.734666943999.issue44276@roundup.psfhosted.org> Raymond Hettinger added the comment: If the json.encoder code does get updated, it doesn't need two levels of matching. It can be flattened by eliminating the *chunks* variable. match value: case str(): yield _encoder(value) case None: yield 'null' case True: yield 'true' case False: yield 'false' case int(): yield _intstr(value) case float(): yield _floatstr(value) case list() | tuple(): yield from _iterencode_list(value, _current_indent_level) case dict(): yield from _iterencode_dict(value, _current_indent_level) case _: yield from _iterencode(value, _current_indent_level) ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 20:18:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 00:18:00 +0000 Subject: [issue44281] Links on top of collections doc not in the order of sections In-Reply-To: <1622578619.23.0.835840856741.issue44281@roundup.psfhosted.org> Message-ID: <1622593080.29.0.553966072094.issue44281@roundup.psfhosted.org> Raymond Hettinger added the comment: ISTM that the table order doesn't need to match because the links take you directly to the section of interest. They make it so that you don't need to know the order of sections below. Currently, they have a "logical" grouping with the two sequence-like objects side-by-side, the four dict or dict-like subclasses side-by-side, and the other "User" classes side-by-side. The order of the sections below is in alpha order (with the minor exception of deque and defaultdict being swapped). This is also reasonable because a person would likely be scanning the Table of Contents looking for the class or function by its name. This is really no different than a lending library having a title catalog and a subject catalog with the same information arranged in two different ways. Both ways have value. Thank you for the suggestion, but the existing ordering was intentional and is useful. Possibly, we could swap the *deque* and *defaultdict* sections, but the benefit is very minor and likely isn't worth the churn. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 21:11:06 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 01:11:06 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622596266.67.0.605070355663.issue44276@roundup.psfhosted.org> Raymond Hettinger added the comment: In difflib, there's an example where it would be easy to run performance tests. match tag: case 'replace': g = self._fancy_replace(a, alo, ahi, b, blo, bhi) case 'delete': g = self._dump('-', a, alo, ahi) case 'insert': g = self._dump('+', b, blo, bhi) case 'equal': g = self._dump(' ', a, alo, ahi) case _: raise ValueError('unknown tag %r' % (tag,)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 21:15:31 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Jun 2021 01:15:31 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622596531.57.0.396030132089.issue44283@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 21:26:09 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 02 Jun 2021 01:26:09 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1622597169.27.0.791693475156.issue43882@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 21:38:43 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Jun 2021 01:38:43 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622597923.33.0.173685318247.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: Seems like a good idea as long as we're careful about the implementation. I've just jotted down a few notes here: - We should probably break the table upon encountering a guard. - We probably can't get away with storing a dictionary in the code object's constants, since the entire code object needs to be hashable. We could store a tuple of key-value pairs and either (a) build the dictionary each time we enter the block, or (b) stash it somewhere. If we stash it: - Should we defer building it until the first time we hit the block, or earlier than that? - Where would we stash it? - We should probably have some heuristic perhaps more restrictive than "two or more of the following in a row". I'm not entirely sure that loading/building a dictionary, hashing an integer/string/None, looking it up in a dictionary, and then either (a) recovering from the error, or (b) converting the Python integer value into a C long and jumping on it is faster than the current implementation for the first two cases. I know it's really fast, but I'm not *sure* it will be an obvious win yet. Ideally, the best-case scenario (match on first case) would be just as fast as it is currently. I'm probably willing to speed up the average case at the expense of the best case, though. - I'm not sure we need to limit this to leading cases. What's stopping us from having one of these jump tables in the middle of a match block (or even having more than one scattered throughout)? Unless I'm missing something, this should work anytime we observe contiguous "simple" cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 21:40:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Jun 2021 01:40: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: <1622598018.13.0.0344058843266.issue43654@roundup.psfhosted.org> Terry J. Reedy added the comment: Currently, the keys that define certain pseudoevents and invoke the associated event handlers are fixed: tab, '.', and within strings, '/' and '\' for completions, '(' and ')' for calltip open and close, and ')', ']', and '}' for opener matching. Note that quote matching is indicated by coloring completed strings. PR-26421 proposes to augment this list with tab for smart indent, backspace for smart backspace, and newline for completing a line and maybe smart indenting. In other words, remove the following 3 lines '<>': [''], '<>': ['', ''], '<>': [''], from config-keys.def and the Settings Keys tab and add them as fixed binding to EditorWindow.__init__ just above the existing fixed pseudoevent -- keys bindings. Only fixing smart-indent and tab (or unfixing name-completion and tab) is needed to keep name completion working after re-doing setting. So why all three? 1. These three pairs go together; I don't see anything else that should be fixed. 2. By the standard used to fix some pairs already, these three should be also. I think it an accident of IDLE's history that they aren't*. 3. It might be that changing either of the other two binding could disable something, or might in the future. In other words, I consider having this bindings be mutable to be a bit buggy, with this issue being evidence. * Multiple coders, coding convenience, shift of focus from 'consenting adults to 'beginners'? The unknown is whether anyone has changed these pseudoevent bindings and if so, how much do we care? Guido, do you have any comment on this proposal from a change policy perspective? ---------- nosy: +gvanrossum title: IDLE: Applying settings disables tab completion -> IDLE: Fix tab completion after settings and some keys _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 22:47:58 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Jun 2021 02:47:58 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622602078.8.0.0671688357518.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: At first I thought of matches with only the int/str/None cases and then I saw the easy generalization, but yeah, each contiguous block seems better. One solution to the code hashability/lookup speed apparent dilemma: writing the equivalent of this in C: class HashableDict(dict): def __new__(cls, pairs): return dict.__new__(cls, pairs) def __eq__(self, other): return tuple(self.mapping.items()) == tuple(other.sequence.items()) def __hash__(self): return CONSTANT ^ hash(tuple(self.items())) def __getnewargs__(self): return tuple(self.items()) # forbid all mutating methods __setitem__ = __delitem__ = update = __ior__ = None # etc. (Or maybe using composition rather than inheritence) Maybe using the HAMT in /Python/hamt.c would suffice instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 22:53:14 2021 From: report at bugs.python.org (Pooja Warhekar) Date: Wed, 02 Jun 2021 02:53:14 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622602394.85.0.121358768823.issue40395@roundup.psfhosted.org> Pooja Warhekar added the comment: I tried following things. 1. Clearing registry. 2. Web installation 3. Installation in E drive. However problem remains same. Please find the attached log files. Also I couldn't install Microsoft Visual C++ 2015 Redistributable. Could this cause any problem? ---------- Added file: https://bugs.python.org/file50080/Installation log _02062021.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 23:14:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 02 Jun 2021 03:14:08 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622603648.48.0.845788146581.issue44279@roundup.psfhosted.org> Raymond Hettinger added the comment: I think the old wording was better. Code can explicitly raise an exception, but other exceptions just occur when calling builtin functions or with a keyboard interrupt. ---------- nosy: +eric.smith, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 1 23:35:37 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Jun 2021 03:35:37 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622604937.62.0.627031573223.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: Hm. I?m not sure if the HAMT makes much sense. We don?t really care about efficient mutation or copies... constant-time lookups seem to be overwhelmingly the most valuable factor here. I personally think that creating some sort of hashable dict and teaching marshal how to serialize/deserialize it could be a promising path forward. I imagine its actual design could mirror dict (sort of like set/frozenset). That might be a rather drastic step though. Perhaps it?s better to first prove that building a mapping at runtime is too slow. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 00:44:38 2021 From: report at bugs.python.org (helpimnotdrowning) Date: Wed, 02 Jun 2021 04:44:38 +0000 Subject: [issue44284] Python references wrong line but correct line number in traceback Message-ID: <1622609078.37.0.104205223264.issue44284@roundup.psfhosted.org> New submission from helpimnotdrowning : To reproduce (at least on Windows 10 w/ Python 3.9.4): 1) Make a python file: while True: print('hello') 2) Run the file via cmd 3) Edit the file (while it is still running): while True: print('goodbye') print('hello') then save it 4) ctrl+c in the cmd window to exit the script 5) The traceback will look something like this: Traceback (most recent call last): File "dfbssss.py", line 2, in print('goodbye') KeyboardInterrupt The traceback mentions the print('goodbye') even though it wasnt in the file when it was run. It still calls it line 2, which is the line the print('hello') was before adding the print('goodbye') ---------- messages: 394888 nosy: helpimnotdrowning priority: normal severity: normal status: open title: Python references wrong line but correct line number in traceback type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 00:46:22 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Jun 2021 04:46:22 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622609182.18.0.179745475546.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: I agree that we should benchmark for what the value of "two" should be ;) . Maybe only match statements with >=20 consecutive simple cases end up being worth it. I would assume that if "case 1, case 2, ..., case 20" are all in a row then "case 1" wouldn't be *that* much more likely than "case 20", so a slowdown on case 1 wouldn't matter too much if the average gets better. I'm under the impression that match-case statements would frequently be used only once per function call. If I understand your proposal, that would mean that calling a function with a N-case constant-pattern match would require N hashes and N insertions into a dict (including memory allocation), followed by O(1) lookup. Wouldn't that eliminate any hope of making such a function O(1)? Unless there's a way to cache the populated dict somewhere else? I suggested HAMT because it's a well-tested pre-existing fast immutable mapping that already implements __hash__, so it would be safe to store in co_consts already populated. Re-implementing all of the dict logic seems like an unnecessary pain, which is why I was suggesting either the HAMT or a thin wrapper around dict, not a re-implementation of a new hash table. I was hoping to do the minimum amount of disruption possible to get reasonable O(1) performance, and then seeing where that leaves us. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 01:21:08 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 02 Jun 2021 05:21:08 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622611268.74.0.811138514612.issue44275@roundup.psfhosted.org> Eryk Sun added the comment: > Now many people want to use Python with UTF-8 mode in PowerShell > in Windows Terminal. And they don't want to care about legacy > encoding at all. Windows Terminal isn't relevant to the encoding issue. Applications interact with the console session to which they're attached, e.g. python.exe <-> condrv.sys <-> conhost.exe (openconsole.exe). It doesn't matter whether or not the console session is headless (conpty) and connected to another process via pipes (i.e. a console session created via CreatePseudoConsole and set for a child process via PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE). Some settings and behaviors do change in conpty mode (e.g. the session has virtual-terminal mode enabled by default), but the way encoding and decoding are implemented for ReadFile/ReadConsoleA and WriteFile/WriteConsoleA doesn't change. There are still a lot of programs that read and write from the console as a regular file via ReadFile and WriteFile, so the fact that ReadFile is broken when the input code page is set to UTF-8 is relevant to most people. However, people who run `chcp 65001` in Western locales usually only care about being able to write non-ASCII UTF-8 via WriteFile. Reading non-ASCII UTF-8 from console input via ReadFile doesn't come up as a common problem, but it definitely is a problem. For example: >>> s = os.read(0, 12) ?????? ??? >>> s b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00\r\n' Thus I don't like 'solving' this mojibake issue by simply recommending that users set the console input codepage to UTF-8. I previously proposed two solutions. (1) a radical change to get full Unicode support: modify pydoc to temporarily change the console input codepage to UTF-8 and write the temp file as UTF-8. (2) a conservative change just to avoid mojibake: modify pydoc to query the console input codepage and write the file using that encoding, as always with the backslashreplace error handler. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 02:46:42 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Jun 2021 06:46:42 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622616402.59.0.519888382281.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: > If I understand your proposal, that would mean that calling a function with a N-case constant-pattern match would require N hashes and N insertions into a dict (including memory allocation), followed by O(1) lookup. Wouldn't that eliminate any hope of making such a function O(1)? Unless there's a way to cache the populated dict somewhere else? Yeah, that was the idea sketched out above. Basically, if we go with a vanilla dictionary here, we're going to need to build it at runtime. It only really makes sense to do that once, the first time we need it. Then we stash it away... uh... somewhere. As you note, it doesn't make much sense to spend linear time building a constant-time jump table if it's only going to be used once. :) Maybe somebody familiar with the constantly-evolving opcaches could chime in if this is the sort of thing that could benefit from that infrastructure. Basically, we would need a separate cache per bytecode offset, per code object. My understanding is that we don't have anything like that yet. (A quick-and-dirty prototype could probably store them at "hidden" local names like ".table0", ".table1", ".table2", etc. I know comprehensions do something like that.) > Re-implementing all of the dict logic seems like an unnecessary pain, which is why I was suggesting either the HAMT or a thin wrapper around dict, not a re-implementation of a new hash table. Well, I don't think we'd need to do any of that. I believe set and frozenset share the same core design and routines, but differ only in the interfaces provided by the objects themselves. I imagine we could do something similar with a hypothetical _PyFrozenDict_Type... copy most of the type definition, dropping all of the methods except mp_subcript, tp_hash, and a few other members. That would probably be all we needed to get this design up and running for a proof-of-concept. A lot of work goes into making dicts fast (especially for things like strings), so it would be nice for a new type to be able to benefit from those incremental improvements. > I was hoping to do the minimum amount of disruption possible to get reasonable O(1) performance, and then seeing where that leaves us. Agreed, but the HAMT mapping has logarithmic time complexity for lookups, right? Maybe for realistic cases the coefficients make it basically equivalent, but on the surface it seems more promising to try reusing the dict guts instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 03:03:36 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 02 Jun 2021 07:03:36 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622617416.55.0.975885921939.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: FWIW PEP 603 includes a graph (Figure 2) of dict.get versus hamt.get performance as the mappings grow, and it seems the hamt is roughly 1.4x slower on inputs of sizes between 10 and 1000. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 03:30:41 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Wed, 02 Jun 2021 07:30:41 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622619041.94.0.417393155754.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: I have timed the execution of if-else and match-case on Differ().compare from difflib module and here is what I got When both strings are same ********************************************************************************************** if-else: 2.504900476196781e-06, match-case: 2.587399649200961e-06, comparisions : 10 if-else: 2.222519979113713e-06, match-case: 1.7874199693324045e-06, comparisions : 100 if-else: 1.954343999386765e-06, match-case: 1.8695319959078916e-06, comparisions : 1000 if-else: 3.2847548005520366e-06, match-case: 1.928162499825703e-06, comparisions : 10000 if-else: 1.2241538699890953e-06, match-case: 7.870903900038684e-07, comparisions : 100000 if-else: 7.950048359998618e-07, match-case: 7.883418589990469e-07, comparisions : 1000000 if-else: 7.941918295000505e-07, match-case: 7.882559125006082e-07, comparisions : 10000000 if-else: 7.928842861700104e-07, match-case: 7.855620772999828e-07, comparisions : 100000000 ********************************************************************************************** When strings have some difference ********************************************************************************************** if-else: 2.7084999601356687e-06, match-case: 2.6756002625916154e-06, comparisions : 10 if-else: 2.207159996032715e-06, match-case: 1.8606500088935719e-06, comparisions : 100 if-else: 2.139014999556821e-06, match-case: 1.928671001223847e-06, comparisions : 1000 if-else: 2.682303600158775e-06, match-case: 2.626289399631787e-06, comparisions : 10000 if-else: 1.1338948200136655e-06, match-case: 7.989683500636602e-07, comparisions : 100000 if-else: 7.862168830033624e-07, match-case: 7.83532044995809e-07, comparisions : 1000000 if-else: 7.918311449997419e-07, match-case: 7.843428884996683e-07, comparisions : 10000000 if-else: 7.843063791000168e-07, match-case: 7.842913352399773e-07, comparisions : 100000000 ********************************************************************************************** ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 03:41:27 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 02 Jun 2021 07:41:27 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622619041.94.0.417393155754.issue44276@roundup.psfhosted.org> Message-ID: <20210602074112.GH19019@ando.pearwood.info> Steven D'Aprano added the comment: How did you do the timing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 03:43:23 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Wed, 02 Jun 2021 07:43:23 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622619803.12.0.130625468679.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: I have used timeit module. I have also attached the test file with this message ---------- Added file: https://bugs.python.org/file50081/match_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 03:57:37 2021 From: report at bugs.python.org (megahypex) Date: Wed, 02 Jun 2021 07:57:37 +0000 Subject: [issue44225] stop() on a stopped loop inhibits the next run_forever In-Reply-To: <1621864500.68.0.698974665146.issue44225@roundup.psfhosted.org> Message-ID: <1622620657.92.0.556785321197.issue44225@roundup.psfhosted.org> megahypex added the comment: Can I be assigned this issue? ---------- nosy: +WhosMega _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 04:23:39 2021 From: report at bugs.python.org (Ricardo Daniel Fuentes) Date: Wed, 02 Jun 2021 08:23:39 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server In-Reply-To: <1622578774.01.0.427493015954.issue44238@roundup.psfhosted.org> Message-ID: Ricardo Daniel Fuentes added the comment: Hi Steve, I am attaching the latest log files I see on temp. This is the first version of python I have installed on this server, we do install and uninstall SW on this machine all the time. As we run the operations and need to update sw there often. Thanks, Regards, Ricardo On Tue, Jun 1, 2021 at 10:19 PM Steve Dower wrote: > > Steve Dower added the comment: > > Unfortunately, I've got no idea whether it's failing to uninstall the MSI > or if it's specific to removing the PATH environment variable. If you've > still got the rest (no more than 2-3 I'd expect) of the uninstall log files > in your %TEMP% directory that may show something. > > Have you successfully installed/uninstalled other versions of Python > before on this machine/OS? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- Added file: https://bugs.python.org/file50082/archive (1).zip _______________________________________ Python tracker _______________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: archive (1).zip Type: application/x-zip-compressed Size: 23358 bytes Desc: not available URL: From report at bugs.python.org Wed Jun 2 04:52:06 2021 From: report at bugs.python.org (=?utf-8?b?TWljaGHFgiBHw7Nybnk=?=) Date: Wed, 02 Jun 2021 08:52:06 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622623926.95.0.67138381641.issue44022@roundup.psfhosted.org> Micha? G?rny added the comment: The test added for this bug is insufficient to verify the fix. If I revert the Lib/http/client.py change, the test still passes. This is because a subclass of client.HTTPException is still raised. If I add an explicit begin() call to trigger the exception, then without the fix I get: File "/tmp/cpython/Lib/test/test_httplib.py", line 1189, in test_overflowing_header_limit_after_100 resp.begin() File "/tmp/cpython/Lib/http/client.py", line 308, in begin version, status, reason = self._read_status() File "/tmp/cpython/Lib/http/client.py", line 277, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response With the fix, I get (correctly): test test_httplib failed -- Traceback (most recent call last): File "/tmp/cpython/Lib/test/test_httplib.py", line 1189, in test_overflowing_header_limit_after_100 resp.begin() File "/tmp/cpython/Lib/http/client.py", line 321, in begin skipped_headers = _read_headers(self.fp) File "/tmp/cpython/Lib/http/client.py", line 218, in _read_headers raise HTTPException("got more than %d headers" % _MAXHEADERS) http.client.HTTPException: got more than 100 headers However, the test considers both exceptions to match. ---------- nosy: +mgorny _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 05:22:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 09:22:26 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622625746.93.0.922886314236.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: I see, that?s a good point. Any suggestion regarding the original confusion with warnings? (See PR 26428). ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 06:26:05 2021 From: report at bugs.python.org (megahypex) Date: Wed, 02 Jun 2021 10:26:05 +0000 Subject: [issue44225] stop() on a stopped loop inhibits the next run_forever In-Reply-To: <1621864500.68.0.698974665146.issue44225@roundup.psfhosted.org> Message-ID: <1622629565.51.0.81671038171.issue44225@roundup.psfhosted.org> Change by megahypex : ---------- keywords: +patch pull_requests: +25079 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26483 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 08:26:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Jun 2021 12:26:13 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622636773.32.0.874866054352.issue44165@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a384b6c04054a2c5050a99059836175cf73e2016 by Erlend Egeberg Aasland in branch 'main': bpo-44165: Optimise sqlite3 statement preparation by passing string size (GH-26206) https://github.com/python/cpython/commit/a384b6c04054a2c5050a99059836175cf73e2016 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 08:27:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Jun 2021 12:27:23 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622636843.29.0.269874220196.issue44165@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Erlend, check out https://github.com/python/cpython/pull/26206#discussion_r643910263. After that we can close this issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 08:41:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 12:41:55 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622637715.07.0.728925812076.issue44165@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25080 pull_request: https://github.com/python/cpython/pull/26484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:09:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 13:09:17 +0000 Subject: [issue17792] Unhelpful UnboundLocalError due to del'ing of exception target In-Reply-To: <1366329322.51.0.489771554551.issue17792@psf.upfronthosting.co.za> Message-ID: <1622639357.53.0.540215696566.issue17792@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f by Irit Katriel in branch 'main': bpo-17792: more accurate error message for unbound variable access exceptions (GH-24976) https://github.com/python/cpython/commit/7b1f527d5b37dc3aa085ebbe11a1a2dd29ef210f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:13:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 13:13:18 +0000 Subject: [issue17792] Unhelpful UnboundLocalError due to del'ing of exception target In-Reply-To: <1366329322.51.0.489771554551.issue17792@psf.upfronthosting.co.za> Message-ID: <1622639598.49.0.436277914393.issue17792@roundup.psfhosted.org> Irit Katriel added the comment: Following a discussion on PR24976 we opted for "cannot access local variable 'x' where it is not associated with a value" This is because binding it not always related to assignment. I don't know whether this completely resolves this issue, or whether there is still something to change around the None-setting of except targets. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:22:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Jun 2021 13:22:24 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622640144.07.0.769013505754.issue44165@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fbf25b8c0dd1e62db59117d53bbd2d4131a06867 by Erlend Egeberg Aasland in branch 'main': bpo-44165: pysqlite_statement_create now returns a Py object, not an int (GH-26484) https://github.com/python/cpython/commit/fbf25b8c0dd1e62db59117d53bbd2d4131a06867 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:23:49 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 13:23:49 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622640229.89.0.363328836573.issue44165@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Erlend, check out https://github.com/python/cpython/pull/26206#discussion_r643910263. After that we can close this issue See msg393857: I'll add a PR for _pysqlite_connection_begin as well. After that, we can close this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:26:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 13:26:30 +0000 Subject: [issue44165] [sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size In-Reply-To: <1621322586.94.0.0941368133746.issue44165@roundup.psfhosted.org> Message-ID: <1622640390.59.0.655424389333.issue44165@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25081 pull_request: https://github.com/python/cpython/pull/26485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:39:39 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 02 Jun 2021 13:39:39 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". Message-ID: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> New submission from Charalampos Stratakis : This is an issue as it seems with coverity as it's an error case where the file was not actually opened. This warning can be silenced and the code be made more explicit by adding an assertion. Python-3.9.1/Modules/getpath.c:1264: alloc_arg: "calculate_open_pyenv" allocates memory that is stored into "env_file". Python-3.9.1/Modules/getpath.c:1266: leaked_storage: Variable "env_file" going out of scope leaks the storage it points to. # 1264| status = calculate_open_pyenv(calculate, &env_file); # 1265| if (_PyStatus_EXCEPTION(status)) { # 1266|-> return status; # 1267| } # 1268| if (env_file == NULL) { ---------- messages: 394906 nosy: cstratak priority: normal severity: normal status: open title: Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:44:53 2021 From: report at bugs.python.org (Charalampos Stratakis) Date: Wed, 02 Jun 2021 13:44:53 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622641493.68.0.453715928962.issue44285@roundup.psfhosted.org> Change by Charalampos Stratakis : ---------- keywords: +patch pull_requests: +25082 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26486 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:49:10 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 02 Jun 2021 13:49:10 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622641750.72.0.044159395956.issue44285@roundup.psfhosted.org> Petr Viktorin added the comment: +1, for adding the assertion. It's not trivial to see that env_file must be NULL here, even for me (a human). ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 09:53:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 13:53:07 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622641987.52.0.156795212496.issue44285@roundup.psfhosted.org> STINNER Victor added the comment: I still plan to rewrite getpath.c C file in Python: https://bugs.python.org/issue42260 But it's an incompatible change and a low priority for me. ---------- nosy: +vstinner versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:02:00 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 02 Jun 2021 14:02:00 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622642520.28.0.115264652605.issue44283@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:03:06 2021 From: report at bugs.python.org (john kim) Date: Wed, 02 Jun 2021 14:03:06 +0000 Subject: [issue44286] venv activate script would be good to show failure. Message-ID: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> New submission from john kim : I changed the path of the project using venv, so it didn't work properly. I thought it worked successfully because there was a (venv) on the terminal line. However, the __VENV_DIR__ in the set "VIRTUAL_ENV=__VENV_DIR__" in the activate script did not work properly because it was the PATH before the replacement. How about adding a procedure to verify the __VENV_DIR__ is a valid PATH to the Activate Script? ---------- components: Library (Lib) messages: 394909 nosy: idle947 priority: normal severity: normal status: open title: venv activate script would be good to show failure. type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:03:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 14:03:16 +0000 Subject: [issue44284] Python references wrong line but correct line number in traceback In-Reply-To: <1622609078.37.0.104205223264.issue44284@roundup.psfhosted.org> Message-ID: <1622642596.25.0.6514027439.issue44284@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Unupdated source file in traceback _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:06:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 14:06:41 +0000 Subject: [issue44280] unittest filters out too many assertion stack frames from context/cause chains In-Reply-To: <1622576568.02.0.771904699767.issue44280@roundup.psfhosted.org> Message-ID: <1622642801.76.0.143625805866.issue44280@roundup.psfhosted.org> Irit Katriel added the comment: Agreed. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> unittest swallows part of stack trace when raising AssertionError in a TestCase _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:16:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 14:16:45 +0000 Subject: [issue20393] Docs: mark deprecated items in the TOC In-Reply-To: <1390685369.63.0.965002484298.issue20393@psf.upfronthosting.co.za> Message-ID: <1622643405.03.0.973120044421.issue20393@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:17:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 14:17:40 +0000 Subject: [issue39170] Sqlite3 row_factory for attribute access: NamedRow In-Reply-To: <1577775474.34.0.0934062423159.issue39170@roundup.psfhosted.org> Message-ID: <1622643460.38.0.818995627655.issue39170@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-13299 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:18:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 14:18:26 +0000 Subject: [issue13299] namedtuple row factory for sqlite3 In-Reply-To: <1320021145.59.0.53370875256.issue13299@psf.upfronthosting.co.za> Message-ID: <1622643506.01.0.596458300678.issue13299@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-39170 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:25:06 2021 From: report at bugs.python.org (Aaron Gallagher) Date: Wed, 02 Jun 2021 14:25:06 +0000 Subject: [issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default In-Reply-To: <1586118564.22.0.0408193741044.issue40199@roundup.psfhosted.org> Message-ID: <1622643906.41.0.57241461878.issue40199@roundup.psfhosted.org> Aaron Gallagher <_ at habnab.it> added the comment: This is definitely not windows-specific. On macos: $ python3.9 Python 3.9.4 (default, Apr 5 2021, 01:47:16) [Clang 11.0.0 (clang-1100.0.33.17)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> '\s' '\\s' ---------- nosy: +habnabit _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:29:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 14:29:29 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622644169.44.0.473438366655.issue41611@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +vstinner nosy_count: 7.0 -> 8.0 pull_requests: +25083 pull_request: https://github.com/python/cpython/pull/26487 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:30:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 14:30:22 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622644222.02.0.987541102646.issue44282@roundup.psfhosted.org> STINNER Victor added the comment: Buildbots are very unstable these days. I propose to revert the change to give more time to IDLE developers to investigate the issue, and to be able to identify other regressions on buildbots. https://pythondev.readthedocs.io/ci.html#revert-on-fail I created https://github.com/python/cpython/pull/26487 to revert ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:34:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 14:34:03 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 Message-ID: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Windows8.1 Refleaks 3.9: https://buildbot.python.org/all/#/builders/6/builds/31 2:16:22 load avg: 7.33 [364/425/2] test_asyncio crashed (Exit code 1) -- running: test_decimal (2 min 33 sec), test_dbm (2 min 53 sec), test_bufio (18 min 18 sec) ["test_asyncio", 0, 268.7466852, null] beginning 6 repetitions 123456 D:\buildarea\3.9.ware-win81-release.refleak\build\lib\subprocess.py:1052: ResourceWarning: subprocess 2724 is still running _warn("subprocess %s is still running" % self.pid, ResourceWarning: Enable tracemalloc to get the object allocation traceback D:\buildarea\3.9.ware-win81-release.refleak\build\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed _warn(f"unclosed {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback D:\buildarea\3.9.ware-win81-release.refleak\build\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed _warn(f"unclosed {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback D:\buildarea\3.9.ware-win81-release.refleak\build\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed _warn(f"unclosed {self!r}", ResourceWarning, source=self) ResourceWarning: Enable tracemalloc to get the object allocation traceback test test_asyncio failed -- Traceback (most recent call last): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\test_asyncio\test_windows_utils.py", line 111, in test_popen self.assertEqual(res, _winapi.WAIT_OBJECT_0) AssertionError: 258 != 0 Traceback (most recent call last): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 906, in temp_dir yield path File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 958, in temp_cwd yield cwd_dir File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\libregrtest\main.py", line 638, in main self._main(tests, kwargs) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\libregrtest\main.py", line 658, in _main run_tests_worker(self.ns, self.worker_test_name) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\libregrtest\runtest_mp.py", line 86, in run_tests_worker sys.exit(0) SystemExit: 0 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 329, in _force_run return func(*args) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\buildarea\\3.9.ware-win81-release.refleak\\build\\build\\test_python_6648?\\test_python_worker_1760?' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\regrtest.py", line 47, in _main() File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\regrtest.py", line 43, in _main main() File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\libregrtest\main.py", line 716, in main Regrtest().main(tests=tests, **kwargs) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\libregrtest\main.py", line 638, in main self._main(tests, kwargs) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 958, in temp_cwd yield cwd_dir File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\contextlib.py", line 135, in __exit__ self.gen.throw(type, value, traceback) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 911, in temp_dir rmtree(path) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 452, in rmtree _rmtree(path) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 393, in _rmtree _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 340, in _waitfor func(pathname) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 393, in _waitfor(lambda p: _force_run(p, os.rmdir, p), path) File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\__init__.py", line 335, in _force_run return func(*args) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\buildarea\\3.9.ware-win81-release.refleak\\build\\build\\test_python_6648?\\test_python_worker_1760?' ---------- components: asyncio messages: 394915 nosy: asvetlov, vstinner, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:54:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 14:54:20 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622645660.96.0.245157771074.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: On the main branch, I can reproduce test_pha_required_nocert() failure: vstinner at DESKTOP-DK7VBIL C:\vstinner\python\main>python -m test test_ssl -u all -v -F -j5 -m test_pha_required_nocert test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 57456) client cert is None client did not provide a cert server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) TLS: (, 'write', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICA TE_REQUIRED, b'\x02t') Test server failure: Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2444, in run msg = self.read() File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2421, in read return self.sslconn.read() File "C:\vstinner\python\main\lib\ssl.py", line 1131, in read return self._sslobj.read(len) ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2522) FAIL ====================================================================== FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 4458, in test_pha_required_nocert with self.assertRaisesRegex( AssertionError: SSLError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 10:54:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 02 Jun 2021 14:54:58 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622645698.03.0.568295503121.issue44285@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset bdb56902a3bfe12b10f85a941d5dd0eae739f1a8 by stratakis in branch 'main': bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) https://github.com/python/cpython/commit/bdb56902a3bfe12b10f85a941d5dd0eae739f1a8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:00:05 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 15:00:05 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622646005.19.0.684273012422.issue44282@roundup.psfhosted.org> Tal Einat added the comment: Please note that the referenced PR is not the correct one. I'll add a link to the right one shortly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:03:18 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 15:03:18 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622646198.67.0.992579820656.issue44282@roundup.psfhosted.org> Tal Einat added the comment: The latest PR where changes were made to IDLE's colorizer and its tests, including specifically adding the problematic test, is GH-25851. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:05:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 15:05:01 +0000 Subject: [issue44288] unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None Message-ID: <1622646301.21.0.530084460919.issue44288@roundup.psfhosted.org> New submission from STINNER Victor : Sometimes, when a test fails in the main branch, unittest fails with the following error: ... File "C:\vstinner\python\main\lib\unittest\result.py", line 205, in _is_relevant_tb_level return '__unittest' in tb.tb_frame.f_globals TypeError: argument of type 'NoneType' is not iterable I only see this error in the main branch, so I suspect that it's a recent change. Mark, Guido: can it be related to the recent optimization work? Full log: vstinner at DESKTOP-DK7VBIL C:\vstinner\python\main>python -u -m test test_ssl -u all -v -m test_pha_required_nocert -F -j5 (...) 0:00:27 load avg: 15.68 [ 47/1] test_ssl failed test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Windows ('10', '10.0.19043', 'SP0', 'Multiprocessor Free') HAS_SNI = True OP_ALL = 0x-7fffffac OP_NO_TLSv1_1 = 0x10000000 test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ... server: new connection from ('127.0.0.1', 57613) client cert is None client did not provide a cert server: connection cipher is now ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256) TLS: (, 'write', TLSVersion.TLSv1_3, _TLSContentType.ALERT, _TLSAlertType.CERTIFICA TE_REQUIRED, b'\x02t') Test server failure: Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2444, in run msg = self.read() File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2421, in read return self.sslconn.read() File "C:\vstinner\python\main\lib\ssl.py", line 1131, in read return self._sslobj.read(len) ssl.SSLError: [SSL: PEER_DID_NOT_RETURN_A_CERTIFICATE] peer did not return a certificate (_ssl.c:2522) Warning -- threading_cleanup() failed to cleanup 0 threads (count: 0, dangling: 2) Warning -- Dangling thread: Warning -- Dangling thread: <_MainThread(MainThread, started 1592)> Warning -- threading._dangling was modified by test_ssl Before: {} After: {, } test test_ssl crashed -- Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\libregrtest\runtest.py", line 282, in _runtest_inner refleak = _runtest_inner2(ns, test_name) File "C:\vstinner\python\main\lib\test\libregrtest\runtest.py", line 246, in _runtest_inner2 test_runner() File "C:\vstinner\python\main\lib\test\test_ssl.py", line 5010, in test_main support.run_unittest(*tests) File "C:\vstinner\python\main\lib\test\support\__init__.py", line 1083, in run_unittest _run_suite(suite) File "C:\vstinner\python\main\lib\test\support\__init__.py", line 960, in _run_suite result = runner.run(suite) File "C:\vstinner\python\main\lib\unittest\runner.py", line 176, in run test(result) File "C:\vstinner\python\main\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\main\lib\unittest\suite.py", line 122, in run test(result) File "C:\vstinner\python\main\lib\unittest\suite.py", line 84, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\main\lib\unittest\suite.py", line 122, in run test(result) File "C:\vstinner\python\main\lib\unittest\case.py", line 652, in __call__ return self.run(*args, **kwds) File "C:\vstinner\python\main\lib\unittest\case.py", line 600, in run self._feedErrorsToResult(result, outcome.errors) File "C:\vstinner\python\main\lib\unittest\case.py", line 516, in _feedErrorsToResult result.addFailure(test, exc_info) File "C:\vstinner\python\main\lib\test\support\testresult.py", line 123, in addFailure super().addFailure(test, err) File "C:\vstinner\python\main\lib\unittest\runner.py", line 75, in addFailure super(TextTestResult, self).addFailure(test, err) File "C:\vstinner\python\main\lib\unittest\result.py", line 17, in inner return method(self, *args, **kw) File "C:\vstinner\python\main\lib\unittest\result.py", line 122, in addFailure self.failures.append((test, self._exc_info_to_string(err, test))) File "C:\vstinner\python\main\lib\unittest\result.py", line 182, in _exc_info_to_string length = self._count_relevant_tb_levels(tb) File "C:\vstinner\python\main\lib\unittest\result.py", line 209, in _count_relevant_tb_levels while tb and not self._is_relevant_tb_level(tb): File "C:\vstinner\python\main\lib\unittest\result.py", line 205, in _is_relevant_tb_level return '__unittest' in tb.tb_frame.f_globals TypeError: argument of type 'NoneType' is not iterable ---------- components: Interpreter Core messages: 394920 nosy: gvanrossum, mark.dickinson, vstinner priority: normal severity: normal status: open title: unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:05:24 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 15:05:24 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622646324.86.0.539736688202.issue44282@roundup.psfhosted.org> Tal Einat added the comment: I'm investigating this now. If nothing obvious comes up, I'll revert that PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:09:05 2021 From: report at bugs.python.org (Andrzej Mateja) Date: Wed, 02 Jun 2021 15:09:05 +0000 Subject: [issue44289] tarfile.is_tarfile() modifies file object's current position Message-ID: <1622646545.23.0.614350359918.issue44289@roundup.psfhosted.org> New submission from Andrzej Mateja : Since Python 3.9 tarfile.is_tarfile accepts not only paths but also files and file-like objects (bpo-29435). Verification if a file or file-like object is a tar file modifies file object's current position. Imagine a function listing names of all tar archive members but checking first if this is a valid tar archive. When its argument is a str or pathlib.Path this is quite straightforward. If the argument is a file of file-like object then current position must be reset or TarFile.getmembers() returns empty list. import tarfile def list_tar(archive): if tarfile.is_tarfile(archive): kwargs = {'fileobj' if hasattr(archive, 'read') else 'name': archive} t = tarfile.open(**kwargs) return [member.name for member in t.getmembers()] return [] if __name__ == '__main__': path = 'archive.tar.gz' print(list_tar(path)) print(list_tar(open(path, 'rb'))) ['spam.py', 'ham.py', 'bacon.py', 'eggs.py'] [] ---------- components: Library (Lib) messages: 394922 nosy: mateja.and priority: normal severity: normal status: open title: tarfile.is_tarfile() modifies file object's current position type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:17:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 02 Jun 2021 15:17:04 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1622647024.0.0.477878902703.issue43795@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:23:44 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Jun 2021 15:23:44 +0000 Subject: [issue44289] tarfile.is_tarfile() modifies file object's current position In-Reply-To: <1622646545.23.0.614350359918.issue44289@roundup.psfhosted.org> Message-ID: <1622647424.24.0.371173685913.issue44289@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +25084 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26488 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:31:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 15:31:11 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622647871.75.0.554583469378.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: > Refleak buildbots should get a longer timeout for the "test" step. I changed buildbot Test step timeout from 3 hours to 4 hours: * https://github.com/python/buildmaster-config/commit/9e0c812694d6fa599b4c8890045ed006fe7c1f6b * https://github.com/python/buildmaster-config/pull/252 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:42:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 15:42:17 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622648537.06.0.0722291760072.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25085 pull_request: https://github.com/python/cpython/pull/26489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 11:45:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 15:45:36 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622648736.93.0.874608134456.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: > FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) When this bug occurs, s.recv(1024) returns an empty byte string (b''). I wrote PR 26489 to handle this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 12:07:56 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 16:07:56 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622650076.83.0.152539615377.issue44282@roundup.psfhosted.org> Tal Einat added the comment: On Ubuntu 20.04, I've managed to occasionally get this issue to reproduce locally by running the test many times in parallel, repeatedly: parallel -n8 -N0 './python -m test -ugui test_idle -m test_colorizer' ::: $(seq 20) This appears to be an issue with our new method of running tests with a Tk mainloop in the background, using the @run_in_tk_mainloop decorator. Investigating further. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 12:17:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 16:17:00 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' Message-ID: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> New submission from STINNER Victor : x86-64 macOS 3.x: https://buildbot.python.org/all/#/builders/366/builds/322 The build 322 is the first error. Build 320 was fine, 321 failed with "retry lost connection test (retry)". (...) gcc -c -Wno-unused-result -Wsign-compare -g -O0 -Wall -Qunused-arguments -Qunused-arguments -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Modules/_math.o Modules/_math.c CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup ' OPT='-g -O0 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python.exe -E ./setup.py build running build running build_ext error: [Errno 2] No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' make: *** [sharedmods] Error 1 program finished with exit code 2 elapsedTime=29.576823 ---------- components: Build messages: 394926 nosy: ned.deily, ronaldoussoren, vstinner priority: normal severity: normal status: open title: x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 12:20:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 02 Jun 2021 16:20:29 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622650829.67.0.0809915763658.issue44290@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 12:51:47 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 02 Jun 2021 16:51:47 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622652707.77.0.918870219889.issue44276@roundup.psfhosted.org> Brandt Bucher added the comment: Hm, that benchmark seems really noisy. Looking at your code, it appears that you aren't actually iterating over the results. I've attached a version of your benchmark rewritten to use pyperf. Here are the results on a system with a fresh PGO/LTO build of CPython main, run with CPU isolation: (py) bucher at is-bucher-p1:~/src/patmaperformance$ sudo $(which pyperf) system tune > /dev/null (py) bucher at is-bucher-p1:~/src/patmaperformance$ sudo $(which python) if_match.py --rigorous ......................................... if: Mean +- std dev: 2.16 ms +- 0.13 ms ......................................... match: Mean +- std dev: 2.13 ms +- 0.07 ms It appears that there is no significant difference between the two (which is what I expect, given the current implementation). With that said, our work in issue 44283 will likely have a significant impact for cases like this. ---------- Added file: https://bugs.python.org/file50083/if_match.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 13:36:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Jun 2021 17:36:10 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1622655370.94.0.567004993829.issue41611@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: -25083 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 13:42:54 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 02 Jun 2021 17:42:54 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622655774.17.0.155443944778.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: I'm not sure I understand why the discussion was focused on removing *all* empty values. Consider this in a context of a cvs-like string: 1. 'a,b,c' => [a,b,c] # of course 2. ',,' => ['','',''] # follows naturally from above 3. '' => [] # arguably most intuitive 4. '' => [''] # less intuitive but can be correct >From the point of view of intent of the initial string, the first two are clear - 3 values are provided, in 2) they just happen to be empty. It's up to the later logic to skip empty values if needed. The empty string is ambiguous because the intent may be no values or a single empty value. So ideally the new API would let me choose explicitly between 3) and 4). But I don't see why it would affect 2) !! The processing of 2) is already not ambiguous. That's what I would want any version of split() to do, and later filter or skip empty values. Current patch either forces me to choose 4) or to explicitly choose but also break normal, "correct" handling of 2). It can lead to bugs as follows: Let's say I have a csv-like string: col1,col2,col3 1,2,3 a,b,c I note that row 2 creates an empty col1 value, which is probably not what I want. I look at split() args and think that keepempty=False is designed for this use case. I use it in my code. Next time the code will break when someone adds a row: a,,c ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 13:56:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Jun 2021 17:56:20 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622656580.53.0.757600075591.issue44282@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- Removed message: https://bugs.python.org/msg394871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:08:16 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Jun 2021 18:08:16 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622657296.9.0.403398128523.issue44290@roundup.psfhosted.org> Ned Deily added the comment: I can't reproduce that failure with that checkout and I'm not even entirely sure where that error is coming from. My guess it that something went wrong during the previous build that resulted in the connection lost (a system crash perhaps?) that left the build area or the file system in an unusual state. @mattbillenstein, could you check the buildbot and perhaps delete the build directory? ---------- nosy: +mattbillenstein _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:15:50 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Jun 2021 18:15:50 +0000 Subject: [issue44286] venv activate script would be good to show failure. In-Reply-To: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> Message-ID: <1622657750.61.0.389381100396.issue44286@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:15:47 2021 From: report at bugs.python.org (Matt Billenstein) Date: Wed, 02 Jun 2021 18:15:47 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622657296.9.0.403398128523.issue44290@roundup.psfhosted.org> Message-ID: <01010179cdf03bd7-b36eaf29-b981-47a8-bab3-54cd3423637d-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: I rebuilt it a while ago which could have caused this - can you re-run the affected build? thx m On Wed, Jun 02, 2021 at 06:08:16PM +0000, Ned Deily wrote: > > Ned Deily added the comment: > > I can't reproduce that failure with that checkout and I'm not even entirely sure where that error is coming from. My guess it that something went wrong during the previous build that resulted in the connection lost (a system crash perhaps?) that left the build area or the file system in an unusual state. > > @mattbillenstein, could you check the buildbot and perhaps delete the build directory? > > ---------- > nosy: +mattbillenstein > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:24:23 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Jun 2021 18:24:23 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622658263.1.0.243777009187.issue44290@roundup.psfhosted.org> Ned Deily added the comment: Hmm, I just tried to restart it from the builbot page but the build request is just sitting there ATM. https://buildbot.python.org/all/#/builders/366 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:31:52 2021 From: report at bugs.python.org (Kirill Pinchuk) Date: Wed, 02 Jun 2021 18:31:52 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers Message-ID: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> New submission from Kirill Pinchuk : Probably we should make the behavior of SysLogHandler consistent with other Socket handlers. Right now SocketHandler and DatagramHandler implement such behavior: 1) on `close` set `self.socket = None` 2) when trying to send - make socket when it is None SysLogHandler doesn't implement this behavior and when you close the socket for some reason (eg. restart of uWSGI server on code change) it leaves it in the closed state, then raises an error when you try to send any message because it is closed ``` --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.9/logging/handlers.py", line 959, in emit self.socket.sendto(msg, self.address) OSError: [Errno 9] Bad file descriptor ``` ---------- components: Library (Lib) messages: 394932 nosy: Kirill Pinchuk priority: normal severity: normal status: open title: Unify logging.handlers.SysLogHandler behavior with SocketHandlers 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 Wed Jun 2 14:38:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 02 Jun 2021 18:38:07 +0000 Subject: [issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default In-Reply-To: <1586118564.22.0.0408193741044.issue40199@roundup.psfhosted.org> Message-ID: <1622659087.64.0.839685423757.issue40199@roundup.psfhosted.org> Serhiy Storchaka added the comment: Ah, there is a difference between debug and regular builds. I tested with the debug build. ---------- components: +Interpreter Core -Windows nosy: +ncoghlan, vstinner -paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:45:14 2021 From: report at bugs.python.org (Matt Billenstein) Date: Wed, 02 Jun 2021 18:45:14 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622658263.1.0.243777009187.issue44290@roundup.psfhosted.org> Message-ID: <01010179ce0b31cc-5809093c-67aa-4b38-a446-404a6b7f39d2-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: Hmm, digging, afaict the buildbot-worker is up and running - something on the master? I just updated my setup to use python3 instead of python2... On Wed, Jun 02, 2021 at 06:24:23PM +0000, Ned Deily wrote: > > Ned Deily added the comment: > > Hmm, I just tried to restart it from the builbot page but the build request is just sitting there ATM. > > https://buildbot.python.org/all/#/builders/366 > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 14:55:54 2021 From: report at bugs.python.org (Kirill Pinchuk) Date: Wed, 02 Jun 2021 18:55:54 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1622660154.57.0.111316816845.issue44291@roundup.psfhosted.org> Kirill Pinchuk added the comment: UPD: right now it has reconnection logic for unixsocket but not for tcp/udp ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:02:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Jun 2021 19:02:09 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622660529.15.0.649135695785.issue44282@roundup.psfhosted.org> Terry J. Reedy added the comment: The confusion is my fault: PR-26404 is where I first saw this failure, for the previously added tests, not where the test was added. I unlinked the erroneous message. Running 12 duplicate tests in parallel on Windows on a 6 core (12 CPU) machine with f:\dev\3x>python -m test -j12 -ugui -m test_incremental_editing test_idle test_idle test_idle test_idle test_idle test_idle test_idle test_idle test_idle test_idle test_idle test_idle resulted in nearly all failing. Half or less failed with -j6, usually one with -j3, none without -j. Are the processess failing because of interaction with each other? Or from be switched with other processes? Back with -j12: increasing the after delay in run_in_tk_mainloop from 1 to 5 cut the failures down to 0-4 in 12. Increasing further to 8 resulting in no failures. Note that human keystrokes are at least, say, 50 milliseconds (1/20 second) apart. I am reluctant to add a delay that is mostly not needed, so i tried the uploaded 'adaptive' code to only add a long delay if needed. Uploaded. But when a tested failed once, it failed again even with the delay, and contrary to the results above. ---------- Added file: https://bugs.python.org/file50084/tkinter_testing_utils.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:06:26 2021 From: report at bugs.python.org (Roundup Robot) Date: Wed, 02 Jun 2021 19:06:26 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1622660786.58.0.786732412157.issue44291@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +25086 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:09:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 02 Jun 2021 19:09:19 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622660959.06.0.878651893884.issue44282@roundup.psfhosted.org> Terry J. Reedy added the comment: The other thing I thought is parameterizing the decorator to pass in a delay only for this test, but that require another layer of wrapping, which I cannot do right now. So I think we should just add skiptest for now. In fact, we only need to run it when editing colordelagator. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:25:49 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Jun 2021 19:25:49 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622661949.71.0.473029333877.issue44290@roundup.psfhosted.org> Ned Deily added the comment: Can you say at what point you did the upgrade, i.e. between which two builds here? https://buildbot.python.org/all/#/builders/366 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:31:55 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 19:31:55 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622662315.24.0.390397508757.issue44282@roundup.psfhosted.org> Tal Einat added the comment: > Running 12 duplicate tests in parallel on Windows on a 6 core (12 CPU) machine with [...] resulted in nearly all failing. Yes, running test_idle in parallel with itself usually causes some failures due to UI focus being stolen from one instance by another. That's why I just ran this test rather than the whole test suite. > I am reluctant to add a delay that is mostly not needed, so i tried the uploaded 'adaptive' code to only add a long delay if needed. Uploaded. But when a tested failed once, it failed again even with the delay, and contrary to the results above. The delay needs to be placed carefully. Changing root.after(1, ...) to use 50 rather than 1 (these are milliseconds) seems to resolve the issue entirely on my machine, at the cost of this single test taking 0.4 seconds to run rather than about 0.045 seconds. > The other thing I thought is parameterizing the decorator to pass in a delay only for this test, but that require another layer of wrapping, which I cannot do right now. I can do that. Though I fear this may happen for other such tests as well... Worth a shot I guess. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:41:56 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Wed, 02 Jun 2021 19:41:56 +0000 Subject: [issue44277] cpython forks are spammed with dependabot PRs In-Reply-To: <1622526962.42.0.431881645294.issue44277@roundup.psfhosted.org> Message-ID: <1622662916.58.0.669079125662.issue44277@roundup.psfhosted.org> Dominic Davis-Foster added the comment: There's an open issue on GitHub, but it hasn't gone anywhere. https://github.com/dependabot/dependabot-core/issues/2804 ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:42:22 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 19:42:22 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622662942.38.0.227071766904.issue44282@roundup.psfhosted.org> Tal Einat added the comment: On my machine it running the test many times with parallelization no longer causes any failures with this change. Also, running other tests which us the @run_in_tk_mainloop decorator, with the same 1ms delay as before, doesn't cause any such failures. PR forthcoming. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:45:26 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 19:45:26 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622663126.55.0.517246173802.issue44282@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +25087 pull_request: https://github.com/python/cpython/pull/26491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:45:41 2021 From: report at bugs.python.org (Tal Einat) Date: Wed, 02 Jun 2021 19:45:41 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622663141.1.0.792857346648.issue44282@roundup.psfhosted.org> Tal Einat added the comment: See PR GH-26491. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 15:52:42 2021 From: report at bugs.python.org (Matt Billenstein) Date: Wed, 02 Jun 2021 19:52:42 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622661949.71.0.473029333877.issue44290@roundup.psfhosted.org> Message-ID: <01010179ce48f84a-77954ec3-0a15-43c9-8d51-2b1ecfd409a2-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: Probably at 321 where it lost connection - I would have shut it down and wiped the buildarea. I'm not sure what's going on now, I'm walking back versions of buildbot-worker and they seem to never connect to the master... m On Wed, Jun 02, 2021 at 07:25:49PM +0000, Ned Deily wrote: > > Ned Deily added the comment: > > Can you say at what point you did the upgrade, i.e. between which two builds here? > > https://buildbot.python.org/all/#/builders/366 > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 16:25:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 20:25:35 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622665535.82.0.593639215553.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 320eaa7f42b413cd5e5436ec92d4dc5ba150395f by Victor Stinner in branch 'main': bpo-43921: Fix test_ssl.test_pha_required_nocert() (GH-26489) https://github.com/python/cpython/commit/320eaa7f42b413cd5e5436ec92d4dc5ba150395f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 16:30:58 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 02 Jun 2021 20:30:58 +0000 Subject: [issue44277] cpython forks are spammed with dependabot PRs In-Reply-To: <1622526962.42.0.431881645294.issue44277@roundup.psfhosted.org> Message-ID: <1622665858.4.0.512991835885.issue44277@roundup.psfhosted.org> Zachary Ware added the comment: In that case, closing as third-party. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 16:49:59 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 02 Jun 2021 20:49:59 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622666999.35.0.297627328114.issue44290@roundup.psfhosted.org> Ned Deily added the comment: Perhaps one of the buildbot experts can help? Zach? Pablo? Victor? ---------- nosy: +pablogsal, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 17:31:16 2021 From: report at bugs.python.org (Brandon Weeks) Date: Wed, 02 Jun 2021 21:31:16 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1622669476.69.0.409941107396.issue38820@roundup.psfhosted.org> Change by Brandon Weeks : ---------- nosy: +bweeks _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 17:35:28 2021 From: report at bugs.python.org (jakirkham) Date: Wed, 02 Jun 2021 21:35:28 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1622669728.29.0.103409597998.issue42853@roundup.psfhosted.org> jakirkham added the comment: Would it be possible to check for these newer OpenSSL symbols during the builds of Python 3.8 & 3.9 (using them when available and otherwise falling back to the older API otherwise)? This would allow people to build Python 3.8 & 3.9 with the newer OpenSSL benefiting from the fix That said, not sure if there are other obstacles to using OpenSSL 1.1.1 with Python 3.8 & 3.9 ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 17:59:52 2021 From: report at bugs.python.org (Luca Mattiello) Date: Wed, 02 Jun 2021 21:59:52 +0000 Subject: [issue44292] contextmanager + ExitStack.pop_all() Message-ID: <1622671192.83.0.598517840912.issue44292@roundup.psfhosted.org> New submission from Luca Mattiello : Reading the contextlib documentation, one might assume the following to be functionally equivalent, when used in a with statement: @contextlib.contextmanager def managed_resource(): resource = acquire() try: yield resource finally: resource.release() class ManagedResource: def __init__(self): self.resource = acquire() def __enter__(self): return self.resource def __exit__(self, *args): self.resource.release() However, the first version has a seemingly unexpected behavior when used in conjunction with an ExitStack, and pop_all(). with contextlib.ExitStack() as es: r = es.enter_context(managed_resource()) es.pop_all() # Uh-oh, r gets released anyway with contextlib.ExitStack() as es: r = es.enter_context(ManagedResource()) es.pop_all() # Works as expected I think the reason is https://docs.python.org/3/reference/expressions.html#yield-expressions, in particular > Yield expressions are allowed anywhere in a try construct. > If the generator is not resumed before it is finalized (by > reaching a zero reference count or by being garbage collected), > the generator-iterator?s close() method will be called, > allowing any pending finally clauses to execute. I guess this is working according to the specs, but I found it very counter-intuitive. Could we improve the documentation to point out this subtle difference? Full repro: import contextlib @contextlib.contextmanager def cm(): print("acquire cm") try: yield 1 finally: print("release cm") class CM: def __init__(self): print("acquire CM") def __enter__(self): return 1 def __exit__(self, *args): print("release CM") def f1(): with contextlib.ExitStack() as es: es.enter_context(cm()) es.pop_all() def f2(): with contextlib.ExitStack() as es: es.enter_context(CM()) es.pop_all() f1() f2() Output: acquire cm release cm acquire CM ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 394948 nosy: docs at python, lucae.mattiello priority: normal severity: normal status: open title: contextmanager + ExitStack.pop_all() versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 18:18:08 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 02 Jun 2021 22:18:08 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622672288.25.0.430466439227.issue44279@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not sure the original version needs improving. This sounds like a problem understanding how warnings work. Do you really want to say that for warnings, they're sometimes handled by the warning machinery and therefore don't get passed along to the calling code? It seems to me that you'd need to explain that everywhere the documents discuss handling exceptions. I don't think this one place is more special than others. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 18:24:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 02 Jun 2021 22:24:16 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622672656.01.0.129849176245.issue44279@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25088 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26492 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 18:26:01 2021 From: report at bugs.python.org (Joseph Perez) Date: Wed, 02 Jun 2021 22:26:01 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass Message-ID: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> New submission from Joseph Perez : PEP 585 has the side-effect of making `list[int]` an instance of `type`. This is not the case for other generic aliases. It also implies that `inspect.isclass(list[int]) is True`, while `list[int]` is not a class; as a proof of this statement `issubclass(list[int], collections.abc.Collection)` raises `TypeError: issubclass() arg 1 must be a class`. By the way, there is the awkward thing of having `isinstance(list[int], type) is True` while `issubclass(type(list[int]), type) is False`. ---------- messages: 394950 nosy: joperez priority: normal severity: normal status: open title: PEP 585 breaks inspect.isclass versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 18:34:06 2021 From: report at bugs.python.org (Sunny Jamshedji) Date: Wed, 02 Jun 2021 22:34:06 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. Message-ID: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> New submission from Sunny Jamshedji : Downloaded Windows 64 bit installer from: https://www.python.org/downloads/windows/ Link said: https://www.python.org/ftp/python/3.9.5/python-3.9.5-amd64.exe It downloaded what appears to be 3.8.10 installer. I launched it and I got the attached screenshot with 3.8.10 installer. Tested it out 4 times. First 2 times it did the same thing. While testing the third time, acquiring screenshots so it took longer, it gave me the correct file! IDK what happened, unless you guys fixed it in between! ---------- components: Installation files: 1. Python for Windows Download Page.png messages: 394951 nosy: sunnyjamshedji priority: normal severity: normal status: open title: 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50085/1. Python for Windows Download Page.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:05:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 02 Jun 2021 23:05:36 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622675136.1.0.689825787209.issue44290@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't see anything relevant in the logs. These are the last messages regarding this worker: 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS 3.7 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS custom 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS 3.8 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS 3.10 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS PR 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS 3.9 2021-06-02 18:38:26+0000 [-] Worker billenstein-macos detached from x86-64 macOS 3.x ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:08:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 23:08:20 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622675300.02.0.859879638175.issue39573@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25089 pull_request: https://github.com/python/cpython/pull/26493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:25:34 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:25:34 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622676334.33.0.493496631607.issue43921@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25090 pull_request: https://github.com/python/cpython/pull/26494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:26:55 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:26:55 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622676415.68.0.158295382293.issue44285@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25091 pull_request: https://github.com/python/cpython/pull/26495 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:27:01 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:27:01 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622676421.01.0.869849406267.issue44285@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25092 pull_request: https://github.com/python/cpython/pull/26496 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:32:40 2021 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 02 Jun 2021 23:32:40 +0000 Subject: [issue44295] self.assertDictContainsSubset warning is unhelpful Message-ID: <1622676760.31.0.209382096259.issue44295@roundup.psfhosted.org> New submission from Anthony Sottile : it's missing stacklevel= -- mostly creating a bpo issue to link to ---------- messages: 394953 nosy: Anthony Sottile priority: normal severity: normal status: open title: self.assertDictContainsSubset warning is unhelpful versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:40:36 2021 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 02 Jun 2021 23:40:36 +0000 Subject: [issue44295] self.assertDictContainsSubset warning is unhelpful In-Reply-To: <1622676760.31.0.209382096259.issue44295@roundup.psfhosted.org> Message-ID: <1622677236.78.0.818974522473.issue44295@roundup.psfhosted.org> Change by Anthony Sottile : ---------- keywords: +patch pull_requests: +25093 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26497 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:46:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 23:46:36 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622677596.93.0.119850462008.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: Most projects broken by Py_TYPE and Py_SIZE changes have been fixed since last year. I succeeded to use my new pythoncapi_compat project on multiple C extensions. So I propose again to convert Py_TYPE and Py_SIZE macros to static inline functions: https://github.com/python/cpython/pull/26493 I also proposed to promote the pythoncapi_compat project in the "C API: Porting to Python 3.10" section of "What's New In Python 3.10?" on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/KHDZGCNOYEDUTSPAATUDP55ZSSQM5RRC/ I already announced the pythoncapi_compat project on the capi-sig last December: https://mail.python.org/archives/list/capi-sig at python.org/thread/LFLXFMKMZ77UCDUFD5EQCONSAFFWJWOZ/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:47:47 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:47:47 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1622677667.85.0.942577144901.issue43667@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25094 pull_request: https://github.com/python/cpython/pull/26498 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:48:43 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:48:43 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622677723.82.0.876187776905.issue43921@roundup.psfhosted.org> miss-islington added the comment: New changeset e5e93e6145090a636e67766a53b758d7ac78e3ad by Miss Islington (bot) in branch '3.10': bpo-43921: Fix test_ssl.test_pha_required_nocert() (GH-26489) https://github.com/python/cpython/commit/e5e93e6145090a636e67766a53b758d7ac78e3ad ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:50:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:50:42 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622677842.57.0.945426218342.issue44285@roundup.psfhosted.org> miss-islington added the comment: New changeset 0e9af8cae314e4b0e770fe48d5f7b5f540c0b257 by Miss Islington (bot) in branch '3.10': bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) https://github.com/python/cpython/commit/0e9af8cae314e4b0e770fe48d5f7b5f540c0b257 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:50:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 23:50:59 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622677859.21.0.271981044855.issue44285@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 85b587a38dcf5d0ef1e275510001e22425d65977 by Miss Islington (bot) in branch '3.9': bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) (GH-26496) https://github.com/python/cpython/commit/85b587a38dcf5d0ef1e275510001e22425d65977 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:51:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 23:51:26 +0000 Subject: [issue44285] Coverity scan: Modules/getpath.c. "calculate_open_pyenv" allocates memory that is stored into "env_file". In-Reply-To: <1622641179.93.0.747162591311.issue44285@roundup.psfhosted.org> Message-ID: <1622677886.19.0.422968994432.issue44285@roundup.psfhosted.org> STINNER Victor added the comment: Thanks Charalampos, it's now fixed in 3.9, 3.10 and main branches. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:53:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 02 Jun 2021 23:53:48 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622678028.13.0.24273336453.issue44282@roundup.psfhosted.org> STINNER Victor added the comment: New changeset adef445dc34685648bd0ea1c125df2ef143912ed by Tal Einat in branch 'main': bpo-44282: Fix occasional test_incremental_editing failures on buildbots (GH-26491) https://github.com/python/cpython/commit/adef445dc34685648bd0ea1c125df2ef143912ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:53:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 02 Jun 2021 23:53:49 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622678029.97.0.902642846341.issue44282@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25095 pull_request: https://github.com/python/cpython/pull/26499 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 19:55:20 2021 From: report at bugs.python.org (Anthony Sottile) Date: Wed, 02 Jun 2021 23:55:20 +0000 Subject: [issue44296] Should warnings.warn default to stacklevel=2? Message-ID: <1622678120.26.0.13288465488.issue44296@roundup.psfhosted.org> New submission from Anthony Sottile : I have yet to come across a usecase where `stacklevel=1` makes sense -- usually it is more helpful to point at the calling code than the function which is itself warning my proposal is to update the default for `stacklevel=` from `1` to `2` an example bpo where this is relevant is bpo-44295 ---------- components: Library (Lib) messages: 394960 nosy: Anthony Sottile priority: normal severity: normal status: open title: Should warnings.warn default to stacklevel=2? type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:13:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 00:13:40 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622679220.51.0.0421160148454.issue44290@roundup.psfhosted.org> STINNER Victor added the comment: > Hmm, I just tried to restart it from the builbot page but the build request is just sitting there ATM. > https://buildbot.python.org/all/#/builders/366 Not sure what happened. I restarted the buildbot server manually. I cancelled the old manual build and scheduled a new manual build which is now running. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:14:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 00:14:49 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622679289.37.0.635475435128.issue44282@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9c89d62073fa0bcfe68e59add5b55fbcbf7672ab by Miss Islington (bot) in branch '3.10': bpo-44282: Fix occasional test_incremental_editing failures on buildbots (GH-26491) (GH-26499) https://github.com/python/cpython/commit/9c89d62073fa0bcfe68e59add5b55fbcbf7672ab ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:23:58 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 03 Jun 2021 00:23:58 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622679838.3.0.930996818854.issue44293@roundup.psfhosted.org> Jelle Zijlstra added the comment: The reason for this is that types.GenericAlias.__getattribute__ delegates to the alias's origin (in the `ga_getattro` function). As a result, `list[int].__class__` calls `list.__class__` and returns `type`. And the implementation of `isinstance(obj, type)` ultimately calls `issubclass(obj.__class__, type)`. (That's in `object_isinstance()` in abstract.c. It's news to me; I didn't know you could customize isinstance() behavior on the object side.) To fix this, we could make `ga_getattro` not delegate for `__class__`, so that `list[int].__class__` would return `GenericAlias` instead of `type`. The current implementation of GenericAlias has been around for a few releases by now, though, so that change might break some use cases. > This is not the case for other generic aliases. This is not true; it is the same for e.g. `set[int]`. Unless you meant something else here. ---------- nosy: +Jelle Zijlstra, gvanrossum, kj, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:25:23 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Jun 2021 00:25:23 +0000 Subject: [issue43568] Drop support for Mac OS X < 10.3 module linking In-Reply-To: <1616245702.65.0.278864424752.issue43568@roundup.psfhosted.org> Message-ID: <1622679923.34.0.655162200698.issue43568@roundup.psfhosted.org> Ned Deily added the comment: New changeset 991693a217363243b0bd33887852d6b3959b99a1 by Joshua Root in branch '3.9': [3.9] bpo-43568: Relax distutils MACOSX_DEPLOYMENT_TARGET check (GH-25827) (GH-26001) https://github.com/python/cpython/commit/991693a217363243b0bd33887852d6b3959b99a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:31:03 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 03 Jun 2021 00:31:03 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1622680263.89.0.586248602466.issue37741@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25096 pull_request: https://github.com/python/cpython/pull/26500 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:31:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 00:31:37 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622680297.2.0.38596930224.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25097 pull_request: https://github.com/python/cpython/pull/26501 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 20:45:26 2021 From: report at bugs.python.org (Matt Billenstein) Date: Thu, 03 Jun 2021 00:45:26 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622679220.51.0.0421160148454.issue44290@roundup.psfhosted.org> Message-ID: <01010179cf54f958-dc5aa140-5e10-4606-808f-132f2eac18fd-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: Hmm, yeah, it did seem to me like the server was wedged or something... glad to see it going. M -- Matt Billenstein matt at vazor.com > On Jun 2, 2021, at 6:13 PM, STINNER Victor wrote: > > ? > STINNER Victor added the comment: > >> Hmm, I just tried to restart it from the builbot page but the build request is just sitting there ATM. >> https://buildbot.python.org/all/#/builders/366 > > Not sure what happened. I restarted the buildbot server manually. I cancelled the old manual build and scheduled a new manual build which is now running. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:21:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 03 Jun 2021 01:21:22 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622683282.33.0.289664315445.issue44293@roundup.psfhosted.org> Guido van Rossum added the comment: Since these are new forms (list[int] previously was an error), does it actually matter? Especially since these are primarily used in annotations. @Joseph Perez, is there a specific library or pattern that is broken by this? FWIW I did think rather carefully about which attributes to delegate or not, and delegating __class__ was intentional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:32:00 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:32:00 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622683920.91.0.431164328086.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25098 pull_request: https://github.com/python/cpython/pull/26502 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:37:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:37:19 +0000 Subject: [issue43921] test_ssl fails on Windows buildbots In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622684239.12.0.457404136892.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: See my comparison of read() and write() errors on Linux vs Windows: https://github.com/python/cpython/pull/26501#issuecomment-853489167 I wrote PR 26502 to fix test_wrong_cert_tls13() on Windows (currently, the test is skipped). On Linux, read() always raises an exception when the connection is reset. On Windows, read() sometimes fails with SSL_ERROR_SYSCALL+WSAECONNRESET, and in this case the internal C function raises a SSLEOFError. But the outer Python wrapper method converts SSLEOFError to an empty string because the SSL socket is created with suppress_ragged_eofs=True by default. I don't know why on Linux read() only fails with SSL_ERROR_SSL with ERR_peek_last_error()=0x14094418, whereas it's not the case on Windows. It may be an implementation detail, different between Windows socket and Linux socket. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:38:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:38:54 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622684334.33.0.743130410833.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_ssl fails on Windows buildbots -> test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:45:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:45:47 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622684747.0.0.929405198319.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: In Python 3.9, test_pha_required_nocert() looks more strict, it requires read() to fail with the 'tlsv13 alert certificate required' error message: # receive alert with self.assertRaisesRegex( ssl.SSLError, 'tlsv13 alert certificate required'): s.recv(1024) In the main branch, it tolerates "EOF occurred" error: # test sometimes fails with EOF error. Test passes as long as # server aborts connection with an error. with self.assertRaisesRegex( ssl.SSLError, '(certificate required|EOF occurred)' ): # receive CertificateRequest data = s.recv(1024) self.assertEqual(data, b'OK\n') # send empty Certificate + Finish s.write(b'HASCERT') # receive alert s.recv(1024) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:51:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:51:01 +0000 Subject: [issue44297] Frame with -1 line number Message-ID: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> New submission from STINNER Victor : While debugging https://bugs.python.org/issue43921 on Windows, I got a traceback with a single frame and the frame line number is -1. It looks like a Python 3.11 regression. Mark, Guido: can it be related to recent optimization work done in the main branch? See also bpo-44288 "unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None". ====================================================================== FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2522) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\vstinner\python\main\lib\test\test_ssl.py", line -1, in test_pha_required_nocert AssertionError: "certificate required" does not match "EOF occurred in violation of protocol (_ssl.c:2522)" ---------- components: Interpreter Core messages: 394969 nosy: Mark.Shannon, gvanrossum, vstinner priority: normal severity: normal status: open title: Frame with -1 line number versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:51:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:51:53 +0000 Subject: [issue44288] unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None In-Reply-To: <1622646301.21.0.530084460919.issue44288@roundup.psfhosted.org> Message-ID: <1622685113.79.0.171832910226.issue44288@roundup.psfhosted.org> STINNER Victor added the comment: Oops, I wanted to ping Mark Shannon, not Mark Dickinson. ---------- nosy: +Mark.Shannon -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 21:52:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 01:52:59 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1622685179.35.0.111295144284.issue44229@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: Intermittent connection errors in ssl tests on macOS CI -> test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 22:08:51 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 03 Jun 2021 02:08:51 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622686131.52.0.21011591594.issue39573@roundup.psfhosted.org> Dong-hee Na added the comment: > So I propose again to convert Py_TYPE and Py_SIZE macros to static inline functions +1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 22:15:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 02:15:18 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622686518.8.0.0648549637787.issue44290@roundup.psfhosted.org> STINNER Victor added the comment: The 2 latest builds are green (success), so I close the issue. https://buildbot.python.org/all/#/builders/366 Thanks for the help! ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 22:17:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 02:17:24 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622686644.27.0.784787548504.issue44282@roundup.psfhosted.org> STINNER Victor added the comment: The 12 latest build on https://buildbot.python.org/all/#/builders/464 are green (success). Can this issue be closed now? We can reopen it later if the issue strikes back. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 22:21:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 02:21:33 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1622686893.0.0.746209469886.issue37224@roundup.psfhosted.org> STINNER Victor added the comment: Recent test_still_running() failure on AMD64 Windows8.1 Refleaks 3.10: https://buildbot.python.org/all/#/builders/638/builds/19 1:22:17 load avg: 3.00 [393/427/2] test__xxsubinterpreters failed -- running: test_pydoc (9 min 7 sec), test_venv (2 min 54 sec), test_dbm_dumb (1 min 12 sec) beginning 6 repetitions 123456 .Warning -- Uncaught thread exception: RuntimeError Exception in thread Thread-16 (run): Traceback (most recent call last): File "D:\buildarea\3.10.ware-win81-release.refleak\build\lib\threading.py", line 1006, in _bootstrap_inner self.run() File "D:\buildarea\3.10.ware-win81-release.refleak\build\lib\threading.py", line 943, in run self._target(*self._args, **self._kwargs) File "D:\buildarea\3.10.ware-win81-release.refleak\build\lib\test\test__xxsubinterpreters.py", line 46, in run interpreters.run_string(interp, dedent(f""" RuntimeError: unrecognized interpreter ID 125 test test__xxsubinterpreters failed -- Traceback (most recent call last): File "D:\buildarea\3.10.ware-win81-release.refleak\build\lib\test\test__xxsubinterpreters.py", line 753, in test_still_running self.assertTrue(interpreters.is_running(interp), AssertionError: False is not true : Interp 125 should be running before destruction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 22:47:54 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Jun 2021 02:47:54 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622688474.95.0.63343534659.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: For anyone curious, I had some free time today and took a stab at creating a minimal _frozendict type (sharing as much implementation with dict as possible) to see how difficult it would be. It was actually much simpler than I thought... just a few dozen lines of code, including marshal support. If you'd like to see it, you can check out my "frozendict" branch here: https://github.com/python/cpython/compare/main...brandtbucher:frozendict For testing purposes, I've exposed in the _testcapi module. It has the same constructor signature as dict, and basically only supports lookups: >>> from _testcapi import _frozendict >>> fd = _frozendict({1: 2, "3": 4, None: 5}) >>> fd <_frozendict object at 0x7f4e127e4ef0> >>> fd[1] 2 >>> fd[3] Traceback (most recent call last): File "", line 1, in KeyError: 3 >>> import marshal >>> marshal.loads(marshal.dumps(fd)) == fd True I'm not gonna lie... I really like it. It sidesteps any runtime construction/caching issues that using a normal dict would have, but with all of the same performance characteristics. It also seems like it would not introduce much of a maintenance burden, since it has very little of its own code. Anyways, food for thought. It was a fun experiment at the very least. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:13:20 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 03:13:20 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622690000.75.0.206344102992.issue44022@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +25099 pull_request: https://github.com/python/cpython/pull/26503 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:16:16 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 03:16:16 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622690176.39.0.693340052594.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: Great catch! The new PR should address that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:17:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 03 Jun 2021 03:17:41 +0000 Subject: [issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures In-Reply-To: <1622579905.14.0.972004304373.issue44282@roundup.psfhosted.org> Message-ID: <1622690261.8.0.498390248086.issue44282@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 Jun 2 23:27:53 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 03 Jun 2021 03:27:53 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622690873.7.0.453686482904.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: Very interesting -- that is shorter than I thought also! If we really wanted to optimize the tar out of this, we could probably find a way to re-use just the PyDictKeysObject to find the index into a C-array of integer jump targets and not have to worry about unboxing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:43:47 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:43:47 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691827.76.0.892546108415.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25100 pull_request: https://github.com/python/cpython/pull/26504 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:43:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:43:53 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691833.0.0.474850596177.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25101 pull_request: https://github.com/python/cpython/pull/26505 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:43:59 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:43:59 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691839.04.0.324757595153.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25102 pull_request: https://github.com/python/cpython/pull/26506 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:43:48 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 03:43:48 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691828.95.0.191310463024.issue44022@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset e60ab843cbb016fb6ff8b4f418641ac05a9b2fcc by Gregory P. Smith in branch 'main': bpo-44022: Improve the regression test. (GH-26503) https://github.com/python/cpython/commit/e60ab843cbb016fb6ff8b4f418641ac05a9b2fcc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:44:05 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:44:05 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691845.63.0.663111043062.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25103 pull_request: https://github.com/python/cpython/pull/26507 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:44:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:44:11 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622691851.69.0.641436263808.issue44022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25104 pull_request: https://github.com/python/cpython/pull/26508 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:45:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:45:42 +0000 Subject: [issue42914] pprint numbers with underscore In-Reply-To: <1610493681.29.0.683565759752.issue42914@roundup.psfhosted.org> Message-ID: <1622691941.99.0.623207428556.issue42914@roundup.psfhosted.org> miss-islington added the comment: New changeset 4846ea95d1a121df5e8081e2a290f63d1419cad8 by Wm. Keith van der Meulen in branch 'main': Add bpo-42914 to What's New (GH-25124) https://github.com/python/cpython/commit/4846ea95d1a121df5e8081e2a290f63d1419cad8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:45:44 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 03:45:44 +0000 Subject: [issue42914] pprint numbers with underscore In-Reply-To: <1610493681.29.0.683565759752.issue42914@roundup.psfhosted.org> Message-ID: <1622691944.14.0.236744374428.issue42914@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25105 pull_request: https://github.com/python/cpython/pull/26509 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 2 23:50:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 03:50:22 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1622692222.08.0.670197300836.issue43776@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- pull_requests: +25106 pull_request: https://github.com/python/cpython/pull/26510 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:04:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 04:04:28 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622693068.59.0.45219461265.issue44022@roundup.psfhosted.org> miss-islington added the comment: New changeset 98e5a7975d99b58d511f171816ecdfb13d5cca18 by Miss Islington (bot) in branch '3.10': bpo-44022: Improve the regression test. (GH-26503) https://github.com/python/cpython/commit/98e5a7975d99b58d511f171816ecdfb13d5cca18 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:05:47 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 04:05:47 +0000 Subject: [issue42914] pprint numbers with underscore In-Reply-To: <1610493681.29.0.683565759752.issue42914@roundup.psfhosted.org> Message-ID: <1622693147.04.0.682069084711.issue42914@roundup.psfhosted.org> miss-islington added the comment: New changeset 41317801a95c758c3fc04c4fb332ac453c9e3ad3 by Miss Islington (bot) in branch '3.10': Add bpo-42914 to What's New (GH-25124) https://github.com/python/cpython/commit/41317801a95c758c3fc04c4fb332ac453c9e3ad3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:10:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 04:10:30 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622693430.48.0.794889970045.issue44022@roundup.psfhosted.org> miss-islington added the comment: New changeset 5df4abd6b033a5f1e48945c6988b45e35e76f647 by Miss Islington (bot) in branch '3.9': bpo-44022: Improve the regression test. (GH-26503) https://github.com/python/cpython/commit/5df4abd6b033a5f1e48945c6988b45e35e76f647 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:15:33 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 04:15:33 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1622693733.68.0.152397344695.issue43776@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2 by Gregory P. Smith in branch '3.9': [3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338) (GH-26510) https://github.com/python/cpython/commit/5a8ddcc4524dca3880d7fc2818814ffae1cfb8a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:16:05 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Thu, 03 Jun 2021 04:16:05 +0000 Subject: [issue43776] Popen with shell=True yield mangled repr output In-Reply-To: <1617907343.84.0.247878991461.issue43776@roundup.psfhosted.org> Message-ID: <1622693765.66.0.509979931136.issue43776@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:20:40 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Jun 2021 04:20:40 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622694040.88.0.402306356083.issue44290@roundup.psfhosted.org> Ned Deily added the comment: Alas, it looks like build 325 failed in the same way as build 322: https://buildbot.python.org/all/#/builders/366/builds/325 I wonder if there might be a Makefile race condition. ---------- resolution: out of date -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:23:48 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Jun 2021 04:23:48 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622694228.6.0.847826953423.issue44022@roundup.psfhosted.org> Ned Deily added the comment: New changeset fee96422e6f0056561cf74fef2012cc066c9db86 by Miss Islington (bot) in branch '3.7': bpo-44022: Improve the regression test. (GH-26503) (GH-26507) https://github.com/python/cpython/commit/fee96422e6f0056561cf74fef2012cc066c9db86 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:38:38 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 03 Jun 2021 04:38:38 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1622695118.67.0.658430108128.issue44022@roundup.psfhosted.org> Ned Deily added the comment: New changeset 1b6f4e5e13ebd1f957b47f7415b53d0869bdbac6 by Miss Islington (bot) in branch '3.6': bpo-44022: Improve the regression test. (GH-26503) (GH-26508) https://github.com/python/cpython/commit/1b6f4e5e13ebd1f957b47f7415b53d0869bdbac6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 00:42:43 2021 From: report at bugs.python.org (Matt Billenstein) Date: Thu, 03 Jun 2021 04:42:43 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622694040.88.0.402306356083.issue44290@roundup.psfhosted.org> Message-ID: <01010179d02e3602-86eda37c-e052-4afd-955d-54ad32e63616-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: So, I'd been trying various things before the master restart and I was using python3 supplied by homebrew - I decided I didn't like that dependency and switched it back to /usr/bin/python3 as supplied by the system [1]. I did a rebuild on 325 a couple more times and both of those failed in the same way - now I've switched back to homebrew python3 and compile succeeded this time... I'll let this bake, seems pretty strange changing the interpreter running the buildbot would matter - everything else should be the same however. m 1: mattb at macbook-pro:~ $ /usr/bin/python3 Python 3.8.2 (default, Apr 8 2021, 23:19:18) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D mattb at macbook-pro:~ $ /usr/local/bin/python3 Python 3.9.5 (default, May 4 2021, 03:36:27) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> On Thu, Jun 03, 2021 at 04:20:40AM +0000, Ned Deily wrote: > > Ned Deily added the comment: > > Alas, it looks like build 325 failed in the same way as build 322: > > https://buildbot.python.org/all/#/builders/366/builds/325 > > I wonder if there might be a Makefile race condition. > > ---------- > resolution: out of date -> > stage: resolved -> > status: closed -> open > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 01:54:19 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Thu, 03 Jun 2021 05:54:19 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622699659.26.0.335321950115.issue44283@roundup.psfhosted.org> Change by Kshitiz Arya : ---------- nosy: +Kshitiz17 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 03:46:14 2021 From: report at bugs.python.org (Joseph Perez) Date: Thu, 03 Jun 2021 07:46:14 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622706374.51.0.180969161784.issue44293@roundup.psfhosted.org> Joseph Perez added the comment: @Jelle Zijlstra Thank you for the explanation. > The current implementation of GenericAlias has been around for a few releases by now, though, so that change might break some use cases. I agree that a "fix" could have unexpected side-effect, my issue comes quite late indeed. By the way, Python typing is so much unstable (every version breaks the previous one), it's very complicated to write code that support multiple versions, so whatever the typing internal implementation, we must adapt. > This is not true; it is the same for e.g. `set[int]`. Unless you meant something else here. I have chosen `list[int]` as an example of `types.GenericAlias` introduced by PEP 585 (i could have chosen `set[int]` or `collections.abc.Collection[int]`). But other generic aliases, e.g. `typing.List[int]` or `MyClass[int]` (where `MyClass` inherits `Generic[T]`), are not instances of `type`. > @Joseph Perez, is there a specific library or pattern that is broken by this? Because `issubclass` requires a "class" as arg 1, I use the pattern `if isinstance(tp, type) and issubclass(tp, SomeClass)` (`isinstance` check being equivalent to `inspect.isclass`). With PEP 585, it breaks for `list[int]` and other builtin generic aliases. > FWIW I did think rather carefully about which attributes to delegate or not, and delegating __class__ was intentional. I don't have the context of the decision, so I can quite understand that delegating `__class__` was the right thing to do, especially when `__mro__` and other `type` attributes are also delegated. I mainly wanted to highlight this side effect, especially on the pattern mentioned above. (My issue title is a little bit excessive in this regard) But as I've written, I've already so many wrappers to maintain compatibility between Python versions of typing that I can write a new one to handle this particularity of PEP 585. So this issue is not critical to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 04:13:16 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 08:13:16 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1622707996.05.0.881378798524.issue43858@roundup.psfhosted.org> miss-islington added the comment: New changeset 8b93f0e696d3fc60fd311c13d5238da73a35e3b3 by andrei kulakov in branch 'main': bpo-43858: Add logging.getLevelNamesMapping() (GH-26459) https://github.com/python/cpython/commit/8b93f0e696d3fc60fd311c13d5238da73a35e3b3 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 04:59:30 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 03 Jun 2021 08:59:30 +0000 Subject: [issue43858] Provide method to get list of logging level names In-Reply-To: <1618508817.95.0.500447634147.issue43858@roundup.psfhosted.org> Message-ID: <1622710770.32.0.662293674577.issue43858@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 06:04:39 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Thu, 03 Jun 2021 10:04:39 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1622714679.26.0.913359311879.issue42514@roundup.psfhosted.org> Change by Nathaniel Smith : ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 06:05:02 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 03 Jun 2021 10:05:02 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit Message-ID: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> New submission from Ned Batchelder : Python 3.10 now traces back to with statements when exiting the with block. When the exit is a break statement, the with exit is visited before the break statement is. This seems confusing. --- 8< ----------------------------------------- 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 def doit(): for i in range(2): with open("test", "w") as f: a = 13 b = 14 break c = 16 print(sys.version) sys.settrace(trace) doit() --- 8< ----------------------------------------- 3.10.0b2 (default, Jun 3 2021, 05:27:13) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def doit(): line 11: for i in range(2): line 12: with open("test", "w") as f: line 13: a = 13 line 14: b = 14 line 12: with open("test", "w") as f: line 15: break line 16: c = 16 retu 16: c = 16 Shouldn't we get a trace for line 15 (break), then line 12 (with-exit), then line 15 again, then line 16? ---------- assignee: Mark.Shannon components: Interpreter Core messages: 394990 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.10.0b2 traces with-exit before the break that caused the exit type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 06:16:36 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 03 Jun 2021 10:16:36 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622715396.94.0.920593820685.issue44298@roundup.psfhosted.org> Ned Batchelder added the comment: (I'm not sure whether to create other issues for further details) I'm also seeing a return in a with will trace withexit/return for a plain "return" statement, but return/withexit/return for a return with a value ("return 17"). I would expect that a statement causing an exit from a with block would always be traced before the with-exit. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 06:39:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 10:39:19 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622716759.39.0.810706307299.issue44290@roundup.psfhosted.org> STINNER Victor added the comment: "So, I'd been trying various things before the master restart (...) I'll let this bake, seems pretty strange changing the interpreter running the buildbot would matter - everything else should be the same however." If you can, try to stop your buildbot client when you upgrade your system. System upgrades always caused hiccups on buildbots, it's ok. It's just suprising when I got an error and don't know that the system was upgraded. I close again the issue ;-) ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 07:01:05 2021 From: report at bugs.python.org (Dmitry Kropachev) Date: Thu, 03 Jun 2021 11:01:05 +0000 Subject: [issue44299] Enable control over daemon flag in ThreadPoolExecutor and ProcessPoolExecutor Message-ID: <1622718065.29.0.723713253214.issue44299@roundup.psfhosted.org> New submission from Dmitry Kropachev : ThreadPoolExecutor and ProcessPoolExecutor spawn threads and processes with default value of daemon flag, i.e. None. In some cases it would handful to have control over daemon flag of spawned threads and processes. Simple 6-line fix to enable it. ---------- components: Library (Lib) messages: 394993 nosy: dkropachev priority: normal severity: normal status: open title: Enable control over daemon flag in ThreadPoolExecutor and ProcessPoolExecutor versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 07:09:24 2021 From: report at bugs.python.org (Dmitry Kropachev) Date: Thu, 03 Jun 2021 11:09:24 +0000 Subject: [issue44299] Enable control over daemon flag in ThreadPoolExecutor and ProcessPoolExecutor In-Reply-To: <1622718065.29.0.723713253214.issue44299@roundup.psfhosted.org> Message-ID: <1622718564.3.0.761842538717.issue44299@roundup.psfhosted.org> Change by Dmitry Kropachev : ---------- keywords: +patch pull_requests: +25107 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26511 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 07:19:19 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Jun 2021 11:19:19 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1622719159.05.0.80902170704.issue42514@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 07:32:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Jun 2021 11:32:05 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622719925.62.0.363356986905.issue42213@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25108 pull_request: https://github.com/python/cpython/pull/26512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 08:13:21 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Jun 2021 12:13:21 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622722401.62.0.248999691233.issue44298@roundup.psfhosted.org> Mark Shannon added the comment: For context, this behavior was introduced in https://bugs.python.org/issue43933 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 08:18:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Jun 2021 12:18:54 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622722734.09.0.990917553939.issue44298@roundup.psfhosted.org> Mark Shannon added the comment: Why this occurs: with cm: A break translates to something like: ex = cm.__exit__; cm.__enter__() # with cm A ex(...) goto loop_end # break So, the break is traced after the exit call. However, this doesn't seem consistent with try-finally statements which trace any break/continue/return before the finally block. ---------- keywords: +3.10regression nosy: +pablogsal priority: normal -> release blocker stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 08:55:43 2021 From: report at bugs.python.org (Matt Billenstein) Date: Thu, 03 Jun 2021 12:55:43 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622716759.39.0.810706307299.issue44290@roundup.psfhosted.org> Message-ID: <01010179d1f1912a-adfd1d24-d776-4a6d-a10c-54a3723f2da4-000000@us-west-2.amazonses.com> Matt Billenstein added the comment: I have been stopping it since the initial problem - there?s something wonky with using the system python on macos afaict... M -- Matt Billenstein matt at vazor.com > On Jun 3, 2021, at 4:39 AM, STINNER Victor wrote: > > ? > STINNER Victor added the comment: > > "So, I'd been trying various things before the master restart (...) I'll let this bake, seems pretty strange changing the interpreter running the > buildbot would matter - everything else should be the same however." > > If you can, try to stop your buildbot client when you upgrade your system. System upgrades always caused hiccups on buildbots, it's ok. It's just suprising when I got an error and don't know that the system was upgraded. > > I close again the issue ;-) > > ---------- > resolution: -> fixed > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:03:10 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 03 Jun 2021 13:03:10 +0000 Subject: [issue44286] venv activate script would be good to show failure. In-Reply-To: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> Message-ID: <1622725390.31.0.643130572126.issue44286@roundup.psfhosted.org> Vinay Sajip added the comment: venvs aren't meant to be portable (i.e. renaming the directory or moving to a new location). Scripts installed into a venv have absolute paths pointing to the location when the venv was created. venvs should be treated as throwaway resources that can be readily recreated - so if you need a venv in a new location, just create it there and install the desired packages again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:06:17 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 03 Jun 2021 13:06:17 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1622725577.77.0.122801177592.issue44291@roundup.psfhosted.org> Vinay Sajip added the comment: > right now it has reconnection logic for unixsocket but not for tcp/udp Should it not have UDP/TCP supported as well as domain sockets, before being reviewed? ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:17:31 2021 From: report at bugs.python.org (Kirill Pinchuk) Date: Thu, 03 Jun 2021 13:17:31 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1622726251.67.0.996959796718.issue44291@roundup.psfhosted.org> Kirill Pinchuk added the comment: Oh, sorry bad wording. The current implementation has reconnection logic only for UNIX sockets The patch adds reconnection logic for UDP/TCP sockets as well. I've done it with minimal changes to the existing code to accomplish that. And probably it can be merged. But in general, it looks like we can refactor SysLogHandler to inherit from SocketHandler. Not sure if it should be done in this PR or better to create separate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:33:51 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 03 Jun 2021 13:33:51 +0000 Subject: [issue39560] PyUnicode_FromKindAndData kind transformation is not documented In-Reply-To: <1580907133.21.0.114993814029.issue39560@roundup.psfhosted.org> Message-ID: <1622727231.65.0.970429014042.issue39560@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset 4eed2821d40373345ed133b2b8d912fef59acab7 by Zackery Spytz in branch 'main': bpo-39560: Document PyUnicode_FromKindAndData() kind transformation (GH-23848) https://github.com/python/cpython/commit/4eed2821d40373345ed133b2b8d912fef59acab7 ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:50:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Jun 2021 13:50:03 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622728203.35.0.0153906755429.issue44298@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25109 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 09:51:25 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 03 Jun 2021 13:51:25 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622728285.9.0.278900267421.issue44293@roundup.psfhosted.org> Ken Jin added the comment: @Jelle thanks for nosy-ing me too and the thorough investigation. @Joseph Thanks for taking the time to raise this inconvenience on the bug tracker. > By the way, Python typing is so much unstable (every version breaks the previous one), it's very complicated to write code that support multiple versions, so whatever the typing internal implementation, we must adapt. Compared to some of the more mature modules in Python, I have to agree that typing.py is mildly unstable. However, you're not supposed to be using/importing from the internal constructs - those have no guarantee of stability. If you feel some common use cases aren't met by the current introspection helpers, please please please create a new issue for that and we'll consider it. How we use typing may differ from how you use it and so there's a lot we don't see. User bug reports and feedback have helped to surface such issues and improved typing for everyone :). > I have chosen `list[int]` as an example of `types.GenericAlias` introduced by PEP 585 (i could have chosen `set[int]` or `collections.abc.Collection[int]`). But other generic aliases, e.g. `typing.List[int]` or `MyClass[int]` (where `MyClass` inherits `Generic[T]`), are not instances of `type`. This is an implementation detail. Most typing PEPs don't usually specify the runtime behavior in detail because most of them focus on static analysis. The implementation is usually up to the contributor's judgement. FWIW, to accommodate the new 3.9 GenericAlias, typing.py just added additional checks for `isinstance(tp, types.GenericAlias)` instead of checking only for `isinstance(tp, type)` and friends. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 10:11:05 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Thu, 03 Jun 2021 14:11:05 +0000 Subject: [issue39560] PyUnicode_FromKindAndData kind transformation is not documented In-Reply-To: <1580907133.21.0.114993814029.issue39560@roundup.psfhosted.org> Message-ID: <1622729465.56.0.382566396815.issue39560@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- stage: patch review -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 10:26:20 2021 From: report at bugs.python.org (john kim) Date: Thu, 03 Jun 2021 14:26:20 +0000 Subject: [issue44286] venv activate script would be good to show failure. In-Reply-To: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> Message-ID: <1622730380.48.0.534727304501.issue44286@roundup.psfhosted.org> john kim added the comment: Thank you for your explanation of venv. I understand that venv is not portable. But I was confused because the venv was written on the left side of the terminal line and it looked like it was working. Therefore, if venv does not work, such as if __venv_dir__ is invalid path, i thought any warning message or exception handling was necessary. Or (venv) doesn't show up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 10:32:06 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 03 Jun 2021 14:32:06 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. In-Reply-To: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> Message-ID: <1622730726.73.0.282058263855.issue44294@roundup.psfhosted.org> Zachary Ware added the comment: I suspect one or more of your screenshots did not make it through submission (you can only attach one at a time), but are you quite certain you got things straight here? This is the first report we've had of this, and I'm quite sure there would have been a flood of others if this were the case :) ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 10:41:35 2021 From: report at bugs.python.org (Mihai Ion) Date: Thu, 03 Jun 2021 14:41:35 +0000 Subject: [issue44300] using Linked list vs dynamic array for LifoQueue class Message-ID: <1622731295.64.0.26729974152.issue44300@roundup.psfhosted.org> New submission from Mihai Ion : Switching to Linked list data structure for improving performance append() and pop() run time complexity when eliminating dynamic array resizing ---------- components: Library (Lib) files: main.py messages: 395004 nosy: euromike21 priority: normal severity: normal status: open title: using Linked list vs dynamic array for LifoQueue class type: performance versions: Python 3.11 Added file: https://bugs.python.org/file50086/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:01:56 2021 From: report at bugs.python.org (Marten H. van Kerkwijk) Date: Thu, 03 Jun 2021 15:01:56 +0000 Subject: [issue21363] io.TextIOWrapper always closes wrapped files In-Reply-To: <1398603389.33.0.793055654008.issue21363@psf.upfronthosting.co.za> Message-ID: <1622732516.93.0.9602530547.issue21363@roundup.psfhosted.org> Marten H. van Kerkwijk added the comment: In astropy we are now working around the auto-closing of the underlying stream in TextIOWrapper by subclassing and overriding `__del__` to detach [1]. It would seem more elegant if `TestIOWrapper` (and really, `BufferedReader`) could gain an `closefd` argument, just like `open` has, which is `True` by default. p.s. Do let me know if it is better to open a new issue. [1] https://github.com/astropy/astropy/pull/11809 ---------- nosy: +mhvk type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:26:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Jun 2021 15:26:11 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622733971.79.0.342938174449.issue42972@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25110 pull_request: https://github.com/python/cpython/pull/26515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:34:31 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 03 Jun 2021 15:34:31 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622728285.9.0.278900267421.issue44293@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Instead of introspecting types, use this library: https://github.com/ilevkivskyi/typing_inspect ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:46:07 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Jun 2021 15:46:07 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622735167.35.0.0684536944672.issue44298@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 937cebc93b4922583218e0cbf0a9a14705a595b2 by Mark Shannon in branch 'main': bpo-44298: Fix line numbers for early exits in with statements. (GH-26513) https://github.com/python/cpython/commit/937cebc93b4922583218e0cbf0a9a14705a595b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:51:57 2021 From: report at bugs.python.org (Ivan Levkivskyi) Date: Thu, 03 Jun 2021 15:51:57 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622735517.17.0.278212551423.issue44293@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Btw this reminds me I should make a PyPI release of typing_inspect (last release was May 2020), hopefully will make a release on this weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:53:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 15:53:55 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622735635.97.0.498789175561.issue42213@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 82ad22a97d4b5d7134424f12bd6a61167db7f4f8 by Erlend Egeberg Aasland in branch 'main': bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512) https://github.com/python/cpython/commit/82ad22a97d4b5d7134424f12bd6a61167db7f4f8 ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:56:39 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 03 Jun 2021 15:56:39 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622735799.7.0.440636316438.issue44298@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25111 pull_request: https://github.com/python/cpython/pull/26516 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 11:57:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 15:57:15 +0000 Subject: [issue44290] x86-64 macOS 3.x buildbot build failed with: No such file or directory: '/Users/buildbot/buildarea/3.x.billenstein-macos/build/target/include/python3.11d/pyconfig.h' In-Reply-To: <1622650620.73.0.633378867962.issue44290@roundup.psfhosted.org> Message-ID: <1622735835.59.0.653394222725.issue44290@roundup.psfhosted.org> STINNER Victor added the comment: Well, as soon as the buildbot worker is green, it works for me :-D ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:04:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 16:04:29 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622736269.01.0.148949513507.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ea0210fa8ccca769896847f25fc6fadfe9a717bc by Victor Stinner in branch 'main': bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502) https://github.com/python/cpython/commit/ea0210fa8ccca769896847f25fc6fadfe9a717bc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:07:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Jun 2021 16:07:39 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622736459.04.0.17735313069.issue42213@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25112 pull_request: https://github.com/python/cpython/pull/26517 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:10:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 16:10:19 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622736619.54.0.971123124399.issue43921@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25113 pull_request: https://github.com/python/cpython/pull/26518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:13:29 2021 From: report at bugs.python.org (Azat Ibrakov) Date: Thu, 03 Jun 2021 16:13:29 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? Message-ID: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> New submission from Azat Ibrakov : I'm reimplementing `fractions.Fraction` class using C API (https://github.com/lycantropos/cfractions). And the problem is that I want to use `numbers.Rational` interface in my type checks to add support for user-defined rational numbers. I see how it's done for `decimal.Decimal` class: https://github.com/python/cpython/blob/142e5c5445c019542246d93fe2f9e195d3131686/Modules/_decimal/_decimal.c#L2916 but the problem is: I don't see when/where we call `Py_DECREF(Rational)`, so it looks like this class will not be "freed" until the end of the program. So my question is: is there any way to define some function which will be called once module is not used? ---------- components: C API messages: 395012 nosy: lycantropos priority: normal severity: normal status: open title: Is there a way to provide destructor for module written using C API? versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:19:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 16:19:54 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1622737194.27.0.896945202569.issue44301@roundup.psfhosted.org> STINNER Victor added the comment: Hi, you should use the multiphase initialization API which has clear and free functions. https://www.python.org/dev/peps/pep-0489/#the-proposal See for example the source code of the Modules/_abc.c extension. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:23:21 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 03 Jun 2021 16:23:21 +0000 Subject: [issue37041] IDLE: path browser unusable on some displays In-Reply-To: <1558779980.36.0.709549198107.issue37041@roundup.psfhosted.org> Message-ID: <1622737401.03.0.259621174179.issue37041@roundup.psfhosted.org> Change by Andre Roberge : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:28:35 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 03 Jun 2021 16:28:35 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622737715.82.0.318529639451.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 2c1e2583fdc4db6b43d163239ea42b0e8394171f by Eric Snow in branch 'main': bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388) https://github.com/python/cpython/commit/2c1e2583fdc4db6b43d163239ea42b0e8394171f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:35:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 16:35:18 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622738118.14.0.920213105983.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25114 pull_request: https://github.com/python/cpython/pull/26520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:38:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 16:38:28 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622738308.65.0.738254661782.issue42213@roundup.psfhosted.org> miss-islington added the comment: New changeset d88b47b5a396aa8d66f9a0e6b13a0825d59d0eff by Erlend Egeberg Aasland in branch 'main': bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517) https://github.com/python/cpython/commit/d88b47b5a396aa8d66f9a0e6b13a0825d59d0eff ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:38:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 16:38:18 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622738298.99.0.77244878836.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 84d80f5f30b1f545083c70a7d4e1e79ab75f9fa6 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-42972: Track sqlite3 statement objects (GH-26475) (GH-26515) https://github.com/python/cpython/commit/84d80f5f30b1f545083c70a7d4e1e79ab75f9fa6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:39:15 2021 From: report at bugs.python.org (Battant) Date: Thu, 03 Jun 2021 16:39:15 +0000 Subject: [issue44302] compile fail when make install run pip install as sudo Message-ID: <1622738355.45.0.608961303254.issue44302@roundup.psfhosted.org> New submission from Battant : Hello, 5.4.0-73-generic Here is my configuration ubuntu 20.04 linux kernel 5.4.0-73-generic step to reproduce clone cpytjpm 3.11 repository https://github.com/python/cpython compile with this tcl ./configure -with-tcltk-includes=/usr/include/ --with-tcltk-libs=/usr/local/lib/libtcl.so --enable-optimizations make sudo make install Actual result : compil fail because pip is run as sudo to install python rm -f /usr/local/bin/idle3 (cd /usr/local/bin; ln -s idle3.11 idle3) rm -f /usr/local/bin/pydoc3 (cd /usr/local/bin; ln -s pydoc3.11 pydoc3) rm -f /usr/local/bin/2to3 (cd /usr/local/bin; ln -s 2to3-3.11 2to3) if test "x" != "x" ; then \ rm -f /usr/local/bin/python3-32; \ (cd /usr/local/bin; ln -s python3.11-32 python3-32) \ fi if test "x" != "x" ; then \ rm -f /usr/local/bin/python3-intel64; \ (cd /usr/local/bin; ln -s python3.11-intel64 python3-intel64) \ fi rm -f /usr/local/share/man/man1/python3.1 (cd /usr/local/share/man/man1; ln -s python3.11.1 python3.1) if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--upgrade" ;; \ install|*) ensurepip="" ;; \ esac; \ ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Looking in links: /tmp/tmpr3j5u6l0 Requirement already satisfied: setuptools in /usr/local/lib/python3.11/site-packages (56.0.0) Requirement already satisfied: pip in /usr/local/lib/python3.11/site-packages (21.1.1) WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv See attachement log detais Could you help me please to fix this issus Best regards Battant ---------- components: Build files: output.log messages: 395017 nosy: Battant priority: normal severity: normal status: open title: compile fail when make install run pip install as sudo versions: Python 3.11 Added file: https://bugs.python.org/file50087/output.log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:43:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 16:43:09 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622738589.11.0.708429717048.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: New changeset f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 by Victor Stinner in branch 'main': bpo-39573: Py_TYPE becomes a static inline function (GH-26493) https://github.com/python/cpython/commit/f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:45:57 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 03 Jun 2021 16:45:57 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622738757.06.0.746575860791.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: I'm hoping we can get something close that for free by just waiting... the faster-cpython folks are working on a tagged-pointer implementation of integers as we speak. I've been looking for a new project, so I'd love to help work on this issue (if you're open to it). The pattern compiler is a bit of a beast, and I like to think I have a better than-average-understanding of it. ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:48:09 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 03 Jun 2021 16:48:09 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622738889.79.0.0199837832369.issue40395@roundup.psfhosted.org> Steve Dower added the comment: You shouldn't need to install the redistributable, but if you can't, then you have an issue that is not limited to CPython and it's not something we can fix. It sounds like you didn't try disabling any virus scanners. That may still help. If not, I don't know, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 12:59:19 2021 From: report at bugs.python.org (hai shi) Date: Thu, 03 Jun 2021 16:59:19 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1622739559.27.0.658969285603.issue37224@roundup.psfhosted.org> hai shi added the comment: OK, I try to take a look after Kyle leaves temporarily. But I haven't replicate this issue in my vm in recent days :( ---------- nosy: +shihai1991 versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:03:03 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 03 Jun 2021 17:03:03 +0000 Subject: [issue44238] Unable to install Python 3.9.5 - Windows Server In-Reply-To: <1622019183.28.0.514153258509.issue44238@roundup.psfhosted.org> Message-ID: <1622739783.31.0.518784729576.issue44238@roundup.psfhosted.org> Steve Dower added the comment: I see this line in your log: Rejecting product '{6504EEE5-2172-4D34-A76D-0372356396B4}': Non-assigned apps are disabled for non-admin users. I'm not entirely sure what it means, or how you managed to install it under this apparent restriction, but it looks like the issue. I'll have to take some time to research it, but someone else may figure it out first, so wanted to post this much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:10:54 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 17:10:54 +0000 Subject: [issue44303] Buildbot website failing with 503 Message-ID: <1622740254.43.0.647808533518.issue44303@roundup.psfhosted.org> New submission from Shreyan Avigyan : I was trying to debug a issue (the test_asyncio random failing problem) when suddenly Buildbot is showing up with "503 Service Unavailable No server is available to handle this request.". It's constantly failing with the request. I'm not sure if it's only for me though. ---------- components: Demos and Tools messages: 395023 nosy: shreyanavigyan priority: normal severity: normal status: open title: Buildbot website failing with 503 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:12:04 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 17:12:04 +0000 Subject: [issue44303] Buildbot website failing with 503 In-Reply-To: <1622740254.43.0.647808533518.issue44303@roundup.psfhosted.org> Message-ID: <1622740324.1.0.54546791483.issue44303@roundup.psfhosted.org> Shreyan Avigyan added the comment: Ok. Now it's back up again. Was a glitch perhaps. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:12:19 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 17:12:19 +0000 Subject: [issue44303] Buildbot website failing with 503 In-Reply-To: <1622740254.43.0.647808533518.issue44303@roundup.psfhosted.org> Message-ID: <1622740339.22.0.577770058056.issue44303@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:45:04 2021 From: report at bugs.python.org (wim glenn) Date: Thu, 03 Jun 2021 17:45:04 +0000 Subject: [issue29249] Pathlib glob ** bug In-Reply-To: <1484216394.04.0.57434547579.issue29249@psf.upfronthosting.co.za> Message-ID: <1622742304.22.0.329906340011.issue29249@roundup.psfhosted.org> Change by wim glenn : ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:53:16 2021 From: report at bugs.python.org (Sunny Jamshedji) Date: Thu, 03 Jun 2021 17:53:16 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. In-Reply-To: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> Message-ID: <1622742796.22.0.00742482871965.issue44294@roundup.psfhosted.org> Sunny Jamshedji added the comment: Screenshot 2. ---------- Added file: https://bugs.python.org/file50088/2. Used Save Link As.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:53:49 2021 From: report at bugs.python.org (Sunny Jamshedji) Date: Thu, 03 Jun 2021 17:53:49 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. In-Reply-To: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> Message-ID: <1622742829.24.0.417852157465.issue44294@roundup.psfhosted.org> Sunny Jamshedji added the comment: Screenshot 3 ---------- Added file: https://bugs.python.org/file50089/3. Use Show in Folder Opens Downloads.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 13:55:38 2021 From: report at bugs.python.org (Sunny Jamshedji) Date: Thu, 03 Jun 2021 17:55:38 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. In-Reply-To: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> Message-ID: <1622742938.53.0.646748407064.issue44294@roundup.psfhosted.org> Sunny Jamshedji added the comment: Screenshot 4 Yes, I would agree, since it stopped happening on the 3rd and 4th try like someone noticed something on the server end; maybe a little guy running around inside the server, IDK?! I'd close this myself, but it was certainly quite bizarre. ---------- Added file: https://bugs.python.org/file50090/4. Python 3.8.10 Installer.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:03:15 2021 From: report at bugs.python.org (wim glenn) Date: Thu, 03 Jun 2021 18:03:15 +0000 Subject: [issue28742] argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable In-Reply-To: <1479514629.23.0.218870455687.issue28742@psf.upfronthosting.co.za> Message-ID: <1622743395.8.0.866802183793.issue28742@roundup.psfhosted.org> Change by wim glenn : ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:03:40 2021 From: report at bugs.python.org (wim glenn) Date: Thu, 03 Jun 2021 18:03:40 +0000 Subject: [issue27153] Default value shown by argparse.ArgumentDefaultsHelpFormatter is backwards for action='store_false' In-Reply-To: <1464539974.48.0.860363682331.issue27153@psf.upfronthosting.co.za> Message-ID: <1622743420.46.0.345414087856.issue27153@roundup.psfhosted.org> Change by wim glenn : ---------- nosy: +wim.glenn _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:23:07 2021 From: report at bugs.python.org (mike bayer) Date: Thu, 03 Jun 2021 18:23:07 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 Message-ID: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> New submission from mike bayer : segmentation fault related to object deallocation and traceback objects, is extremely difficult to reproduce and definitely appeared as of 3.10.0b2, does not occur in 3.10.0b1. linux and osx platforms are affected. The issue requires "greenlet==1.1.0" to be installed, as well as that for me to reproduce it I have to use sqlite3 with some special APIs also, so while this issue might be in greenlet, or sqlite3, I have a feeling these are all factors that are combining together in a very random way to reveal something that's actually happening in the interpreter, but in any case would be great if core devs can see why it happens. The below script has been tested on various linux platforms, and the overall bug was revealed by an interaction in the SQLAlchemy test suite that's occurring in many places including OSX, linux. As noted, a whole bunch of very random things are needed for me to reproduce it. import greenlet import sqlite3 class _ErrorContainer(object): error = None def _expect_raises_fn(fn): ec = _ErrorContainer() try: fn() except Exception as err: assert str(err) == "this is a test" # assign the exception context outside of the except # is necessary ec.error = err # don't del the exception context is necessary # del ec def greenlet_spawn(fn, *args, **kwargs): # spawning a greenlet is necessary context = greenlet.greenlet(fn, greenlet.getcurrent()) # assignment to "result" is necessary result = context.switch(*args, **kwargs) # raising exception is necessary raise Exception("this is a test") class OuterConnectionWrapper: def __init__(self, connection): self.connection = connection def go(self, stmt): sqlite_connection = self.connection cursor = sqlite_connection.cursor() cursor.execute("select 1") return cursor def execute(self, stmt): return greenlet_spawn(self.go, stmt) def _do_close(self): self.connection.close() self.connection = None def close(self): self._do_close() class InnerConnectionWrapper: def __init__(self, connection): self.connection = connection def create_function(self, *arg, **kw): self.connection.create_function(*arg, **kw) def cursor(self): return self.connection.cursor() def close(self): self.connection = None class ConnectionPool: def __init__(self): self.conn = sqlite3.connect(":memory:") def regexp(a, b): return None self.conn.create_function("regexp", 2, regexp) def connect(self): return InnerConnectionWrapper(self.conn) def do_test(): pool = ConnectionPool() def go(): c1 = pool.connect() conn = OuterConnectionWrapper(c1) try: conn.execute("test") finally: conn.close() _expect_raises_fn(go) do_test() ---------- components: Interpreter Core messages: 395028 nosy: zzzeek priority: normal severity: normal status: open title: segmentation fault appeared in python 3.10.0b2 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:25:35 2021 From: report at bugs.python.org (mike bayer) Date: Thu, 03 Jun 2021 18:25:35 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622744735.6.0.559976443774.issue44304@roundup.psfhosted.org> mike bayer added the comment: if the issue is in greenlet this can be bounced back to https://github.com/python-greenlet/greenlet/issues/242 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:25:46 2021 From: report at bugs.python.org (James Gerity) Date: Thu, 03 Jun 2021 18:25:46 +0000 Subject: [issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default In-Reply-To: <1586118564.22.0.0408193741044.issue40199@roundup.psfhosted.org> Message-ID: <1622744746.76.0.702609732096.issue40199@roundup.psfhosted.org> James Gerity added the comment: The cause of DeprecationWarning sometimes [1] not being issued is I believe because in string_parser.c [2] the module is explicitly set to NULL and the filename will be '' or '' or somesuch, which eventually that ends up being normalized to something that isn't '__main__'. Not sure if this is stating the obvious and I don't see any general solution short of adding a filter for the special filenames, but I caught wind of this in #python on Libera, got curious, and thought I'd share what I learned here. I've also attached a gdb session showing how changing the filename affects this behavior. Reproducing this in debug/dev contexts is definitely fraught, since the warning behavior is different. [1] The given compile() sample, at the REPL, when using -c, or when piping input via stdin are the ones I know about [2] https://github.com/python/cpython/blob/f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970/Parser/string_parser.c#L19-L20 ---------- nosy: +SnoopJeDi2 Added file: https://bugs.python.org/file50091/gdb_deprecationwarning_session.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:33:06 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 03 Jun 2021 18:33:06 +0000 Subject: [issue44294] 3.9.5 Windows 64-bit installer says v3.8.10 in startup window. In-Reply-To: <1622673246.94.0.636468251984.issue44294@roundup.psfhosted.org> Message-ID: <1622745186.4.0.854835096187.issue44294@roundup.psfhosted.org> Zachary Ware added the comment: I don't see anything that looks odd from your screenshots, so I'll go ahead and close it. Steve can leave a note here if there was actually something going weird on the server that he fixed. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:50:04 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Thu, 03 Jun 2021 18:50:04 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1622746204.19.0.0152104059521.issue43105@roundup.psfhosted.org> Senthil Kumaran added the comment: There is a report about this change might have caused behaviour change for '.' in sys.path between 3.10.0a7 and 3.10.0b1 https://mail.python.org/archives/list/python-dev at python.org/thread/DE3MDGB2JGOJ3X4NWEGJS26BK6PJUPKW/ ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 14:57:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 18:57:38 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622746658.79.0.426789540865.issue44298@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset cea0585b7939b487d7089f9d473f495264e8a491 by Mark Shannon in branch '3.10': [3.10] bpo-44298: Backport #26513 to 3.10 (#26516) https://github.com/python/cpython/commit/cea0585b7939b487d7089f9d473f495264e8a491 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:04:07 2021 From: report at bugs.python.org (Azat Ibrakov) Date: Thu, 03 Jun 2021 19:04:07 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1622747047.0.0.989259910677.issue44301@roundup.psfhosted.org> Azat Ibrakov added the comment: With this setup https://gist.github.com/lycantropos/f9243dc98e104a13ddd991316e93d31a I get prompt about module being initialized but that's it: it never gets deleted and reference count for `Rational` keeps increasing. What am I missing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:54:14 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 19:54:14 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622750054.89.0.0203173807638.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: Victor, this issue is reproducible on Linux. I reproduced it on my WSL. And I've identified the issue is in test_close_kill_running. The patch for resolving the crash in bpo-38323 can be the cause of the newly introduced hang. test_close_kill_running is running and passing and again it is running all over again infinitely. And extending the buildbot timer may not help since it seems it's running infinitely. Even if we look at the buildbot log there is no sign of crash but suddenly buildbot says "timeout!". ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:55:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 19:55:49 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622750149.2.0.206739242433.issue44112@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Victor, this issue is reproducible on Linux. I reproduced it on my WSL. How did you managed? I ran test_asyncio for almost 5 hours with -R in my linux machine and could not reproduce? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:56:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 19:56:34 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622750194.19.0.184911758385.issue44112@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > And extending the buildbot timer may not help since it seems it's running infinitely Extending the bot time was done so we can use faulthandler to identify the test, because buildbot was cancelling the whole build before that :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:59:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 19:59:00 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622750340.11.0.523888780494.issue44298@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ned, can you confirm that this works for you? I am closing the issue, but if something is missing, please, reopen it and we will look into it :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 15:59:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 19:59:36 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1622750376.88.0.937873793283.issue42862@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f461a7fc3f8740b9e79e8874175115a3474e5930 by Erlend Egeberg Aasland in branch 'main': bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module (GH-24203) https://github.com/python/cpython/commit/f461a7fc3f8740b9e79e8874175115a3474e5930 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:01:12 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 20:01:12 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622750472.82.0.00197238978589.issue11105@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25115 pull_request: https://github.com/python/cpython/pull/26521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:01:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 20:01:10 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622750470.59.0.018311404977.issue11105@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f3491242e41933aa9529add7102edb68b80a25e9 by Batuhan Taskaya in branch 'main': bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) https://github.com/python/cpython/commit/f3491242e41933aa9529add7102edb68b80a25e9 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:01:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 20:01:40 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1622750500.18.0.920948144363.issue42862@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 Jun 3 16:02:58 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 20:02:58 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622750578.49.0.627571818595.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: > How did you managed? I ran test_asyncio for almost 5 hours with -R in my linux machine and could not reproduce? Now it's not again not reproducing. Maybe I used some wrong flag. But I'll try to debug this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:05:16 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 03 Jun 2021 20:05:16 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622750716.96.0.637048454824.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: I've also been trying to debug it for the whole day. Not sure what's causing this. (Why does all error occur in Fedora buildbots? If I remember correctly, another test also failed there.") ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:12:40 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 20:12:40 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622751160.59.0.0818080338415.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5c2191df9a21a3b3d49dd0711b8d2b92591ce82b by Victor Stinner in branch 'main': bpo-43921: Cleanup test_ssl.test_wrong_cert_tls13() (GH-26520) https://github.com/python/cpython/commit/5c2191df9a21a3b3d49dd0711b8d2b92591ce82b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:15:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 20:15:22 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622751322.5.0.157894887898.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d2ab15f5376aa06ed120164f1b84bb40adbdd068 by Miss Islington (bot) in branch '3.10': bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502) (GH-26518) https://github.com/python/cpython/commit/d2ab15f5376aa06ed120164f1b84bb40adbdd068 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:23:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 20:23:54 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622751834.68.0.849806902602.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: Ok, test_wrong_cert_tls13() and test_pha_required_nocert() of test_ssl should now be more reliable on Windows. I consider that the initial issue is now fixed and I close the issue. ---------- components: +SSL, Tests resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:27:09 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 03 Jun 2021 20:27:09 +0000 Subject: [issue11105] Compiling evil ast crashes interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622752029.17.0.174241273859.issue11105@roundup.psfhosted.org> miss-islington added the comment: New changeset 976598d36bd180024c5f0edf1f7ec0f0b436380f by Miss Islington (bot) in branch '3.10': bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) https://github.com/python/cpython/commit/976598d36bd180024c5f0edf1f7ec0f0b436380f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:29:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 03 Jun 2021 20:29:27 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1622752167.97.0.951658265758.issue42064@roundup.psfhosted.org> Erlend E. Aasland added the comment: Global module state has been established by f461a7fc3f8740b9e79e8874175115a3474e5930 (bpo-42862, GH-24203). We can safely migrate static variables into that struct as a next step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:34:05 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 03 Jun 2021 20:34:05 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622752445.36.0.723111296669.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- components: +Interpreter Core -None priority: low -> normal title: Compiling evil ast crashes interpreter -> Compiling recursive Python ASTs crash the interpreter versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:35:03 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 03 Jun 2021 20:35:03 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622752503.62.0.697599630576.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25116 pull_request: https://github.com/python/cpython/pull/26522 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 16:39:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 03 Jun 2021 20:39:58 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622752798.26.0.823248225207.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- priority: deferred blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:08:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:08:25 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622754505.36.0.294362142658.issue44112@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > And I've identified the issue is in test_close_kill_running. The patch for resolving the crash in bpo-38323 can be the cause of the newly introduced hang Also, how did you reached this conclusion? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:22:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:22:37 +0000 Subject: [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__ In-Reply-To: <1622473445.97.0.736288875096.issue44273@roundup.psfhosted.org> Message-ID: <1622755357.62.0.157396481596.issue44273@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3283bf4519139cf62ba04a76930f84ca1e7da910 by Pablo Galindo in branch '3.10': [3.10] bpo-44273: Improve syntax error message for assigning to "..." (GH-26477) (GH-26478) https://github.com/python/cpython/commit/3283bf4519139cf62ba04a76930f84ca1e7da910 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:22:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:22:38 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622755358.19.0.403990610059.issue11105@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset de58b319af3a72440a74e807cf8a1194ed0c6d8c by Batuhan Taskaya in branch '3.9': [3.9] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) (GH-26522) https://github.com/python/cpython/commit/de58b319af3a72440a74e807cf8a1194ed0c6d8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:24:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:24:34 +0000 Subject: [issue44042] [sqlite3] _pysqlite_connection_begin() optimisations In-Reply-To: <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org> Message-ID: <1622755474.95.0.573667212073.issue44042@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:24:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:24:29 +0000 Subject: [issue44042] [sqlite3] _pysqlite_connection_begin() optimisations In-Reply-To: <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org> Message-ID: <1622755469.34.0.862735732825.issue44042@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3446516ffa92c98519146253153484291947b273 by Erlend Egeberg Aasland in branch 'main': bpo-44042: Optimize sqlite3 begin transaction (GH-25908) https://github.com/python/cpython/commit/3446516ffa92c98519146253153484291947b273 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:25:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:25:00 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622755500.48.0.0528871712212.issue11105@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 Jun 3 17:41:17 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 03 Jun 2021 21:41:17 +0000 Subject: [issue44298] 3.10.0b2 traces with-exit before the break that caused the exit In-Reply-To: <1622714702.42.0.954785031393.issue44298@roundup.psfhosted.org> Message-ID: <1622756477.72.0.723861680785.issue44298@roundup.psfhosted.org> Ned Batchelder added the comment: Thanks for the quick turnaround, this works! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:48:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:48:37 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block Message-ID: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Given this script: try: x = 34 a = 1 instead of printing: File "/home/pablogsal/github/python/master/lel.py", line 4 a = 1 ^ SyntaxError: invalid syntax we should print: File "/home/pablogsal/github/python/master/lel.py", line 4 a = 1 ^ SyntaxError: expected 'except' or 'finally' block ---------- messages: 395053 nosy: pablogsal priority: normal severity: normal status: open title: Improve syntax error for try block without finally or except block _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 17:52:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 21:52:27 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block In-Reply-To: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> Message-ID: <1622757147.22.0.114996761301.issue44305@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25117 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26523 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 18:08:45 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 03 Jun 2021 22:08:45 +0000 Subject: [issue44306] asyncio.from_thread Message-ID: <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org> New submission from Thomas Grainger : create a asyncio.from_thread shortcut to run async functions from a thread started with asyncio.to_thread ``` def from_thread(async_func, /, *args, **kwargs): """Synchronously run function *async_func* in the event loop thread. Any *args and **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propogated, allowing context variables from the main thread to be accessed in the separate thread. Return a concurrent.futures.Future to wait for the result from the event loop thread. ``` ---------- components: asyncio messages: 395054 nosy: asvetlov, graingert, yselivanov priority: normal severity: normal status: open title: asyncio.from_thread _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 18:09:29 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 03 Jun 2021 22:09:29 +0000 Subject: [issue44306] asyncio.from_thread In-Reply-To: <1622758125.93.0.576935961865.issue44306@roundup.psfhosted.org> Message-ID: <1622758169.99.0.984360390266.issue44306@roundup.psfhosted.org> Thomas Grainger added the comment: """High-level support for working with threads in asyncio""" import functools import contextvars from . import events from . import tasks __all__ = "to_thread", "from_thread" class _Local(threading.local): loop = None _local = _Local() def _with_loop(loop, func, /, *args, **kwargs): _loop.loop = loop try: return func(*args, **kwargs) finally: _loop.loop = None async def to_thread(func, /, *args, **kwargs): """Asynchronously run function *func* in a separate thread. Any *args and **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propogated, allowing context variables from the main thread to be accessed in the separate thread. Return a coroutine that can be awaited to get the eventual result of *func*. """ loop = events.get_running_loop() ctx = contextvars.copy_context() func_call = functools.partial(_with_loop, loop, ctx.run, func, *args, **kwargs) return await loop.run_in_executor(None, func_call) def _create_task(async_func, /, *args, **kwargs): return events.create_task(async_func(*args, **kwargs)) async def _with_context(ctx, async_func, /, *args, **kwargs): return await ctx.run(_create_task, async_func, *args, **kwargs) def from_thread(async_func, /, *args, **kwargs): """Synchronously run function *async_func* in the event loop thread. Any *args and **kwargs supplied for this function are directly passed to *func*. Also, the current :class:`contextvars.Context` is propogated, allowing context variables from the main thread to be accessed in the separate thread. Return a concurrent.futures.Future to wait for the result from the event loop thread. """ loop = _loop.loop if loop is None: raise RuntimeError( "asyncio.from_thread can only be run in a thread started by " "asyncio.to_thread" ) ctx = contextvars.copy_context() return tasks.run_coroutine_threadsafe(loop, _with_context(ctx, async_func, *args, **kwargs)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 18:52:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 22:52:19 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block In-Reply-To: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> Message-ID: <1622760739.38.0.6613934456.issue44305@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b250f89bb7e05e72a4641d44b988866b919575db by Pablo Galindo in branch 'main': bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) https://github.com/python/cpython/commit/b250f89bb7e05e72a4641d44b988866b919575db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 18:53:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 22:53:20 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block In-Reply-To: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> Message-ID: <1622760800.73.0.327400256379.issue44305@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25118 pull_request: https://github.com/python/cpython/pull/26524 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 18:53:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 22:53:44 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block In-Reply-To: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> Message-ID: <1622760824.99.0.50793918925.issue44305@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 Jun 3 19:11:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 23:11:51 +0000 Subject: [issue44305] Improve syntax error for try block without finally or except block In-Reply-To: <1622756917.47.0.333858090631.issue44305@roundup.psfhosted.org> Message-ID: <1622761911.49.0.64505539325.issue44305@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e53f72a1b42e17a331ed14bec674b1ee01d0720c by Pablo Galindo in branch '3.10': [3.10] bpo-44305: Improve syntax error for try blocks without except or finally (GH-26523) (GH-26524) https://github.com/python/cpython/commit/e53f72a1b42e17a331ed14bec674b1ee01d0720c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 19:37:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 23:37:38 +0000 Subject: [issue32280] Expose `_PyRuntime` through a section name In-Reply-To: <1513034681.19.0.213398074469.issue32280@psf.upfronthosting.co.za> Message-ID: <1622763458.02.0.794011283746.issue32280@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 Jun 3 19:37:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 03 Jun 2021 23:37:50 +0000 Subject: [issue32280] Expose `_PyRuntime` through a section name In-Reply-To: <1513034681.19.0.213398074469.issue32280@psf.upfronthosting.co.za> Message-ID: <1622763470.61.0.750989434276.issue32280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 35002aa8f62dda1f79035e9904abdf476683e9be by Max B?langer in branch 'main': bpo-32280: Store _PyRuntime in a named section (GH-4802) https://github.com/python/cpython/commit/35002aa8f62dda1f79035e9904abdf476683e9be ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 20:04:03 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 04 Jun 2021 00:04:03 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622765043.68.0.345856840499.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset b2bf2bc1ece673d387341e06c8d3c2bc6e259747 by Mark Shannon in branch 'main': bpo-43693: Compute deref offsets in compiler (gh-25152) https://github.com/python/cpython/commit/b2bf2bc1ece673d387341e06c8d3c2bc6e259747 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 20:56:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 00:56:10 +0000 Subject: [issue31552] IDLE: Convert browswers to use ttk.Treeview In-Reply-To: <1506093531.0.0.600281497403.issue31552@psf.upfronthosting.co.za> Message-ID: <1622768170.35.0.51050144915.issue31552@roundup.psfhosted.org> Terry J. Reedy added the comment: Concrete reason 3. Treewidget does not work on high-res monitors. The #37041 quick Treeview test worked for Andre Roberge ---------- nosy: +aroberge versions: +Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 21:50:34 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 04 Jun 2021 01:50:34 +0000 Subject: [issue44307] date.today() is 2x slower than datetime.now().date() Message-ID: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> New submission from Anthony Sottile : ```console $ python3.10 -m timeit -s 'from datetime import datetime' 'datetime.now().date()' 500000 loops, best of 5: 708 nsec per loop $ python3.10 -m timeit -s 'from datetime import date' 'date.today()' 200000 loops, best of 5: 1.4 usec per loop ``` this surprised me so I dug into it -- it appears a fast path can be added to `date.today()` to make it faster than `datetime.date.now()` -- though I'm rather unfamiliar with the functions involved here here is my ~sloppy patch attempting to add a fast path, I would need some guidance to improve it and get it accepted: ```diff $ git diff -w diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 8ef2dad37a..7eaa5d1740 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -2875,6 +2875,17 @@ date_fromtimestamp(PyObject *cls, PyObject *obj) static PyObject * date_today(PyObject *cls, PyObject *dummy) { + /* fast path, don't call fromtimestamp */ + if ((PyTypeObject *)cls == &PyDateTime_DateType) { + struct tm tm; + time_t t; + time(&t); + localtime_r(&t, &tm); + return new_date_ex(tm.tm_year + 1900, + tm.tm_mon + 1, + tm.tm_mday, + (PyTypeObject*)cls); + } else { PyObject *time; PyObject *result; _Py_IDENTIFIER(fromtimestamp); @@ -2893,6 +2904,7 @@ date_today(PyObject *cls, PyObject *dummy) Py_DECREF(time); return result; } +} /*[clinic input] @classmethod ``` after this, `date.today()` is faster! ```console $ ./python -m timeit -s 'from datetime import datetime' 'datetime.now().date()' 500000 loops, best of 5: 764 nsec per loop $ ./python -m timeit -s 'from datetime import date' 'date.today()' 500000 loops, best of 5: 407 nsec per loop ``` \o/ ---------- components: Extension Modules messages: 395061 nosy: Anthony Sottile priority: normal severity: normal status: open title: date.today() is 2x slower than datetime.now().date() type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 22:27:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 04 Jun 2021 02:27:44 +0000 Subject: [issue44300] using Linked list vs dynamic array for LifoQueue class In-Reply-To: <1622731295.64.0.26729974152.issue44300@roundup.psfhosted.org> Message-ID: <1622773664.93.0.724093078585.issue44300@roundup.psfhosted.org> Raymond Hettinger added the comment: Lists appends and pops are already amortized O(1) operations. As they grow, they over-allocate by 12.5%. When shrinking they reclaim memory when the size falls in half. Together, these two strategies make lists efficient as a LIFO stack. A straight linked list has worse performance across the board. There would be an allocation on every append and deallocation on every pop. Links tend to be scattered across memory causing cache locality to lost. Also, links have more space overhead than the individual pointers used by a list. If any change were to be made, it would likely be to use deque() instead of a list. The timings in Tools/scripts/var_access_benchmark.py show that deques are slightly better than what we have now. However, small deques take more space than small lists. Also, deques are vastly outperformed by lists when running PyPy. So we should stick with the very close second runner up. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 22:31:58 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 04 Jun 2021 02:31:58 +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: <1622773918.63.0.162128618995.issue43654@roundup.psfhosted.org> Raymond Hettinger added the comment: > The unknown is whether anyone has changed these > pseudoevent bindings and if so, how much do we care? I don't think we care. Getting tab completion sorted out is the priority. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 23:09:36 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Jun 2021 03:09:36 +0000 Subject: [issue44307] date.today() is 2x slower than datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622776176.37.0.718858724829.issue44307@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 3 23:10:23 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 04 Jun 2021 03:10:23 +0000 Subject: [issue44307] date.today() is 2x slower than datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622776223.46.0.2715261153.issue44307@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 00:21:26 2021 From: report at bugs.python.org (Nicholas Willhite) Date: Fri, 04 Jun 2021 04:21:26 +0000 Subject: [issue44308] Raw Strings lack parody Message-ID: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> New submission from Nicholas Willhite : I'm really sure this isn't filed correctly. I'm a total noob to this process, so feel free to redirect me. :) Bytes can be defined as a function, or a prefixed series. You can prefix a series with "b" and get the expected data type. You can also use the builtin functions "bytes" to get the same structure: bytes('foo\bar', 'utf-8') == b'foo\bar' True But there's no builtin function for r'foo\bar' that gives you 'foo\\bar'. This would be really handy for applications that accept a regular expression. If that regex was part of the source code, I'd just r'foo\bar' to get the expected string. Being able to accept something like bytes and do: data = b'foo\bar' raw_string(data) 'foo\\bar' would be really useful for applications that accept a regex as input. Is there an obvious way to do this that I'm not seeing? Has my google-foo failed me? Feels like a function that should exist in the stdlib. Again, really sure I'm not "doing this correctly." So please direct me! :) Appreciative, -Nick Willhite ---------- components: Unicode messages: 395064 nosy: Nicholas Willhite, ezio.melotti, vstinner priority: normal severity: normal status: open title: Raw Strings lack parody type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 00:33:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 04 Jun 2021 04:33:57 +0000 Subject: [issue13299] namedtuple row factory for sqlite3 In-Reply-To: <1320021145.59.0.53370875256.issue13299@psf.upfronthosting.co.za> Message-ID: <1622781237.42.0.133918577978.issue13299@roundup.psfhosted.org> Raymond Hettinger added the comment: FWIW, namedtuple speed improved considerably since these posts were made. When I last checked, their lookup speed was about the same as a dict lookup. See: https://docs.python.org/3/whatsnew/3.9.html#optimizations ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 01:11:15 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 04 Jun 2021 05:11:15 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622783475.41.0.201747116301.issue44308@roundup.psfhosted.org> Steven D'Aprano added the comment: I think you have missed something important here: >>> data = b'foo\bar' >>> len(data) 6 >>> print(data) b'foo\x08ar' If you want bytes including a backslash followed by a b, you need to use raw bytes rb'foo\bar' or escape the backslash. Also Python 3.8 is in feature-freeze so the earliest this new feature could be added to the language is now 3.11. ---------- nosy: +steven.daprano type: behavior -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 01:27:50 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 04 Jun 2021 05:27:50 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622784470.01.0.495273793325.issue44308@roundup.psfhosted.org> Steven D'Aprano added the comment: Remember that backslash escapes are only a Python syntactic feature. If you read data from a file, or from the input() builtin, that contains a backslash, it remains a backslash: >>> s = input() a\b >>> print(len(s), s == r'a\b') 3 True Backslashes are only special in two cases: as source code, and when displaying a string (or bytes) using `repr`. So if you get a regex from the user, say by reading it from a file, or from stdin, or from a text field in a GUI, etc. and that regex contains a backslash, your string will contain a backslash and you don't need anything special. Does this solve your problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 02:27:57 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 04 Jun 2021 06:27:57 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622788077.44.0.661591230561.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: The test result I got kind of seemed that the problem was in test_close_kill_running but it maybe that I used wrong flag (maybe -F?). And it is also weird that the error is occurring only in Fedora buildbot and not on others. Also the logs are not showing which test it was executing when the timeout occured. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 05:42:57 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 04 Jun 2021 09:42:57 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1622799777.3.0.135298240437.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: Hi Brandt, I would welcome your collaboration/mentorship in whatever capacity makes sense. I sent an email to brandt at python.org from sweeney.dennis650 at gmail.com. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 06:12:16 2021 From: report at bugs.python.org (kuzja) Date: Fri, 04 Jun 2021 10:12:16 +0000 Subject: [issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7. In-Reply-To: <1587910690.73.0.0218819691356.issue40395@roundup.psfhosted.org> Message-ID: <1622801536.34.0.415747401118.issue40395@roundup.psfhosted.org> Change by kuzja : ---------- nosy: -kuzja _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 06:30:59 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 04 Jun 2021 10:30:59 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622802659.44.0.119821196215.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: I ran the test_suite on commit f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 in my WSL 1 Ubuntu and got some unexpected results. There are huge reference leaks in the tests and test_asyncio, test_subprocess, test_socket, etc., failed. I forked the branch a while ago so the HEAD is on f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970. Don't know if these are fixed already but reported them here since there were no commits for any issue based on test_asyncio, test_subprocess recently. And most surprisingly I got a timeout error also but it was for "2:03:30 load avg: 0.52 running: test_ssl (1 hour 54 min), test_largefile (1 hour 18 min), test_io (1 hour 30 min)". I attached the log for full details. (I use WSL 1 so note it's written ./python.exe instead of ./python) ---------- Added file: https://bugs.python.org/file50092/wsl_log.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 06:37:52 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 04 Jun 2021 10:37:52 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622803072.56.0.407003770367.issue44112@roundup.psfhosted.org> Change by Chris Jerdonek : ---------- nosy: +chris.jerdonek _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 06:46:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 04 Jun 2021 10:46:39 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622803599.37.0.183423181296.issue43921@roundup.psfhosted.org> Christian Heimes added the comment: Reopening * GH-26502 is missing backport to 3.9. I also don't consider the changeset a proper fix. It's a patch that makes the test pass when something goes wrong. We have not yet figured out why something goes wrong on Windows sometimes. * GH-26520 is missing backports to 3.9 and 3.10 ---------- resolution: fixed -> stage: resolved -> needs patch status: closed -> open type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 06:57:10 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Jun 2021 10:57:10 +0000 Subject: [issue31664] Add support of new crypt methods In-Reply-To: <1506936288.65.0.213398074469.issue31664@psf.upfronthosting.co.za> Message-ID: <1622804230.28.0.1332430853.issue31664@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +25119 pull_request: https://github.com/python/cpython/pull/26526 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:10:28 2021 From: report at bugs.python.org (=?utf-8?q?Bj=C3=B6rn_Esser?=) Date: Fri, 04 Jun 2021 11:10:28 +0000 Subject: [issue44309] Add support for yescrypt in crypt. Message-ID: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> New submission from Bj?rn Esser : Proposed PR adds support for a new method in the crypt module: yescrypt. It is considered stronger as SHA512 or blowfish and as strong as argon2 for crypt() purpose. The hashing method was developed by the author of the blowfish crypt method, and was based on scrypt. It is supported on most Linux distributions, that ship with libxcrypt as a replacement for the glibc crypt library: Fedora, Debian, Ubuntu, OpenSUSE and many others. ---------- components: Library (Lib) messages: 395073 nosy: besser82 priority: normal pull_requests: 25120 severity: normal status: open title: Add support for yescrypt in crypt. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:10:39 2021 From: report at bugs.python.org (=?utf-8?q?Bj=C3=B6rn_Esser?=) Date: Fri, 04 Jun 2021 11:10:39 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1622805039.85.0.290516847925.issue44309@roundup.psfhosted.org> Change by Bj?rn Esser : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:18:33 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 04 Jun 2021 11:18:33 +0000 Subject: [issue44286] venv activate script would be good to show failure. In-Reply-To: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> Message-ID: <1622805513.11.0.686918369331.issue44286@roundup.psfhosted.org> Vinay Sajip added the comment: > i thought any warning message or exception handling was necessary. Or (venv) doesn't show up. No, because these are just scripts created by venv and placed in the venv's directory tree. If you then move the files to a different location, they aren't engineered to notice, and so will not behave as you expect. As venv's aren't meant to be moved, there's no particular reason to engineer for that possibility. OK to close this issue as "not a bug"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:28:03 2021 From: report at bugs.python.org (=?utf-8?q?Bj=C3=B6rn_Esser?=) Date: Fri, 04 Jun 2021 11:28:03 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1622806083.06.0.624305148752.issue44309@roundup.psfhosted.org> Change by Bj?rn Esser : ---------- keywords: +patch pull_requests: +25121 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26527 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:45:58 2021 From: report at bugs.python.org (Wouter De Borger) Date: Fri, 04 Jun 2021 11:45:58 +0000 Subject: [issue44310] lru_cache memory leak Message-ID: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> New submission from Wouter De Borger : # Problem the functools.lru_cache decorator locks all arguments to the function in memory (inclusing self), causing hard to find memory leaks. # Expected I had assumed that the lru_cache would keep weak-references and that when an object is garbage colected, all its cache entries expire as unreachable. This is not the case. # Solutions 1. I think it is worth at least mentioning this behavior in de documentation. 2. I also think it would be good if the LRU cache actually uses weak references. I will try to make a PR for this. ---------- components: Library (Lib) messages: 395075 nosy: Wouter De Borger2 priority: normal severity: normal status: open title: lru_cache memory leak 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 Jun 4 07:47:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 11:47:03 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622807223.3.0.932003857923.issue44308@roundup.psfhosted.org> STINNER Victor added the comment: You can use br"\n" to get 2 bytes: b"\\" and b"n". IMO it's the best practice, to use raw strings for regular expressions. Converting a regular string to a raw string sounds like a bad idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:53:01 2021 From: report at bugs.python.org (Wouter De Borger) Date: Fri, 04 Jun 2021 11:53:01 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622807581.34.0.836030125082.issue44310@roundup.psfhosted.org> Change by Wouter De Borger : ---------- type: -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:58:32 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 04 Jun 2021 11:58:32 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622807912.96.0.918982615129.issue44308@roundup.psfhosted.org> Mark Dickinson added the comment: > But there's no builtin function for r'foo\bar' that gives you 'foo\\bar'. I'm confused about what's being requested here. r'foo\bar' and 'foo\\bar' are different source code representations of the exact same string (same type, same contents), so the identity function is such a function. >>> f(r'foo\bar') == 'foo\\bar' True Nicholas: presumably you're after something more than the identity function. Can you clarify what the input and output types to your proposed function would be, and then give example input and output values? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 07:59:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 11:59:20 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622807960.42.0.746856287803.issue43921@roundup.psfhosted.org> STINNER Victor added the comment: Christian: I mostly care about buildbots. I cannot reproduce the issue in 3.9. If it's not broken, I don't want to touch the code :-) For GH-26520, I explained that I don't want to backport it (it's only in main). Moreover, you asked for automated backports, but it failed. If you consider that it should be backported, please go ahead :-) https://github.com/python/cpython/pull/26520#issuecomment-854148173 "GH-26502 is missing backport to 3.9. I also don't consider the changeset a proper fix. It's a patch that makes the test pass when something goes wrong. We have not yet figured out why something goes wrong on Windows sometimes." I am not convinced that getting an SSLEOFError on Windows is a bug. I cannot explain it why 3.10 and main branches behave differently, but I'm not interested to investigate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:00:32 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 04 Jun 2021 12:00:32 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622808032.73.0.648278438322.issue44308@roundup.psfhosted.org> Mark Dickinson added the comment: Sorry, I missed the definition of f in the last message. Trying again: >>> def f(x): return x ... >>> f(r'foo\bar') == 'foo\\bar' True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:07:29 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 04 Jun 2021 12:07:29 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622808449.37.0.110927556.issue44308@roundup.psfhosted.org> Mark Dickinson added the comment: Ah, I think I see: you want a function that turns the string "foo\bar" into "foo\\bar". Even if this were a good idea, I don't think it's feasible to do it in a non-surprising way. For example, given such a function f, what outputs would you expect for: (a) f("\012"), and (b) f("\n")? (And yes, this is a trick question: "\012" and "\n" are the same string.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:07:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 12:07:59 +0000 Subject: [issue44041] [sqlite3] optimisation: only call sqlite3_column_count when needed In-Reply-To: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> Message-ID: <1622808479.04.0.093406412168.issue44041@roundup.psfhosted.org> Erlend E. Aasland added the comment: This change breaks existing behaviour (see test below). Also, sqlite3_column_count() is implemented as a simple lookup in SQLite; it is never an expensive function. Suggests to add the following test instead: diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 77fafe0930..d7a3b249ab 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -555,6 +555,17 @@ def test_last_row_id_insert_o_r(self): ] self.assertEqual(results, expected) + def test_column_count(self): + # Check that column count is updated correctly for cached statements + select = "select * from test" + res = self.cu.execute(select) + old_count = len(res.description) + # Add a new column and execute the cached select query again + self.cu.execute("alter table test add newcol") + res = self.cu.execute(select) + new_count = len(res.description) + self.assertEqual(old_count - new_count, 1) + class ThreadTests(unittest.TestCase): def setUp(self): ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:08:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 12:08:20 +0000 Subject: [issue44041] [sqlite3] check that column count is updated correctly for cached statements In-Reply-To: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> Message-ID: <1622808500.8.0.621005043733.issue44041@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:22:20 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 04 Jun 2021 12:22:20 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622809340.57.0.442340779379.issue44310@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +25122 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26528 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:30:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 12:30:13 +0000 Subject: [issue43921] test_ssl: test_wrong_cert_tls13() and test_pha_required_nocert() fail randomly on Windows In-Reply-To: <1619175378.51.0.235353622205.issue43921@roundup.psfhosted.org> Message-ID: <1622809813.83.0.0447146553418.issue43921@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: -vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 08:39:59 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Fri, 04 Jun 2021 12:39:59 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622810399.09.0.447494408891.issue44310@roundup.psfhosted.org> Change by Joannah Nanjekye : ---------- nosy: +nanjekyejoannah, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 09:20:02 2021 From: report at bugs.python.org (Jinwoo PARK NANTIER) Date: Fri, 04 Jun 2021 13:20:02 +0000 Subject: [issue44311] How to print results of asyncio websockets at the same time? Message-ID: <1622812802.67.0.29847846911.issue44311@roundup.psfhosted.org> New submission from Jinwoo PARK NANTIER : ## Question - How can I merge the results of two or three asynchronous websocket results, defined with the library `asyncio`? - I am downloading order book data (how many people want to buy or sell something at which price) of cryptocurrencies using websockets asynchronously, but having hard time showing the results of several coins. - The desired output example is as follows, being printed at the same time : ```python XRP-BTC : The most favorable ask price is 0.00023 ETH-BTC : The most favorable ask price is 0.04 LTC-BTC : The most favorable ask price is 0.001 ``` - Each line is a result of each websocket, so what I want to do is to merge the results of several webscokets ## Code Example ```python import asyncio import websockets import ast import time import json # websocket address for the cryptocurrency exchange OKEx url = "wss://ws.okex.com:8443/ws/v5/public" # function to download orderbook data, using websocket asynchronously async def ws_orderbook5(crypto_pair): while True: try: async with websockets.connect(url) as ws: channels = [{'channel': 'books5', 'instId': f'{crypto_pair}'}] sub_param = {"op": "subscribe", "args": channels} sub_str = json.dumps(sub_param) await ws.send(sub_str) print(f"send: {sub_str}") res = await asyncio.wait_for(ws.recv(), timeout=25) while True: try: res = await asyncio.wait_for(ws.recv(), timeout=25) res = ast.literal_eval(res) print(f"{crypto-pair} : Most favorable ask price is {res['data'][0]['asks'][0][0]}") time.sleep(1) except (asyncio.TimeoutError, websockets.exceptions.ConnectionClosed) as e: try: await ws.send('ping') print("") print("ping") res = await ws.recv() continue except Exception as e: print("Failure due to an unknown error. Stopped working") break except Exception as e: print("Failure due to an unknown error. Try working again") continue ``` - The variable `res`, which is the data downloaded from OKEx websocket looks like the following dictionary, when the argument `crypto_pair` = 'XRP-BTC' . ```python {'arg': {'channel': 'books5', 'instId': 'XRP-BTC'}, 'data': [{'asks': [['0.00002585', '4514.84', '0', '2'], ['0.00002586', '5845.946', '0', '5'], ['0.00002587', '30306.155', '0', '5'], ['0.00002588', '9974.105', '0', '7'], ['0.00002589', '3104.84', '0', '5']], 'bids': [['0.00002582', '3988', '0', '2'], ['0.00002581', '23349.817', '0', '4'], ['0.0000258', '18735.565', '0', '8'], ['0.00002579', '6429.196', '0', '6'], ['0.00002578', '3492.795', '0', '5']], 'instId': 'XRP-BTC', 'ts': '1622805157064'}]} ``` - As such what is printed on console is as follows. The argument here, for example, is "XRP-BTC" again. ``` python XRP-BTC : The most favorable ask price is 0.00023 ``` - Can anyone tell me how I can merge the result of websockets so that they can be printed at the same time? ---------- components: asyncio messages: 395082 nosy: asvetlov, hellojinwoo, yselivanov priority: normal severity: normal status: open title: How to print results of asyncio websockets at the same time? type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 09:43:29 2021 From: report at bugs.python.org (john kim) Date: Fri, 04 Jun 2021 13:43:29 +0000 Subject: [issue44286] venv activate script would be good to show failure. In-Reply-To: <1622642586.2.0.174845262957.issue44286@roundup.psfhosted.org> Message-ID: <1622814209.53.0.753308528135.issue44286@roundup.psfhosted.org> john kim added the comment: Okay. Thank you for the detailed explanation. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 09:51:09 2021 From: report at bugs.python.org (MeneMeneTekel) Date: Fri, 04 Jun 2021 13:51:09 +0000 Subject: [issue43007] set_wakeup_fd() only works in main thread In-Reply-To: <1611398430.41.0.0624041377425.issue43007@roundup.psfhosted.org> Message-ID: <1622814669.15.0.546213083226.issue43007@roundup.psfhosted.org> MeneMeneTekel added the comment: Update: I just tried it again with - Windows 10 Pro, 21H1 - WinPython 3.9.4 - Apache24 - Django 3.2.4 - mod_wsgi-4.8.0-cp39-cp39-win_amd64 Actually, there is no change, it got even worse. i.e. this wake up situation occurs more often. Remember: Changing WinPython 3.9.4 to WinPython 3.7.7 with mod_wsgi-4.7.1-cp37-cp37m-win_amd64 and all works fine! Perhaps it's useful to have a stack trace? Here we are: ****** [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] mod_wsgi (pid=6556): Failed to exec Python script file 'C:/.../.../.../wsgi.py'. [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] mod_wsgi (pid=6556): Exception occurred processing WSGI script 'C:/.../.../.../wsgi.py'. [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] Traceback (most recent call last):\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:/.../.../.../wsgi.py", line 19, in \r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] application = get_wsgi_application()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\core\\wsgi.py", line 13, in get_wsgi_application\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] return WSGIHandler()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line 127, in __init__\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] self.load_middleware()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\core\\handlers\\base.py", line 58, in load_middleware\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] mw_instance = middleware(adapted_handler)\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Users\\mail\\OneDrive\\Dokumente\\Privat\\Python\\Django\\Applications\\groupregister\\middleware\\sessions.py", line 54, in __init__\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] self.user_reg = get_user_model().objects \\\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\db\\models\\query.py", line 399, in aggregate\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] return query.get_aggregation(self.db, kwargs)\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\db\\models\\sql\\query.py", line 502, in get_aggregation\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] result = compiler.execute_sql(SINGLE)\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\db\\models\\sql\\compiler.py", line 1173, in execute_sql\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] cursor = self.connection.cursor()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\site-packages\\django\\utils\\asyncio.py", line 19, in inner\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] event_loop = asyncio.get_event_loop()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\asyncio\\events.py", line 639, in get_event_loop\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] self.set_event_loop(self.new_event_loop())\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\asyncio\\events.py", line 659, in new_event_loop\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] return self._loop_factory()\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\asyncio\\windows_events.py", line 310, in __init__\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] super().__init__(proactor)\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] File "C:\\Winpython\\WPy64-3940\\python-3.9.4.amd64\\lib\\asyncio\\proactor_events.py", line 632, in __init__\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] signal.set_wakeup_fd(self._csock.fileno())\r [Fri Jun 04 15:31:37.428939 2021] [wsgi:error] [pid 6556:tid 1140] [client 111.222.333.444:50819] ValueError: set_wakeup_fd only works in main thread of the main interpreter\r ****** Would be nice to be able to switch zu Python 3.9.4 ff. soon... Many thanks, MeneMeneTekel ---------- versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 09:57:23 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Fri, 04 Jun 2021 13:57:23 +0000 Subject: [issue44311] How to print results of asyncio websockets at the same time? In-Reply-To: <1622812802.67.0.29847846911.issue44311@roundup.psfhosted.org> Message-ID: <1622815043.31.0.220314630067.issue44311@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: This bug tracker is for the Python language and not for asking for help with programming. This bug should be closed. You can go to e.g. stackoverflow.com and ask the question there. ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 10:05:11 2021 From: report at bugs.python.org (Nicholas Willhite) Date: Fri, 04 Jun 2021 14:05:11 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622815511.1.0.782469761872.issue44308@roundup.psfhosted.org> Nicholas Willhite added the comment: Wow, thanks for all the helpful responses! I see how this was a classic PEBKAC issue on my end. Please closed this ticket at your convenience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 10:22:42 2021 From: report at bugs.python.org (Jinwoo PARK NANTIER) Date: Fri, 04 Jun 2021 14:22:42 +0000 Subject: [issue44311] How to print results of asyncio websockets at the same time? In-Reply-To: <1622812802.67.0.29847846911.issue44311@roundup.psfhosted.org> Message-ID: <1622816562.86.0.790020791528.issue44311@roundup.psfhosted.org> Change by Jinwoo PARK NANTIER : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 10:46:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 14:46:56 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622818016.13.0.767316343705.issue44310@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Using a weak dictionary is not a correct solution as the cache must take string ownership of the arguments and return value to do it's job properly. Moreover, there are many types in Python that don't support weak references so this will be a backwards incompatible change and limiting the cache quite a lot. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 10:55:49 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 04 Jun 2021 14:55:49 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622818549.71.0.995157199118.issue44310@roundup.psfhosted.org> Ken Jin added the comment: @Wouter Hmm, I thought most use cases of lru_cache benefit from strong references for predictable hit rates? I'm not an expert in this area, so I nosied-in someone else who is. However, I noticed that the current doc doesn't mention the strong reference behavior anywhere. So I think your suggestion to amend the docs is an improvement, thanks! ---------- nosy: +kj, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 11:16:14 2021 From: report at bugs.python.org (Thomas Jollans) Date: Fri, 04 Jun 2021 15:16:14 +0000 Subject: [issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization In-Reply-To: <1619994815.29.0.724748719135.issue44013@roundup.psfhosted.org> Message-ID: <1622819774.78.0.560277915417.issue44013@roundup.psfhosted.org> Thomas Jollans added the comment: I think I know what's going on here. The way you're using tempfile.TemporaryFile() is, shall we say, unusual. TemporaryFile() already gives you an open file, there's really no reason why you'd call open() again. In practice you'd usually want to write something like with tempfile.TemporaryFile() as f: # do stuff Back to the issue. Your code boils down to: fd = tempfile.TemporaryFile() with open(fd.fileno()) as f: pass fd = tempfile.TemporaryFile() fd.seek(0) You had fd.name rather than fd.fileno(). On *nix, these are the same for a TemporaryFile, which has no name. (On Windows, open(fd.name) fails) What happens? open(fd.fileno()) creates a new file object for the same low-level file descriptor. At the end of the with block, this file is closed. This is fine, but the object returned by TemporaryFile doesn't know this happened. You then call tempfile.TemporaryFile() again, which opens a new file. The OS uses the next available file descriptor, which happens to be the one you just closed. THEN, the old TemporaryFile object gets deleted. It doesn't know you already closed its file, so it calls close(). On the FD that has just been reused. This has nothing to do with reusing the same name, it's just about what order things happen in. This achieves the same effect: tmp1 = tempfile.TemporaryFile() os.close(tmp1.fileno()) tmp2 = tempfile.TemporaryFile() del tmp1 tmp2.seek(0) Deleting the first file object before creating the second one (like in your test_5) solves this problem. I'm not sure why your test_6 works. As for why id(fd.name) was the same for you? It's because fd.name is just fd.fileno() in this case, which is an integer. TL;DR: - having two file objects for the same file descriptor is asking for trouble - I'd say "not a bug" ---------- nosy: +tjollans _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 11:24:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 15:24:25 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622820265.77.0.642690955545.issue38323@roundup.psfhosted.org> STINNER Victor added the comment: This issue is not solved. I can still reproduce the hang using: ./python -m test test_asyncio -m SubprocessMultiLoopWatcherTests -v -F -j20 --timeout=30.0 Example with test_cancel_make_subprocess_transport_exec: $ ./python -m test test_asyncio -m test.test_asyncio.test_subprocess.SubprocessMultiLoopWatcherTests.test_cancel_make_subprocess_transport_exec -v -F -j20 --timeout=30.0 ... 0:00:37 load avg: 10.97 [163] test_asyncio passed -- running: test_asyncio (30.9 sec) test_cancel_make_subprocess_transport_exec (test.test_asyncio.test_subprocess.SubprocessMultiLoopWatcherTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.032s OK 0:00:37 load avg: 10.97 [164] test_asyncio passed -- running: test_asyncio (31.0 sec) test_cancel_make_subprocess_transport_exec (test.test_asyncio.test_subprocess.SubprocessMultiLoopWatcherTests) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.036s OK 0:00:37 load avg: 10.97 [165/1] test_asyncio crashed (Exit code 1) test_cancel_make_subprocess_transport_exec (test.test_asyncio.test_subprocess.SubprocessMultiLoopWatcherTests) ... Timeout (0:00:30)! Thread 0x00007fb583cbd740 (most recent call first): File "/home/vstinner/python/main/Lib/selectors.py", line 469 in select File "/home/vstinner/python/main/Lib/asyncio/base_events.py", line 1845 in _run_once File "/home/vstinner/python/main/Lib/asyncio/base_events.py", line 595 in run_forever File "/home/vstinner/python/main/Lib/asyncio/base_events.py", line 628 in run_until_complete File "/home/vstinner/python/main/Lib/test/test_asyncio/test_subprocess.py", line 442 in test_cancel_make_subprocess_transport_exec ... Test complete in less than 1 second, but sometimes it hangs for at least 30 seconds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 11:27:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 15:27:16 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622820436.27.0.360068999859.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: Pablo: > Extending the bot time was done so we can use faulthandler to identify the test, because buildbot was cancelling the whole build before that :) Right. I increased buildbot timeout to check if buildbots hang because of bpo-38323 or if it's a new regression. bpo-38323 is not fixed yet, I can still easily reproduce the hang on Linux is less than 1 minute: https://bugs.python.org/issue38323#msg395090 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 11:33:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 15:33:04 +0000 Subject: [issue44308] Raw Strings lack parody In-Reply-To: <1622780486.03.0.720343987459.issue44308@roundup.psfhosted.org> Message-ID: <1622820784.74.0.774510668359.issue44308@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. Glad that you found a solution to your issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 11:48:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 04 Jun 2021 15:48:50 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622821730.84.0.646153109726.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: > bpo-38323 is not fixed yet, I can still easily reproduce the hang on Linux is less than 1 minute: https://bugs.python.org/issue38323#msg395090 Yes, with the commands you provided in the https://bugs.python.org/issue38323#msg395090 I also reproduced the crash on my WSL. And any suggestions on the other test failures in the log I attached? I don't know if they are fixed already in the latest commits though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:01:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:01:29 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622822489.57.0.104742991278.issue44112@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Yes, with the commands you provided in the https://bugs.python.org/issue38323#msg395090 I also reproduced the crash on my WSL. And any suggestions on the other test failures in the log I attached? I don't know if they are fixed already in the latest commits though. Your logs don't show this error. This error is test_asyncio hanging, but in your logs the test fails (multiple test do, actually). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:05:11 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Fri, 04 Jun 2021 16:05:11 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622822711.56.0.151476876268.issue44112@roundup.psfhosted.org> Shreyan Avigyan added the comment: > Your logs don't show this error. This error is test_asyncio hanging, but in your logs the test fails (multiple test do, actually). I didn't include this error. I was just asking if we could do anything about the multiple test failures (especially test_asyncio failure). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:07:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:07:44 +0000 Subject: [issue44312] test_asyncio leaked [1533, 1531, 1533] references, sum=4597 Message-ID: <1622822864.09.0.0318219471221.issue44312@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : All refleak buildbots are currently broken in master: ...... test_asyncio leaked [1533, 1531, 1533] references, sum=4597 test_asyncio leaked [367, 366, 367] memory blocks, sum=1100 11 tests failed again: test_asyncgen test_asyncio test_code test_collections test_coroutines test_exceptions test_idle test_import test_inspect test_modulefinder test_types == Tests result: FAILURE then FAILURE == 403 tests OK. 10 slowest tests: - test_signal: 31 min 10 sec - test_pydoc: 29 min 41 sec - test_asyncio: 20 min 3 sec - test_concurrent_futures: 17 min 35 sec - test_peg_generator: 13 min 38 sec - test_gdb: 12 min 20 sec - test_multiprocessing_spawn: 9 min 33 sec - test_multiprocessing_forkserver: 6 min 49 sec - test_nntplib: 6 min 20 sec - test_multiprocessing_fork: 5 min 41 sec 11 tests failed: test_asyncgen test_asyncio test_code test_collections test_coroutines test_exceptions test_idle test_import test_inspect test_modulefinder test_types 13 tests skipped: test_devpoll test_ioctl test_kqueue test_msilib test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg test_winsound test_zipfile64 11 re-run tests: test_asyncgen test_asyncio test_code test_collections test_coroutines test_exceptions test_idle test_import test_inspect test_modulefinder test_types Example failure: https://buildbot.python.org/all/#/builders/384/builds/50/steps/5/logs/stdio ---------- messages: 395096 nosy: pablogsal, vstinner priority: normal severity: normal status: open title: test_asyncio leaked [1533, 1531, 1533] references, sum=4597 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:11:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:11:16 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622823076.21.0.538824620662.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f has broken all the refleak buildbots. Example failure: BISECTION: c1e2583fdc4db6b43d163239ea42b0e8394171f is the first bad commit commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f Author: Eric Snow Date: Thu Jun 3 10:28:27 2021 -0600 bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388) https://buildbot.python.org/all/#/builders/384/builds/50/steps/5/logs/stdio As this is affecting all test, I am proceeding with a revert of commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f directly to not mask other issues. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:12:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:12:54 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622823174.87.0.842270492224.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Please, in the future, check with the buildbots before merging these kinds of big PRs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:33:18 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 04 Jun 2021 16:33:18 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports Message-ID: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> New submission from Batuhan Taskaya : import foo def func(): return foo.bar() The snippet above will generate the following code; 2 0 LOAD_GLOBAL 0 (foo) 2 LOAD_METHOD 1 (bar) 4 CALL_METHOD 0 6 RETURN_VALUE Though this will make things harder for specializing the LOAD_ATTR for modules since now the handling of LOAD_METHOD for that case is necessary so for the imports that we can infer during the symbol analysis pass, we'll generate LOAD_ATTR+CALL_ATTR instead of LOAD_METHOD+CALL_METHOD and hopefully the generated code will get specialized via the PEP 659. Ref: https://github.com/faster-cpython/ideas/issues/55#issuecomment-853101039 ---------- assignee: BTaskaya components: Interpreter Core messages: 395099 nosy: BTaskaya, Mark.Shannon priority: normal severity: normal status: open title: Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:32:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:32:28 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622824348.46.0.183535473526.issue43693@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25123 pull_request: https://github.com/python/cpython/pull/26530 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:34:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:34:17 +0000 Subject: [issue44312] test_asyncio leaked [1533, 1531, 1533] references, sum=4597 In-Reply-To: <1622822864.09.0.0318219471221.issue44312@roundup.psfhosted.org> Message-ID: <1622824457.18.0.474797278331.issue44312@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is caused by: https://bugs.python.org/issue43693 ---------- nosy: +Mark.Shannon, eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:36:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:36:45 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622824605.87.0.327305881703.issue44112@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I was just asking if we could do anything about the multiple test failures (especially test_asyncio failure). We don't see any failures as the ones in your logs in the buildbots or otherwise, so seems something wrong in your system or only affecting your system. > I didn't include this error. Sorry Shreyan, but unfortunately I find your messages very confusing. You seem to be mixing several different problems and your logs don't seem to be directly related to the issue at hand. Please, in the future, add some context to your messages if possible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:39:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:39:22 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622824762.9.0.103929507713.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR reverts commits 2c1e2583fdc4db6b43d163239ea42b0e8394171f and b2bf2bc1ece673d387341e06c8d3c2bc6e259747. Please, commit them back once the refleaks are resolved. I took a quick look and seems that there are several issues but there are more I could find. Some of the issues seem to be related to commit 2c1e2583fdc4db6b43d163239ea42b0e8394171f calling _PyCode_GetVarnames and _PyCode_GetFreevars without decrementing the reference after use but there are more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:40:59 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 04 Jun 2021 16:40:59 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports In-Reply-To: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> Message-ID: <1622824859.38.0.447837100417.issue44313@roundup.psfhosted.org> Batuhan Taskaya added the comment: @mark.shannon what do you think about doing this both for `import ` and `from import `. It will definitely simplify the implementation (no need to extra visitors or flags, just using the default DEF_IMPORT one https://github.com/isidentical/cpython/commit/f8f8fcee4d1480970c356eec0f23c326b9fe674d) and also might help you to specialize other cases too (e.g importing submodules, from concurrent import futures). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:48:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:48:03 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1622825283.98.0.815715243472.issue44048@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a46c220edc5cf716d0b71eb80ac29ecdb4ebb430 by stratakis in branch 'main': bpo-44048: Fix two hashlib test cases under FIPS mode (GH-26470) https://github.com/python/cpython/commit/a46c220edc5cf716d0b71eb80ac29ecdb4ebb430 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:48:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:48:20 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1622825300.71.0.325660418057.issue44048@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:48:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 16:48:52 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1622825332.92.0.19681771965.issue44048@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25124 pull_request: https://github.com/python/cpython/pull/26531 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 12:51:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 16:51:09 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622825469.98.0.947449571165.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 17c4edc4e0692fe55e185755ea8a2f5238f3ef08 by Pablo Galindo in branch 'main': bpo-43693: Revert commits 2c1e2583fdc4db6b43d163239ea42b0e8394171f and b2bf2bc1ece673d387341e06c8d3c2bc6e259747 (GH-26530) https://github.com/python/cpython/commit/17c4edc4e0692fe55e185755ea8a2f5238f3ef08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 13:36:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 17:36:16 +0000 Subject: [issue44041] [sqlite3] check that column count is updated correctly for cached statements In-Reply-To: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> Message-ID: <1622828176.82.0.697747822421.issue44041@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8363ac8607eca7398e568e1336154e1262a995a0 by Erlend Egeberg Aasland in branch 'main': bpo-44041: Add test for sqlite3 column count (GH-25907) https://github.com/python/cpython/commit/8363ac8607eca7398e568e1336154e1262a995a0 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 13:36:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 17:36:18 +0000 Subject: [issue44041] [sqlite3] check that column count is updated correctly for cached statements In-Reply-To: <1620167614.6.0.723645950757.issue44041@roundup.psfhosted.org> Message-ID: <1622828178.63.0.182033522073.issue44041@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:13:41 2021 From: report at bugs.python.org (Thomas Jollans) Date: Fri, 04 Jun 2021 18:13:41 +0000 Subject: [issue43740] Long paths in imp.load_dynamic() lead to segfault In-Reply-To: <1617693067.85.0.367644803477.issue43740@roundup.psfhosted.org> Message-ID: <1622830421.14.0.729514664287.issue43740@roundup.psfhosted.org> Thomas Jollans added the comment: I cannot reproduce this on my OpenSUSE (glibc 2.33, Linux 5.12.4) or Ubuntu 20.04 (glibc 2.31, Linux 5.4.0) machines, but I can reproduce it on an old Debian Stretch VM I happened to have lying around (glibc 2.24, Linux 4.9.0). (FreeBSD 12.2 and Windows 10 also fine.) This doesn't look like a bug in Python, but like a bug in glibc (and Apple's libc?) (or Linux?) that is fixed in current versions. This C program produces the same result - segfault on old Linux, error message on new Linux. #include #include #include #include static const char *FRAGMENT = "abs/"; #define REPEATS 10000000 int main() { size_t fragment_len = strlen(FRAGMENT); size_t len = fragment_len * REPEATS; char *name = malloc(len + 1); name[len] = '\0'; for (char *p = name; p < name + len; p += fragment_len) { memcpy(p, FRAGMENT, fragment_len); } void *handle = dlopen(name, RTLD_LAZY); if (handle == NULL) { printf("Failed:\n%s\n", dlerror()); free(name); return 1; } else { printf("Success."); dlclose(handle); free(name); return 0; } } ---------- nosy: +tjollans _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:21:57 2021 From: report at bugs.python.org (Chris Mayo) Date: Fri, 04 Jun 2021 18:21:57 +0000 Subject: [issue44314] [doc] SSLContext.set_ciphers() link to OpenSSL cipher list format is outdated Message-ID: <1622830917.65.0.837599008306.issue44314@roundup.psfhosted.org> New submission from Chris Mayo : Current link is: https://www.openssl.org/docs/manmaster/man1/ciphers.html Manual page entries without the 'openssl-' prefix have been deprecated, and this link is now directed to a generic page for openssl cmd. Suggest an update to: https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html#CIPHER-LIST-FORMAT Currently at: https://github.com/python/cpython/blame/main/Doc/library/ssl.rst#L1680 ---------- assignee: docs at python components: Documentation messages: 395108 nosy: cjmayo, docs at python priority: normal severity: normal status: open title: [doc] SSLContext.set_ciphers() link to OpenSSL cipher list format is outdated versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:34:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 18:34:07 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1622831647.49.0.490610693798.issue43853@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 006fd869e4798b68e266f5de89c83ddb531a756b by Erlend Egeberg Aasland in branch 'main': bpo-43853: Handle sqlite3_value_text() errors (GH-25422) https://github.com/python/cpython/commit/006fd869e4798b68e266f5de89c83ddb531a756b ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:34:27 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 18:34:27 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1622831667.58.0.890397391244.issue43853@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25125 pull_request: https://github.com/python/cpython/pull/26534 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:38:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 18:38:09 +0000 Subject: [issue44048] test_hashlib failure for "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash" buildbot In-Reply-To: <1620212963.3.0.83252428059.issue44048@roundup.psfhosted.org> Message-ID: <1622831889.88.0.280887333831.issue44048@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3f4d801bf907a5fcab50f3b64475d1410b90a80f by Miss Islington (bot) in branch '3.10': bpo-44048: Fix two hashlib test cases under FIPS mode (GH-26470) (GH-26531) https://github.com/python/cpython/commit/3f4d801bf907a5fcab50f3b64475d1410b90a80f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:39:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 18:39:12 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1622831952.39.0.304151305565.issue43853@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:47:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 18:47:29 +0000 Subject: [issue44266] AttributeError: module 'sys' has no attribute 'original_stdout' In-Reply-To: <1622333919.37.0.77785339426.issue44266@roundup.psfhosted.org> Message-ID: <1622832449.33.0.538169252308.issue44266@roundup.psfhosted.org> Terry J. Reedy added the comment: If you intend to import the stdlib sys and succeed, the original stdout is called '__stdout__'. See https://docs.python.org/3/library/sys.html#sys.__stdin__, including the note that it may be None on Windows. Also peruse that doc to see what attributes sys *does* have. When you have questions about using python, please post first to python-list or other question-answering forums. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:54:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 18:54:57 +0000 Subject: [issue43853] [sqlite3] Improve sqlite3_value_text() error handling In-Reply-To: <1618480809.83.0.17163581819.issue43853@roundup.psfhosted.org> Message-ID: <1622832897.43.0.248328620153.issue43853@roundup.psfhosted.org> miss-islington added the comment: New changeset 067d6d46575b5cf30bbf7c812defee1517106a34 by Miss Islington (bot) in branch '3.10': bpo-43853: Handle sqlite3_value_text() errors (GH-25422) https://github.com/python/cpython/commit/067d6d46575b5cf30bbf7c812defee1517106a34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 14:59:24 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 04 Jun 2021 18:59:24 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622833164.34.0.271179802974.issue38323@roundup.psfhosted.org> Chris Jerdonek added the comment: > This issue is not solved. Yes, nothing was changed. After diagnosing this issue and trying some things out in a draft PR, my conclusion is that an asyncio maintainer really needs to weigh in on what to do (especially Andrew who authored the class). The reason is that the hang is closely tied to MultiLoopChildWatcher's documented purpose. The only way I could see to fix MultiLoopChildWatcher would change its documented behavior and make it the same as SafeChildWatcher, which would defeat the purpose of having a separate class: https://github.com/python/cpython/pull/20142#issuecomment-712417912 Maybe there is a way to sidestep the hangs in the tests without fixing MultiLoopChildWatcher, but I didn't look into that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:27:01 2021 From: report at bugs.python.org (Ruairidh MacLeod) Date: Fri, 04 Jun 2021 19:27:01 +0000 Subject: [issue44307] date.today() is 2x slower than datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622834821.47.0.235571280708.issue44307@roundup.psfhosted.org> Change by Ruairidh MacLeod : ---------- nosy: +rkm _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:33:43 2021 From: report at bugs.python.org (Barney Gale) Date: Fri, 04 Jun 2021 19:33:43 +0000 Subject: [issue29249] Pathlib glob ** bug In-Reply-To: <1484216394.04.0.57434547579.issue29249@psf.upfronthosting.co.za> Message-ID: <1622835223.92.0.309053664324.issue29249@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:41:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 19:41:45 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622835705.52.0.0737583927335.issue44275@roundup.psfhosted.org> Terry J. Reedy added the comment: Jesse or Andre, please test interactive help in IDLE as pydoc then knows that it is *not* talking to Windows console. It then does not use more.com but prints the entire text at once. It should send it 'as is' and should ignore the console language and encoding settings. Use a Start menu icon or > pyw -m idlelib 'py' works too. It blocks, but displays the occasional tk/tkinter/IDLE error message as sys.__stderr__, etc, are the console stream instead of None. Long output such as the 240 lines for COMPARISON is, by default, 'squeezed' to a little box. Double click to expand or right click to move it to a separate window. If there is still a problem with garbage in the text, we should try to fix it. PS: one can select more than one Component, but Documentation usually refers to the content, not the means of displaying it. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:42:17 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 04 Jun 2021 19:42:17 +0000 Subject: [issue29249] Pathlib glob ** bug In-Reply-To: <1484216394.04.0.57434547579.issue29249@psf.upfronthosting.co.za> Message-ID: <1622835737.69.0.272171516694.issue29249@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:54:32 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 04 Jun 2021 19:54:32 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622836472.85.0.772364084301.issue44275@roundup.psfhosted.org> Andre Roberge added the comment: Terry: I just checked with Idle on Windows with Python 3.9.5 and the display works perfectly, with no incorrect characters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:55:33 2021 From: report at bugs.python.org (Paul Ganssle) Date: Fri, 04 Jun 2021 19:55:33 +0000 Subject: [issue44307] date.today() is 2x slower than datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622836533.53.0.011664803928.issue44307@roundup.psfhosted.org> Paul Ganssle added the comment: Yeah, I knew this was slower and it's been on my long list to look at it (tied to this is the fact that `datetime.today()` is basically just a slow version of `datetime.now()`, in defiance of user expectations). My inclination is that we shouldn't re-implement `fromtimestamp` in `date.today`, but rather call `date_fromtimestamp` in the fast path. I believe that incurs the overhead of creating one additional Python object (an integer), but if it's a sufficiently significant speedup, we could possibly refactor `date_fromtimestamp` to a version that accepts a C integer and a version that accepts a Python integer, then call the version accepting a C integer. I think this won't give any speedup to `datetime.today`, since `datetime.today` will still take the slow path. If we care about this, we *may* be able to implement `datetime.today` as an alias for `datetime.now(None)`, assuming there are no behavioral differences between the two. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 15:58:08 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 19:58:08 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1622836688.36.0.265225313078.issue42213@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:14:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 20:14:46 +0000 Subject: [issue44315] [sqlite3] remove unused connection argument from pysqlite_step() Message-ID: <1622837686.69.0.940426818255.issue44315@roundup.psfhosted.org> New submission from Erlend E. Aasland : The code that used the connection argument was removed one year before pysqlite was included in CPython, as far as I can see. It can safely be removed. See also: https://github.com/ghaering/pysqlite/commit/5a009ed6fb2e90b952438f5786f93cd1e8ac8722 ---------- assignee: erlendaasland components: Extension Modules messages: 395117 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] remove unused connection argument from pysqlite_step() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:16:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 20:16:26 +0000 Subject: [issue44315] [sqlite3] remove unused connection argument from pysqlite_step() In-Reply-To: <1622837686.69.0.940426818255.issue44315@roundup.psfhosted.org> Message-ID: <1622837785.99.0.994508073843.issue44315@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25126 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26535 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:42:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 20:42:29 +0000 Subject: [issue44315] [sqlite3] remove unused connection argument from pysqlite_step() In-Reply-To: <1622837686.69.0.940426818255.issue44315@roundup.psfhosted.org> Message-ID: <1622839349.17.0.433544416808.issue44315@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7459208de194db6222d7e3aa301c2b831dbe566d by Erlend Egeberg Aasland in branch 'main': bpo-44315: Remove unused connection argument from pysqlite_step() (GH-26535) https://github.com/python/cpython/commit/7459208de194db6222d7e3aa301c2b831dbe566d ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:42:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 20:42:38 +0000 Subject: [issue44315] [sqlite3] remove unused connection argument from pysqlite_step() In-Reply-To: <1622837686.69.0.940426818255.issue44315@roundup.psfhosted.org> Message-ID: <1622839358.4.0.692327983677.issue44315@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:49:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 20:49:20 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622839760.28.0.197425393431.issue38323@roundup.psfhosted.org> STINNER Victor added the comment: When I reproduce test_cancel_make_subprocess_transport_exec() hang, the problem is that the C signal handler is called with SIGCHLD when the child process completes, but the Python signal handler is not called. Python is "blocked" in a selector (maybe select.select(), it doesn't matter). I guess that the selector is interrupted by a signal (even if asyncio calls signal.setinterrupt(SIGCHLD, False)), but since the signal handler doesn't raise an exception, the syscall is restarted: see the PEP 475. I understood that the asyncio event loop only gets the opportunity to call the Python signal handler if there is a pending asyncio event (call_soon, call_timer, event on a tracked FD, whatever). If the signal arrives when the event loop is idle, the Python signal handler will never be called since the selector is called with timeout=0 (blocking mode). MultiLoopChildWatcher must ensures that the event loop is awaken when it receives a signal by using signal.setwakeup(). This is done by _UnixSelectorEventLoop.add_signal_handler(). Maybe MultiLoopChildWatcher could reuse this function, rather than calling directly signal.signal(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 16:54:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 20:54:54 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622840094.41.0.912189458816.issue44276@roundup.psfhosted.org> Terry J. Reedy added the comment: To me, Raymond's flattening is a plausible replacement, especially ater a future speedup. However, I would re-order the patterns to None, False, True, str(), int(), ..., _. These independent conditions, other than _ (or else in the if chain), can be ordered for best reading and comprehension speed, and I think the above is an improvement. Ordering for execution speed would instead start with the most frequently true conditions. An advantage of match over 'if' is that patterns are apparently easier to re-order or otherwise automatically optimize. I agree that replacement should only be done when there is significant improvement in reading and/or execution speed. To avoid backport issues, they should best be preceded by a check for bug reports and especially PRs that will or do affect the same area of code. The proposal for a general, +- global replacement has been and will be rejected. I think that this issue should therefore be closed, fairly soon, as such. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:00:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 21:00:18 +0000 Subject: [issue44301] Is there a way to provide destructor for module written using C API? In-Reply-To: <1622736809.26.0.65904835791.issue44301@roundup.psfhosted.org> Message-ID: <1622840418.38.0.744279942942.issue44301@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:13:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 21:13:13 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622841193.33.0.671442591957.issue44304@roundup.psfhosted.org> Terry J. Reedy added the comment: Coredevs are likely to assume that the problem is in greenlets, especially if it has any C code (I don't know). I suggest you first try to find the commit between releases that resulted in the problem. If it is not deterministicly reproducible, you likely need to do a manual binary search. (This is as much as I know.) If you get an OS 'traceback' longer than a dozen line or so, please attach it as a file rather than pasting in a message. ---------- nosy: +terry.reedy type: -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:14:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 21:14:57 +0000 Subject: [issue44307] date.today() is half as fast as datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622841297.88.0.179692858287.issue44307@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: date.today() is 2x slower than datetime.now().date() -> date.today() is half as fast as datetime.now().date() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:16:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 21:16:55 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1622841415.54.0.713740321205.issue44309@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +jafo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:19:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 21:19:57 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622841597.95.0.231530609289.issue44310@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:21:19 2021 From: report at bugs.python.org (Barney Gale) Date: Fri, 04 Jun 2021 21:21:19 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() Message-ID: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> New submission from Barney Gale : >>> os.path.normpath('a/./b/../c//.') 'a/c' >>> pathlib.Path('a/./b/../c//.') PosixPath('a/b/../c') pathlib takes care not to change the meaning of the path when normalising. That means preserving '..' entries, as these can't be simplified without resolving symlinks etc. normpath(), on the other handle, /always/ eliminates '..' entries, which can change the meaning of the path. We could add a new argument to `normpath()` and `abspath()` that leaves '..' entries intact. This was closed as "won't fix" back in bpo-2289, but I think it's worth re-considering. This enhancement would be helpful for my longer-term work to make pathlib an OOP wrapper of os + os.path, rather than a parallel implementation. ---------- components: Library (Lib) messages: 395122 nosy: barneygale priority: normal severity: normal status: open title: Support preserving path meaning in os.path.normpath() and abspath() type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:21:53 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 04 Jun 2021 21:21:53 +0000 Subject: [issue44307] date.today() is half as fast as datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622841713.45.0.458686043547.issue44307@roundup.psfhosted.org> Anthony Sottile added the comment: @terry.reddy -- I believe your title change makes this more difficult to understand ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:22:03 2021 From: report at bugs.python.org (Anthony Sottile) Date: Fri, 04 Jun 2021 21:22:03 +0000 Subject: [issue44307] date.today() is half as fast as datetime.now().date() In-Reply-To: <1622771434.0.0.798564808537.issue44307@roundup.psfhosted.org> Message-ID: <1622841723.87.0.291249636179.issue44307@roundup.psfhosted.org> Anthony Sottile added the comment: *terry.reedy oops typo! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:27:57 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 04 Jun 2021 21:27:57 +0000 Subject: [issue44310] lru_cache memory leak In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622842077.31.0.809682119141.issue44310@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:31:51 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 04 Jun 2021 21:31:51 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622842311.82.0.216650197152.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: Also note that many important objects in Python are not weak referenceable, tuples for example. ---------- title: lru_cache memory leak -> Document that lru_cache uses hard references _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:43:50 2021 From: report at bugs.python.org (Chris Jerdonek) Date: Fri, 04 Jun 2021 21:43:50 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622843030.3.0.407601589819.issue38323@roundup.psfhosted.org> Chris Jerdonek added the comment: > MultiLoopChildWatcher must ensures that the event loop is awaken when it receives a signal by using signal.setwakeup(). This is done by _UnixSelectorEventLoop.add_signal_handler(). Maybe MultiLoopChildWatcher could reuse this function, This is the conclusion I came to, too. But changing MultiLoopChildWatcher to use loop.add_signal_handler() would contradict the class's documented purpose and make it the same as SafeChildWatcher. This is why I think a maintainer needs to weigh in. The class's purpose / design might fundamentally not be workable. If it can't be made to work, maybe it should be removed or be documented as susceptible to hangs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:45:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 21:45:29 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622843129.97.0.32047970362.issue38323@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25127 pull_request: https://github.com/python/cpython/pull/26536 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:54:58 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 04 Jun 2021 21:54:58 +0000 Subject: [issue42349] Compiler front-end produces a broken CFG In-Reply-To: <1605288236.63.0.535930114151.issue42349@roundup.psfhosted.org> Message-ID: <1622843698.21.0.877748782229.issue42349@roundup.psfhosted.org> Dennis Sweeney added the comment: >From https://devguide.python.org/compiler/#source-code-to-ast: > Basic blocks themselves are a block of IR that has a single entry point but possibly multiple exit points. In particular, compile.c's label_exception_targets has the assertion (`assert(i == b->b_iused -1);`) that jumps only occur as the last instruction of a block. Does the devguide need updating, or do I have a misunderstanding? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 17:58:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 21:58:59 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1622843939.11.0.615641911573.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25128 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26537 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:07:17 2021 From: report at bugs.python.org (mike bayer) Date: Fri, 04 Jun 2021 22:07:17 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622844437.73.0.036901069234.issue44304@roundup.psfhosted.org> mike bayer added the comment: yes, if I have time I will begin to undertake that, wanted to put it up here in case anyone has git bisect on speed dial for cpython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:08:07 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 22:08:07 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844487.57.0.376217975297.issue44279@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25129 pull_request: https://github.com/python/cpython/pull/26538 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:08:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 04 Jun 2021 22:08:04 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844484.61.0.759263947359.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset dda9ecbfece28aad7b8ba7eaf7951dd9816f78b1 by Irit Katriel in branch 'main': bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) https://github.com/python/cpython/commit/dda9ecbfece28aad7b8ba7eaf7951dd9816f78b1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:08:13 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 22:08:13 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844493.55.0.874509972376.issue44279@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25130 pull_request: https://github.com/python/cpython/pull/26539 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:09:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 04 Jun 2021 22:09:29 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622844569.44.0.667003015074.issue44304@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:09:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 04 Jun 2021 22:09:49 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844589.19.0.722569145173.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset ea298e1e33eb03b2b4ea2f4556e59b11e3bf240f by Miss Islington (bot) in branch '3.9': bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26539) https://github.com/python/cpython/commit/ea298e1e33eb03b2b4ea2f4556e59b11e3bf240f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:10:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 04 Jun 2021 22:10:11 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844611.36.0.205988684788.issue44279@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1065ba66b535b786d6dc5f7d912c6486d9a834ae by Miss Islington (bot) in branch '3.10': bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26538) https://github.com/python/cpython/commit/1065ba66b535b786d6dc5f7d912c6486d9a834ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:10:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 04 Jun 2021 22:10:57 +0000 Subject: [issue44279] doc: contextlib.suppress documentation is imprecise In-Reply-To: <1622570551.2.0.610733137318.issue44279@roundup.psfhosted.org> Message-ID: <1622844657.01.0.94294928456.issue44279@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:26:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 04 Jun 2021 22:26:15 +0000 Subject: [issue44265] Create an MSI Package In-Reply-To: <1622325187.57.0.0411972707678.issue44265@roundup.psfhosted.org> Message-ID: <1622845575.01.0.938657342109.issue44265@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:27:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 22:27:52 +0000 Subject: [issue44312] test_asyncio leaked [1533, 1531, 1533] references, sum=4597 In-Reply-To: <1622822864.09.0.0318219471221.issue44312@roundup.psfhosted.org> Message-ID: <1622845672.45.0.746523535775.issue44312@roundup.psfhosted.org> STINNER Victor added the comment: > This is caused by: https://bugs.python.org/issue43693 You reverted the change: https://bugs.python.org/issue43693#msg395105 Can this issue be closed in this case? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:32:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:32:46 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622845966.4.0.496640571741.issue38323@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 8.0 -> 9.0 pull_requests: +25131 pull_request: https://github.com/python/cpython/pull/26541 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:37:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:37:16 +0000 Subject: [issue44312] test_asyncio leaked [1533, 1531, 1533] references, sum=4597 In-Reply-To: <1622822864.09.0.0318219471221.issue44312@roundup.psfhosted.org> Message-ID: <1622846236.66.0.485484927483.issue44312@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yep ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:47:59 2021 From: report at bugs.python.org (Thomas Caswell) Date: Fri, 04 Jun 2021 22:47:59 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622846879.42.0.790312673431.issue44242@roundup.psfhosted.org> Thomas Caswell added the comment: This change also affects PyQt6: Python 3.10.0b2+ (heads/3.10:d0991e2db3, Jun 1 2021, 11:42:08) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import PyQt6.QtCore >>> PyQt6.QtCore.PYQT_VERSION_STR '6.1.1.dev2105301600' >>> PyQt6.QtCore.Qt.Key Traceback (most recent call last): File "", line 1, in File "/home/tcaswell/.pybuild/bleeding/lib/python3.10/enum.py", line 615, in __call__ return cls._create_( File "/home/tcaswell/.pybuild/bleeding/lib/python3.10/enum.py", line 762, in _create_ return metacls.__new__(metacls, class_name, bases, classdict, boundary=boundary) File "/home/tcaswell/.pybuild/bleeding/lib/python3.10/enum.py", line 544, in __new__ raise TypeError( TypeError: invalid Flag 'DropAction' -- missing values: 8, 16, 32, 64, 128, 32768 >>> > remove the creation time check (which will remove the error for the OP), and then add a decorator to the enum module that does that creation time check I am very supportive of this plan! Could this be labeled as a higher priority / release blocker? ---------- nosy: +tcaswell _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:49:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:49:17 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622846957.29.0.800002252685.issue38323@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25132 pull_request: https://github.com/python/cpython/pull/26542 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:52:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 04 Jun 2021 22:52:58 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1622847178.39.0.213626596919.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: I bet that this issue is simply a duplicate of bpo-38323, since I can still (easily) reproduce it locally. I fixed the buildbot configuration, so if the bug happens again on Refleak buildbots, at least we should know which test method hangs. If it's not bpo-38323, I suggest to open a new more specific issue about this test method. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:56:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:56:50 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1622847410.76.0.797319528904.issue44242@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Raising this to a release blocker for 3.10.0 beta 3 as it breaks PyQt6 and other projects. ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:57:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:57:19 +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: <1622847439.47.0.663842149214.issue43908@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: deferred blocker -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 18:57:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 22:57:44 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1622847464.52.0.0933362829622.issue42972@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:07:04 2021 From: report at bugs.python.org (Eric Snow) Date: Fri, 04 Jun 2021 23:07:04 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1622848024.19.0.172650318343.issue43693@roundup.psfhosted.org> Eric Snow added the comment: Thanks Pablo. I'll get this sorted out. Sorry for the pain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:14:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 23:14:37 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622848477.47.0.94840813266.issue38323@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm landing https://github.com/python/cpython/pull/26542 as a temporary solution meanwhile we decide what to do with PR 26536. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:33:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 04 Jun 2021 23:33:28 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622849608.5.0.503003625419.issue38323@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f171877ebe276749f31386baed5841ce37cbee2e by Pablo Galindo in branch 'main': bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) https://github.com/python/cpython/commit/f171877ebe276749f31386baed5841ce37cbee2e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:33:31 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 23:33:31 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622849611.86.0.791524270945.issue38323@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25133 pull_request: https://github.com/python/cpython/pull/26543 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:33:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 04 Jun 2021 23:33:57 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622849637.24.0.78215703274.issue38323@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25134 pull_request: https://github.com/python/cpython/pull/26544 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:38:26 2021 From: report at bugs.python.org (Jesse Silverman) Date: Fri, 04 Jun 2021 23:38:26 +0000 Subject: [issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows? In-Reply-To: <1622479681.25.0.222834045031.issue44275@roundup.psfhosted.org> Message-ID: <1622849906.03.0.193127210913.issue44275@roundup.psfhosted.org> Jesse Silverman added the comment: As Andre noted, it is good in IDLE. I also realize how convenient it is to read the real docs from there. I learned a lot about the state of console programming on Windows, in and out of Python, but I have no problem using IDLE when on Windows. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 19:39:51 2021 From: report at bugs.python.org (Harry) Date: Fri, 04 Jun 2021 23:39:51 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1622849991.62.0.0868656771962.issue44186@roundup.psfhosted.org> Harry added the comment: This bug seems to come from the fact that the file rollover occurs it removes any files with same name as the destination file. I believe this bug occurs on all "when" options, but the midnight option truncates the filename so only the date so it's much more likely to be a collision in filename so it's much easier to notice that it's happening. One way of fixing this is to check if the destination file already exists, and if it does, append the logs to the end of the file instead of overwriting it. Another potential fix is to check if the destination file already exists, and if it does rename it to something else, or even to choose a different name for the destination file of the log e.g. if the filename would be log.2021-05-05 but there is a collision, call the file log.2021-05-05(1). Personally I prefer the last option, it seems like the best way to avoid any future issues that could arise from appending. I can open a PR for this in the morning. ---------- nosy: +Harry-Lees _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:00:03 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 05 Jun 2021 00:00:03 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622851203.08.0.525975822529.issue38323@roundup.psfhosted.org> miss-islington added the comment: New changeset b3c50b29e14d8f089aee3e0980298bfc74cb3ba7 by Miss Islington (bot) in branch '3.9': bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) https://github.com/python/cpython/commit/b3c50b29e14d8f089aee3e0980298bfc74cb3ba7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:06:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 00:06:02 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622851562.87.0.209412854252.issue38323@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0d441d2e70e365b5dc517d8ff24a20b97bc4536a by Miss Islington (bot) in branch '3.10': bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) (GH-26544) https://github.com/python/cpython/commit/0d441d2e70e365b5dc517d8ff24a20b97bc4536a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:06:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Jun 2021 00:06:37 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622851597.82.0.205006595097.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm thinking of a more minimal and targeted edit than what is in the PR. Per the dev guide, we usually word the docs in an affirmative and specific manner (here is what the tool does and an example of how to use it). Recounting a specific debugging case or misassumption usually isn't worthwhile unless it is a common misconception. For strong versus weak references, we've had no previous reports even though the lru_cache() has been around for a long time. Likely, that is because the standard library uses strong references everywhere unless specifically documented to the contrary. Otherwise, we would have to add a strong reference note to everything stateful object in the language. Another reason that it likely hasn't mattered to other users is that an lru cache automatically purges old entries. If an object is not longer used, it cycles out as new items are added to the cache. Arguably, a key feature of an LRU algorithm is that you don't have to think about the lifetime of objects. I'll think it a for a while and will propose an alternate edit that focuses on how the cache works with methods. The essential point is that the instance is included in the cache key (which is usually what people want). Discussing weak vs strong references is likely just a distractor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:51:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 00:51:59 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622854319.83.0.737794903996.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I did the bisection: ff359d735f1a60878975d1c5751bfd2361e84067 is the first bad commit commit ff359d735f1a60878975d1c5751bfd2361e84067 Author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> Date: Mon May 31 02:12:27 2021 -0700 bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452) (GH-26461) (cherry picked from commit d1124b09e8251061dc040cbd396f35ae57783f4a) Co-authored-by: Erlend Egeberg Aasland :040000 040000 701f24eacbdf2b52b612dc33ae9a7dcf24a73826 100af9271a7e7c038a860388587b1cb096b8494f M Modules bisect run success ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:52:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 00:52:24 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622854344.11.0.838941050838.issue44304@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 20:56:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 00:56:18 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622854578.93.0.134729572748.issue44304@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 21:35:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 01:35:47 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622856947.85.0.754098677364.issue44304@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25135 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26545 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 21:36:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 01:36:39 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622856999.29.0.79364188631.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem is that this is wrong: https://github.com/python/cpython/blob/f171877ebe276749f31386baed5841ce37cbee2e/Modules/_sqlite/statement.c#L411-L423 1) tp_clear should *not* do anything other than cleaning refs to python objects 2) sqlite3_finalize is called without the GIL but that can trigger a call to the destructor of the session (_destructor()) that executes Python code ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 21:39:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 01:39:23 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622857163.11.0.132990791703.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Using the reproducer code by Mike, without this fix: ? ./python ../lel.py [1] 25344 segmentation fault ./python ../lel.py With this fix: ? ./python ../problem.py ? echo $? 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 22:09:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 02:09:13 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622858953.83.0.763463824345.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is a simpler reproducer: dest = sqlite.connect(':memory:') def md5sum(t): return dest.create_function("md5", 1, md5sum) x = dest("create table lang (name, first_appeared)") del md5sum, dest y = [x] y.append(y) del x,y gc.collect() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 22:13:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 02:13:28 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622859208.87.0.38593745402.issue44310@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Agreed! I will let the PR to you :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 22:50:47 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 05 Jun 2021 02:50:47 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622861447.92.0.899506480776.issue44304@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25136 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26547 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 22:50:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 02:50:46 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622861446.46.0.275790184385.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fa106a685c1f199aca5be5c2d0277a14cc9057bd by Pablo Galindo in branch 'main': bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement objects (GH-26545) https://github.com/python/cpython/commit/fa106a685c1f199aca5be5c2d0277a14cc9057bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 23:09:47 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 05 Jun 2021 03:09:47 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622862587.81.0.577350095947.issue44304@roundup.psfhosted.org> miss-islington added the comment: New changeset ad2f3b74b5615aa36a82d1fdbc45bb7468aa1d72 by Miss Islington (bot) in branch '3.10': bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement objects (GH-26545) https://github.com/python/cpython/commit/ad2f3b74b5615aa36a82d1fdbc45bb7468aa1d72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 4 23:24:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 03:24:53 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622863493.97.0.569528241158.issue44304@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 00:34:04 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 05 Jun 2021 04:34:04 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622867644.83.0.259532600974.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: It may useful to link back to @cached_property() for folks wanting method caching tied to the lifespan of an instance rather than actual LRU logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 01:07:28 2021 From: report at bugs.python.org (Kshitiz Arya) Date: Sat, 05 Jun 2021 05:07:28 +0000 Subject: [issue44276] Replace if-elif-else structure with match-case (PEP634) In-Reply-To: <1622524127.91.0.692072896945.issue44276@roundup.psfhosted.org> Message-ID: <1622869648.54.0.239361205625.issue44276@roundup.psfhosted.org> Kshitiz Arya added the comment: As Brandt shows us, match-case in its current implementation is not significantly different from an if-else ladder in term of performance, though I still maintain that match-case is much more readable than an if-else ladder. I also agree with Karthikeyan and Terry that global replacement is not a good idea, at least not without a significant performance improvement. Therefore I will close this issue. Currently, some people at issue 44283 are working on improving the performance of match-case so fingers are crossed. If there is some significant gain in performance then I will open new issues on case to case basis. ---------- resolution: -> postponed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 01:46:14 2021 From: report at bugs.python.org (Xiang Zhong) Date: Sat, 05 Jun 2021 05:46:14 +0000 Subject: [issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization In-Reply-To: <1619994815.29.0.724748719135.issue44013@roundup.psfhosted.org> Message-ID: <1622871974.88.0.0420840714251.issue44013@roundup.psfhosted.org> Xiang Zhong added the comment: Dear Mr. Jollans, thanks for your comments and information. I know my usage of tempfile.TemporaryFile() is unusual, technically I ?open?ed it twice. The reason I coded them in this way, as a simple illustration, is I want to test/debug some codes of my early work which directly takes ?real-file-names? as the input. Good to know ?fd.fileno()? is more advance than ?fd.name?, thank you for your information. For your writing, if my understanding is correct, you mean that os.close() and tempfile.TemporaryFile() are using the same low-level file descriptor sequences, which means they only keep track of their own file descriptor, and assign new file descriptor to the ?just? next one. For example, assume file descriptor integer numbers: 1,2,3,4? as the low-level sequences. Firstly, call tempfile.TemporaryFile() will return 1 as the file descriptor. Secondly, execute ?with open..? will use 2 as the new one and finally it will be closed. Third, call tempfile.TemporaryFile() again, problem in here is, it will sequentially take 2 (rather than 3) as the new file descriptor, because it only keeps its own orders. Since the file descriptor 2 is already used and closed inside second step in with operation, so the OSError will happen, causing the file descriptor 2 cannot be reused. Is my understanding correct? However, I do not agree with that. To boil down my example codes, fd = tempfile.TemporaryFile() with open(fd.fileno()) as f: pass # I know fd is closed after with is done fd = tempfile.TemporaryFile() # since tempfile.TemporaryFile() is # called again, it should return a # valid file descriptor, and the above # operations in ?with? chunk should # not influence its result fd.seek(0) # this should work, however, in reality, it does not Thanks for your example codes, but they are different with my examples. I even found a new problem with it, please check my additional testing file: ?new-xtempfile.py? (which is attached). I think those testings can be somehow explained your writing, however, it should be a bug. Finally, I would like to make some revisions, TL;DR: - having two file objects for the same file descriptor is asking for trouble - __del__ method should not close its ?just? next file descriptor, if its current input is closed. - I'd say they are "bug"(s) ---------- resolution: -> wont fix Added file: https://bugs.python.org/file50093/new-xtempfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 01:48:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 05 Jun 2021 05:48:27 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622872107.84.0.131199603947.issue44304@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks Mike for the report and reproducer, and Pablo for the fix! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 03:06:53 2021 From: report at bugs.python.org (Thomas Jollans) Date: Sat, 05 Jun 2021 07:06:53 +0000 Subject: [issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization In-Reply-To: <1619994815.29.0.724748719135.issue44013@roundup.psfhosted.org> Message-ID: <1622876813.01.0.188035145121.issue44013@roundup.psfhosted.org> Thomas Jollans added the comment: Hello Xiang Zhong, You're almost correct, but not quite. File descriptors/file numbers are just integers assigned by the operating system, and Python has little to no control over them. The OS keeps a numbered list of open files for each process, and Python can make system calls like "read 10 bytes from file 5" or "write these 20 bytes to file 1". Also good to know: 0 is stdin, 1 is stdout, 2 is stderr, 3+ are other files. Now, what happens: # Python asks the OS to open a new file. The OS puts the new file on # the list and gives it the lowest number that is not in use: 3. fd = tempfile.TemporaryFile() # fd is an file object for file no 3 with open(fd.fileno()) as f: # f is another object for file no 3 pass # I know fd is closed after with is done # the with statement closes file no 3 # fd does not know that file no 3 is closed. (and has no way of knowing!) # Python asks the OS to open a new file. The OS puts the new file on # the list and gives it the lowest number that is not in use: 3. _tmp = tempfile.TemporaryFile() # A new temporary file object is created for file no 3 fd = _tmp # The old fd is finalized. It still thinks it has control of file # no 3, so it closes that. The new temporary file object is given # the name fd. Aside: f.fileno() is not more "advanced" than f.name. It's just that, in the case of tempfile.TemporaryFile, the file is immediately deleted and ends up having no name, so f.name falls back on returning the file number. I just preferred it here to be explicit about what's going on. Normally f.name would be a string (and it is for a TemporaryFile on Windows!); here, it's an int. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 05:22:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Jun 2021 09:22:10 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622884930.88.0.0449513968413.issue44310@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a full duplicate of issue19859. Both ideas of using weak references and changing documentation were rejected. ---------- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> functools.lru_cache keeps objects alive forever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 05:31:59 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 05 Jun 2021 09:31:59 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1622885519.0.0.810045821205.issue44310@roundup.psfhosted.org> Joannah Nanjekye added the comment: I saw the thread but the idea was rejected by @rhettinger who seems to suggest the changes in the documentation this time himself. Maybe he has changed his mind, in which case he can explain the circumstances of his decisions if he wants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 05:39:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Jun 2021 09:39:56 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1622885996.48.0.250409046144.issue44309@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +christian.heimes versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 05:46:30 2021 From: report at bugs.python.org (Mark Bell) Date: Sat, 05 Jun 2021 09:46:30 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622886390.38.0.690161597618.issue28937@roundup.psfhosted.org> Mark Bell added the comment: Andrei: That is a very interesting observation, thank you for pointing it out. I guess your example / argument also currently applies to whitespace separation too. For example, if we have a whitespace separated string with contents: col1 col2 col3 a b c x y z then using [row.split() for row in contents.splitlines()] results in [['col1', 'col2', 'col3'], ['a', 'b', 'c'], [], ['x', 'y', 'z']] However if later a user appends the row: p q aiming to have p, and empty cell and then q then they will actually get [['col1', 'col2', 'col3'], ['a', 'b', 'c'], [], ['x', 'y', 'z'], ['p', 'q']] So at least this patch results in behaviour that is consistent with how split currently works. Are you suggesting that this is something that could be addressed by clearer documentation or using a different flag name? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 06:11:05 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Jun 2021 10:11:05 +0000 Subject: [issue44309] Add support for yescrypt in crypt. In-Reply-To: <1622805028.07.0.450307029503.issue44309@roundup.psfhosted.org> Message-ID: <1622887865.88.0.286099967457.issue44309@roundup.psfhosted.org> Christian Heimes added the comment: I'm against adding additional methods to the crypt module. - libcrypt / libxcrypt are unreliable providers. The library is only available on Unix-like platforms, not on Windows. Available algorithms are not consistent, e.g. some platforms only provide old, bad implementations. Others only support a limited subset or disable some algorithms in their crypto policies. - We still plan to deprecate and remove the crypt module because it's not reliable. I suggest that you rather create a PyPI package with yescrypt implementation that does not rely on libcrypt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 07:01:10 2021 From: report at bugs.python.org (wyz23x2) Date: Sat, 05 Jun 2021 11:01:10 +0000 Subject: [issue44317] Misleading mark of octal SyntaxErrors Message-ID: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> New submission from wyz23x2 : Python 3.10.0b2 (tags/v3.10.0b2:3173141, Jun 1 2021, 09:05:29) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 0777 File "", line 1 0777 ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 000123 File "", line 1 000123 ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers The ^ is placed below the last digit. However, this is misleading. The error is "leading zeros" and "prefix". So I would expect this: >>> 0777 File "", line 1 0777 ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 000123 File "", line 1 000123 ^^^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers Opinions? ---------- components: Parser messages: 395161 nosy: lys.nikolaou, pablogsal, wyz23x2 priority: normal severity: normal status: open title: Misleading mark of octal SyntaxErrors type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 09:15:01 2021 From: report at bugs.python.org (mike bayer) Date: Sat, 05 Jun 2021 13:15:01 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622898901.35.0.964802598374.issue44304@roundup.psfhosted.org> mike bayer added the comment: great news! Based on how many random factors were needed to reproduce as well as that it seemed to be gc related and appeared very suddenly, I had an intuition this was on the cpython side, thanks so much for doing this Pablo! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 10:32:52 2021 From: report at bugs.python.org (Bonifacio) Date: Sat, 05 Jun 2021 14:32:52 +0000 Subject: [issue16970] argparse: bad nargs value raises misleading message In-Reply-To: <1358251791.34.0.358251606196.issue16970@psf.upfronthosting.co.za> Message-ID: <1622903572.3.0.404299347366.issue16970@roundup.psfhosted.org> Bonifacio added the comment: Every PR related to this issue (even the ones only referenced during the discussion) was already merged. Latest message is from more than one year and a half ago. The only thing left to do here would be the backport to 3.7, but according to Guido it could just be skipped (since it's just an improved error message). I don't think Sushma is still interested in this, so I guess this could be closed? ---------- nosy: +Bonifacio2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 10:55:12 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 05 Jun 2021 14:55:12 +0000 Subject: [issue16970] argparse: bad nargs value raises misleading message In-Reply-To: <1358251791.34.0.358251606196.issue16970@psf.upfronthosting.co.za> Message-ID: <1622904912.53.0.698120678461.issue16970@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, I trust that this can be closed. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 10:58:52 2021 From: report at bugs.python.org (Bluenix) Date: Sat, 05 Jun 2021 14:58:52 +0000 Subject: [issue44318] Asyncio classes missing __slots__ Message-ID: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> New submission from Bluenix : Most of asyncio's classes are missing a __slots__ attribute - for example Lock, Event, Condition, Semaphore, BoundedSemaphore all from locks.py; or Future, FlowControlMixin, Queue, BaseSubprocessTransport from various other parts of asyncio. ---------- components: asyncio messages: 395165 nosy: Bluenix2, asvetlov, yselivanov priority: normal severity: normal status: open title: Asyncio classes missing __slots__ versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 11:15:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 05 Jun 2021 15:15:26 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1622906126.51.0.629937087993.issue44318@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is the problem with this? Setting __slots__ is needed if we want to save memory for creating a lot of instances. It can also be used for preventing adding arbitrary attributes and/or making weak references. Setting __slots__ in base class is required if you want to get a benefit of setting __slots__ in any of subclasses. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 11:43:11 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 05 Jun 2021 15:43:11 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622907791.48.0.686953177717.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: Mark: With sep=None, I don't think there is an issue. My only concern is when sep is set to some other value. The original issue was that the single empty str result is removed when using sep=None and that it's kept when sep is some other value. So the most direct solution would seem to be to have a flag that controls the removal/retention of a single empty str in results. Instead, the discussion was focused on removing *all* empty strings from the result. My concern is that this doesn't solve the original issue in some cases, i.e. if I want to use a sep other than None, and I want an empty line to mean there are no values (result=[]), but I do want to keep empty values (a,, => [a,'','']) -- all of these seem like fairly normal, not unusual requirements. The second concern, as I noted in previous message, is a potential for bugs if this flag being interpreted narrowly as a solution for the original issue only. [Note I don't think it would be a very widespread bug but I can see it happening occasionally.] I think to avoid both of these issues we could change the flag to narrowly target the original issue, i.e. one empty str only. The name of the flag can remain the same or possibly something like `keep_single_empty` would be more explicit (though a bit awkward). The downside is that we'd lose the convenience of splitting and filtering out all empties in one operation. Sorry that I bring this up only now when the discussion was finished and the work on PR completed; I wish I had seen the issue sooner. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 11:47:48 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 05 Jun 2021 15:47:48 +0000 Subject: [issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers In-Reply-To: <1622658712.23.0.244922352408.issue44291@roundup.psfhosted.org> Message-ID: <1622908068.53.0.32883792551.issue44291@roundup.psfhosted.org> Vinay Sajip added the comment: > Oh, sorry bad wording. OK, I see. Will take a look soon. > it looks like we can refactor SysLogHandler to inherit from SocketHandler. Not sure if it should be done in this PR Better a separate PR for that, I feel. Removing the older Pythons from the issue, as this is an enhancement request. ---------- 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 Jun 5 11:50:36 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 05 Jun 2021 15:50:36 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622908236.57.0.326761830641.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: To clarify with pseudocode, this is how it could work: '' => [] # sep=None, keep_single_empty=False '' => [''] # sep=None, keep_single_empty=True '' => [] # sep=',', keep_single_empty=False 'a,,' => ['a','',''] # sep=',', keep_single_empty=False I guess `keepempty=False` could be too easily confused for filtering out all empties. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 11:55:41 2021 From: report at bugs.python.org (Bluenix) Date: Sat, 05 Jun 2021 15:55:41 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1622908541.14.0.753127497727.issue44318@roundup.psfhosted.org> Bluenix added the comment: > What is the problem with this? The problem is that asyncio *is not* defining __slots__. > Setting __slots__ in base class is required if you want to get a benefit of setting __slots__ in any of subclasses. That is my use-case for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 12:21:38 2021 From: report at bugs.python.org (wyz23x2) Date: Sat, 05 Jun 2021 16:21:38 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1622910098.04.0.109350185126.issue44318@roundup.psfhosted.org> wyz23x2 added the comment: OK, so: >>> (1).__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'int' object has no attribute '__slots__' >>> 4.5.__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'float' object has no attribute '__slots__' >>> complex(5, 2).__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'complex' object has no attribute '__slots__' >>> 'Hello'.__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute '__slots__' >>> b'50'.__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'bytes' object has no attribute '__slots__' >>> [2.72, 3.14].__slots__ Traceback (most recent call last): File "", line 1, in AttributeError: 'list' object has no attribute '__slots__' >>> Many many more. So these *all* need __slots__??? That a major change into Python 5000. ---------- nosy: +wyz23x2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 12:23:16 2021 From: report at bugs.python.org (wyz23x2) Date: Sat, 05 Jun 2021 16:23:16 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1622910196.2.0.409589856158.issue44318@roundup.psfhosted.org> Change by wyz23x2 : ---------- nosy: -wyz23x2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 13:36:39 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 05 Jun 2021 17:36:39 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622914599.99.0.453927762083.issue11105@roundup.psfhosted.org> Ken Jin added the comment: The newly added test ``test_recursion_direct`` seems to trigger a stack overflow on windows in debug mode instead of a RecursionError. Release mode isn't affected and the test passes there. One of the buildbots reflects this too: https://buildbot.python.org/all/#/builders/146/builds/337/steps/4/logs/stdio I can avoid the crash by lowering the recursion limit in Python from 1000 to 500. The stack size for a window build is currently set to 2MB, which is usually lesser than *nix 8MB. So I think an easy solution is to increase the stack size for windows builds. I'm guessing release builds aren't affected because some of the Py_EnterRecursiveCall helper functions are probably inlined and thus use less of the stack. Opinions are greatly appreciated. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 13:44:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 17:44:42 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622915082.48.0.00173681815577.issue11105@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Batuhan, can you take a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 13:47:20 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 05 Jun 2021 17:47:20 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622915240.4.0.730751197163.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: > Batuhan, can you take a look? Yes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 13:53:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 05 Jun 2021 17:53:12 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622915592.32.0.205707410211.issue44304@roundup.psfhosted.org> Erlend E. Aasland added the comment: sqlit3.Cursor is prone to the same bug. Do you want me to create a new issue for it, or can I reuse this issue number, Pablo? I'll see if I can create a reproducer for that as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:10:56 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 05 Jun 2021 18:10:56 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622916656.51.0.961018886252.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +lukasz.langa priority: normal -> release blocker resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:22:40 2021 From: report at bugs.python.org (Bluenix) Date: Sat, 05 Jun 2021 18:22:40 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1622917360.28.0.861004027536.issue44318@roundup.psfhosted.org> Bluenix added the comment: >>> (1).__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'int' object has no attribute '__dict__' >>> 4.5.__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'float' object has no attribute '__dict__' >>> 'Hello'.__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute '__dict__' >>> b'50'.__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'bytes' object has no attribute '__dict__' >>> [2.72, 3.14].__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'list' object has no attribute '__dict__' > __slots__ allow us to explicitly declare data members (like properties) and deny the creation of __dict__ and __weakref__ (unless explicitly declared in __slots__ or available in a parent.) >From https://docs.python.org/3/reference/datamodel.html They don't have __slots__, nor a __dict__ or __weakref__: >>> (1).__weakref__ Traceback (most recent call last): File "", line 1, in AttributeError: 'int' object has no attribute '__weakref__' >>> 4.5.__weakref__ Traceback (most recent call last): File "", line 1, in AttributeError: 'float' object has no attribute '__weakref__' >>> 'Hello'.__weakref__ Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute '__weakref__' >>> b'50'.__weakref__ Traceback (most recent call last): File "", line 1, in AttributeError: 'bytes' object has no attribute '__weakref__' >>> [2.72, 3.14].__weakref__ Traceback (most recent call last): File "", line 1, in AttributeError: 'list' object has no attribute '__weakref__' They're essentially C extension classes: https://docs.python.org/3/extending/newtypes_tutorial.html I am not sure what this argument was meant to prove. What would be the downside to adding __slots__ to asyncio's classes? Other than that someone can no longer arbitrarily add attributes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:24:13 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 05 Jun 2021 18:24:13 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622917453.91.0.989534774857.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: > The stack size for a window build is currently set to 2MB, which is usually lesser than *nix 8MB. So I think an easy solution is to increase the stack size for windows builds. > I'm guessing release builds aren't affected because some of the Py_EnterRecursiveCall helper functions are probably inlined and thus use less of the stack. > Opinions are greatly appreciated. I don't think that we should make a global change for this case, AFAIK some of the core parts of the interpreter maintain their own recursion checks with different handling of windows limits. E.g; https://github.com/python/cpython/blob/fa106a685c1f199aca5be5c2d0277a14cc9057bd/Python/marshal.c#L25-L40 We might need to end up with the same motion and do the handling by ourselves. Wdyt @pablogsal @kj? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:38:32 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 05 Jun 2021 18:38:32 +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: <1622918312.56.0.817431139941.issue43908@roundup.psfhosted.org> Erlend E. Aasland added the comment: PR 26351 adds the Py_TPFLAGS_IMMUTABLETYPE type flag to all types converted to heap type during 3.10 development. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:39:56 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 05 Jun 2021 18:39:56 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622918396.32.0.314184062937.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25137 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 14:50:44 2021 From: report at bugs.python.org (wyz23x2) Date: Sat, 05 Jun 2021 18:50:44 +0000 Subject: [issue44317] Problems of int literal SyntaxErrors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622919044.14.0.587080633843.issue44317@roundup.psfhosted.org> wyz23x2 added the comment: Another 2 problems: 1. >>> 0b1112 File "", line 1 0b1112 ^ SyntaxError: invalid digit '2' in binary literal >>> 0o5780 File "", line 1 0o5780 ^ SyntaxError: invalid digit '8' in octal literal But: >>> 0x2fag File "", line 1 0x2fag ^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? >>> Is this expected? 2. >>> 0o91 File "", line 1 0o91 ^ SyntaxError: invalid digit '9' in octal literal >>> 0b21 File "", line 1 0b21 ^ SyntaxError: invalid digit '2' in binary literal The ^ is misplaced again, even though, say the 0b1112 example above works. ---------- title: Misleading mark of octal SyntaxErrors -> Problems of int literal SyntaxErrors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:40:30 2021 From: report at bugs.python.org (Battant) Date: Sat, 05 Jun 2021 19:40:30 +0000 Subject: [issue44319] setup openssl faild on linux (ubuntu 20.04) Message-ID: <1622922030.41.0.294175639013.issue44319@roundup.psfhosted.org> New submission from Battant : Hello, Here is my configuration command for ubuntu distributions lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal linux kernel version uname -r 5.4.0-74-generic Step to reproduce 1. compile openssl 1.1.1 https://stackoverflow.com/questions/53543477/building-python-3-7-1-ssl-module-failed clone cpython on main branch https://github.com/python/cpython comple python go to module directory run python3.11 setup.py install Actuel result : I get this error : Could not build the ssl module! Python requires a OpenSSL 1.1.1 or newer running build_scripts error: file '/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/Tools/scripts/pydoc3' does not exist Expend result : python3.11 modules could be installed Could you help me to fix this issus Best regards Battant ---------- assignee: christian.heimes components: SSL messages: 395180 nosy: Battant, christian.heimes priority: normal severity: normal status: open title: setup openssl faild on linux (ubuntu 20.04) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:43:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 19:43:20 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622922200.64.0.468566033082.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > sqlit3.Cursor is prone to the same bug. No, is not: it doesn't drop the GIL in tp_clear. There is technically no bug, but is true that tp_clear should only clean Python references. Although in this case there are some sematics with the cleanup that are not clear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:43:07 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Sat, 05 Jun 2021 19:43:07 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1622922187.78.0.406207175508.issue38323@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:46:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 19:46:04 +0000 Subject: [issue44317] Problems of int literal SyntaxErrors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622922364.01.0.453662991009.issue44317@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is this expected? Yes, is an edge case of python identifiying two tokens together except that there is no space: >>> 3 4 File "", line 1 3 4 ^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? I honestly don't share your concerns that these things are "misleading". The caret is pointing to the token that is incorrect 0777. The tokenizer errors always point at the end of the token (we still have not implemented ranged errors for the tokenizer). This is true in all the cases you present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:46:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 19:46:22 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622922382.76.0.409801841989.issue44317@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: Problems of int literal SyntaxErrors -> Suggestion for better syntax errors in tokenizer errors _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 15:51:17 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 05 Jun 2021 19:51:17 +0000 Subject: [issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9" In-Reply-To: <1603972449.31.0.552627573436.issue42194@roundup.psfhosted.org> Message-ID: <1622922677.73.0.396064563817.issue42194@roundup.psfhosted.org> Joannah Nanjekye added the comment: Am inclined to merge the former PR because yours is just an exact replica. Please note that we can merge such small fixes without the author signing the CLA but the author is advised to sign the CLA for future contributions. Source: informed by other core devs on reviewing similar PRs recently and a similar discussion was on a ML some time back. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 16:09:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 20:09:10 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622923750.6.0.226504308113.issue44304@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25138 pull_request: https://github.com/python/cpython/pull/26551 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 16:18:34 2021 From: report at bugs.python.org (Mark Bell) Date: Sat, 05 Jun 2021 20:18:34 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622924314.6.0.661161073114.issue28937@roundup.psfhosted.org> Mark Bell added the comment: > Instead, the discussion was focused on removing *all* empty strings from the result. I imagine that the discussion focussed on this since this is precisely what happens when sep=None. For example, 'a b c ?'.split() == ['a', 'b', 'c']. I guess that the point was to provide users with explicit, manual control over whether the behaviour of split should drop all empty strings or retain all empty strings instead of this decision just being made on whether sep is None or not. So I wonder whether the "expected" solution for parsing CSV like strings is for you to actually filter out the empty strings yourself and never pass them to split at all. For example by doing something like: [line.split(sep=',') for line in content.splitlines() if line] but if this is the case then this is the kind of thing that would require careful thought about what is the right name for this parameter / right way to express this in the documentation to make sure that users don't fall into the trap that you mentioned. > Sorry that I bring this up only now when the discussion was finished and the work on PR completed; I wish I had seen the issue sooner. Of course, but the main thing is that you spotted this before the PR was merged :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 17:01:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 05 Jun 2021 21:01:31 +0000 Subject: [issue44319] setup openssl faild on linux (ubuntu 20.04) In-Reply-To: <1622922030.41.0.294175639013.issue44319@roundup.psfhosted.org> Message-ID: <1622926891.66.0.969460889322.issue44319@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 18:35:28 2021 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 05 Jun 2021 22:35:28 +0000 Subject: [issue44293] PEP 585 breaks inspect.isclass In-Reply-To: <1622672761.68.0.195869463104.issue44293@roundup.psfhosted.org> Message-ID: <1622932528.12.0.108822621847.issue44293@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Uploaded typing_inspect 0.7.0 to PyPI (it should work with Python 3.9 hopefully) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 18:41:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 22:41:20 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622932880.43.0.105629797482.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72 by Pablo Galindo in branch 'main': bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL held (GH-26551) https://github.com/python/cpython/commit/6e3b7cf3af3ed7758b2c2193c1d393feb8ab8f72 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 18:41:20 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 05 Jun 2021 22:41:20 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622932880.93.0.980824660608.issue44304@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25139 pull_request: https://github.com/python/cpython/pull/26552 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 19:12:47 2021 From: report at bugs.python.org (Harry) Date: Sat, 05 Jun 2021 23:12:47 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1622934767.33.0.126242569313.issue44186@roundup.psfhosted.org> Change by Harry : ---------- keywords: +patch pull_requests: +25140 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 19:13:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 23:13:31 +0000 Subject: [issue44304] segmentation fault appeared in python 3.10.0b2 In-Reply-To: <1622744587.51.0.457614596671.issue44304@roundup.psfhosted.org> Message-ID: <1622934811.99.0.439353330254.issue44304@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 317e9ed4363a86b1364573c5a5e30011a080ce6d by Miss Islington (bot) in branch '3.10': bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL held (GH-26551) (GH_26552) https://github.com/python/cpython/commit/317e9ed4363a86b1364573c5a5e30011a080ce6d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 19:23:06 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 05 Jun 2021 23:23:06 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622935386.04.0.486887443301.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25141 pull_request: https://github.com/python/cpython/pull/26554 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 19:29:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 23:29:33 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622935773.44.0.65730527139.issue44317@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25142 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26555 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 19:30:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 05 Jun 2021 23:30:31 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622935831.78.0.836652339926.issue44317@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 26555 does some improvements to your examples: >>> 0777 File "", line 1 0777 ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 000007777 File "", line 1 000007777 ^^^^^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers >>> 0b1112 File "", line 1 0b1112 ^ SyntaxError: invalid digit '2' in binary literal >>> 0o91 File "", line 1 0o91 ^ SyntaxError: invalid digit '9' in octal literal >>> 0b21 File "", line 1 0b21 ^ SyntaxError: invalid digit '2' in binary literal >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 20:11:57 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 06 Jun 2021 00:11:57 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622938317.66.0.327461585246.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: After playing with it for a couple hours and without much success of creating a test environment (only using buildbots), I decided not to introduce hard limits. Even though they make the original tests to pass, they don't solve the problem overall and also more important part is that the 'hard limits' might cause regressions for people who do compile() calls. For normal windows builds (as @kj noted) something might work in the current revision and we might just break it with introducing hard limits. Since the trees are tend to get really branchy, I don't think it is a good idea. I'm open to any proposals/plans Extra: In the worst case that we can't come up with something (the AST converter functions are really long 2000+ LoC C functions so it is possible that there might be stuff that eats a lot of space on the stack), we can either a) revert => not a good option, this is not a regression on the python itself. It is a fix for other os's and windows release builds b) always skip the test on windows => we can do that but it might be counterintuitive for the future c) use a really low recursion limit for the test_recursion_* for windows => I'm open to fallback to this if nothing comes up. we might need to revert this though as is it is not a regression. It used to crash with the same exact error, just outside of the test suite, and now since it works for linux/macos/others + windows for release builds I wonder whether can just skip the test on windows and keep it as is in the worst scenario). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 20:20:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 00:20:05 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622938805.26.0.235074876464.issue11105@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > b) always skip the test on windows => we can do that but it might be counterintuitive for the future Well, is not that the test is flaky technically, this means that the feature doesn't work on Windows (non release builds). So the reasoning has to be why we want/need to not support this on Windows. Otherwise we need to customize the limit on debug builds. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 20:25:00 2021 From: report at bugs.python.org (Benjamin Lee) Date: Sun, 06 Jun 2021 00:25:00 +0000 Subject: [issue39247] dataclass defaults and property don't work together In-Reply-To: <1578418537.56.0.0565923550129.issue39247@roundup.psfhosted.org> Message-ID: <1622939100.47.0.951106789391.issue39247@roundup.psfhosted.org> Benjamin Lee added the comment: Would this issue not be trivially resolved if there was a way to specify alias in the dataclasses field? I.e.: _uploaded_by: str = dataclasses.field(alias="uploaded_by", default=None, init=False) Ultimately, the main goal is to make it so that the generated __init__ constructor does self._uploaded_by = uploaded_by but with current implementation, there is no aliasing so the default __init__ constructor is always: self._uploaded_by = _uploaded_by ---------- nosy: +UnHumbleBen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 20:35:57 2021 From: report at bugs.python.org (ppperry) Date: Sun, 06 Jun 2021 00:35:57 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1622939757.68.0.424745945509.issue11105@roundup.psfhosted.org> Change by ppperry : ---------- nosy: -ppperry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:08:57 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sun, 06 Jun 2021 01:08:57 +0000 Subject: [issue39247] dataclass defaults and property don't work together In-Reply-To: <1578418537.56.0.0565923550129.issue39247@roundup.psfhosted.org> Message-ID: <1622941737.15.0.911440245659.issue39247@roundup.psfhosted.org> Eric V. Smith added the comment: > _uploaded_by: str = dataclasses.field(alias="uploaded_by", default=None, init=False) That's an interesting idea. I'll play around with it. I'm not sure "alias" feels quite right, as it only applies to __init__ (if I'm understanding it correctly). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:22:50 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 06 Jun 2021 01:22:50 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622942570.81.0.176156393502.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: > I imagine that the discussion focussed on this since this is precisely what happens when sep=None. For example, 'a b c ?'.split() == ['a', 'b', 'c']. I guess that the point was to provide users with explicit, manual control over whether the behaviour of split should drop all empty strings or retain all empty strings instead of this decision just being made on whether sep is None or not. That's true on some level but it seems to me that it's somewhat more nuanced than that. The intent of sep=None is not to remove empties but to collapse invisible whitespace of mixed types into a single separator. ' \t ' probably means a single separator because it looks like one visually. Yes, the effect is the same as removing empties but it's a relevant distinction when designing (and naming) a flag to make split() consistent with this behaviour when sep is ',', ';', etc. Because when you have 'a,,,' - the most likely intent is to have 3 empty values, NOT to collapse 3 commas into a single sep; - and then you might potentially have additional processing that gets rid of empties, as part of split() operation. So it's quite a different operation, even though the end effect is the same. So is this change really making the behaviour consistent? To me, consistency implies that intent is roughly the same, and outcome is also roughly the same. You might say, but: practicality beats purity? However, there are some real issues here: - harder to explain, remember, document. - naming issue - not completely solving the initial issue (and it would most likely leave no practical way to patch up that corner case if this PR is accepted) Re: naming, for example, using keep_empty=False for sep=None is confusing, - it would seem that most (or even all) users would think of the operation as collapsing contiguous mixed whitespace into a single separator rather than splitting everything up and then purging empties. So this name could cause a fair bit of confusion for this case. What if we call it `collapse_contiguous_separators`? I can live with an awkward name, but even then it doesn't work for the case like 'a,,,,' -- it doesn't make sense (mostly) to collapse 4 commas into one separator. Here you are actually purging empty values. So the consistency seems labored in that any name you pick would be confusing for some cases. And is the consistency for this case really needed? Is it common to have something like 'a,,,,' and say "I wish to get rid of those empty values but I don't want to use filter(None, values)"? In regard to the workaround you suggested, that seems fine. If this PR is accepted, any of the workarounds that people now use for ''.split(',') or similar would still work just as before.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:25:14 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 06 Jun 2021 01:25:14 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1622942714.81.0.805358697014.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: > Of course, but the main thing is that you spotted this before the PR was merged :) I know, better late then never but also better sooner than late :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:33:02 2021 From: report at bugs.python.org (Michael Robellard) Date: Sun, 06 Jun 2021 01:33:02 +0000 Subject: [issue39247] dataclass defaults and property don't work together In-Reply-To: <1578418537.56.0.0565923550129.issue39247@roundup.psfhosted.org> Message-ID: <1622943182.39.0.119926644707.issue39247@roundup.psfhosted.org> Michael Robellard added the comment: The sample I uploaded doesn't do any processing, but the use case originally had some logic inside the property getter/setter, would the alias idea allow for that? The purpose of the property is to add some logic to compute the value if it has not already been computed, however if it is computed don't recompute it because it is expensive to recompute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:45:14 2021 From: report at bugs.python.org (Benjamin Lee) Date: Sun, 06 Jun 2021 01:45:14 +0000 Subject: [issue39247] dataclass defaults and property don't work together In-Reply-To: <1578418537.56.0.0565923550129.issue39247@roundup.psfhosted.org> Message-ID: <1622943914.63.0.523806291002.issue39247@roundup.psfhosted.org> Benjamin Lee added the comment: > I'm not sure "alias" feels quite right, as it only applies to __init__ (if I'm understanding it correctly). Maybe `init_alias` might be a better name. In any case, this would support private variables in dataclasses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:48:47 2021 From: report at bugs.python.org (OSAMU NAKAMURA) Date: Sun, 06 Jun 2021 01:48:47 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote Message-ID: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> New submission from OSAMU NAKAMURA : The License text for W3C C14N test suite is rendered as quoted text, but it should be rendered same as others. - change`:` to `::` ---------- assignee: docs at python components: Documentation messages: 395197 nosy: OSAMU.NAKAMURA, docs at python priority: normal severity: normal status: open title: License for W3C C14N test suite is rendered as blockquote versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 21:53:24 2021 From: report at bugs.python.org (OSAMU NAKAMURA) Date: Sun, 06 Jun 2021 01:53:24 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622944404.97.0.215217525331.issue44320@roundup.psfhosted.org> Change by OSAMU NAKAMURA : ---------- keywords: +patch pull_requests: +25143 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26556 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:34:25 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Jun 2021 02:34:25 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622946865.23.0.601182779926.issue44320@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25144 pull_request: https://github.com/python/cpython/pull/26557 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:34:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 06 Jun 2021 02:34:14 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622946854.1.0.824531803335.issue44320@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 71be46170490d08743c714b9fa4484038aa7a23e by NAKAMURA Osamu in branch 'main': bpo-44320: Fix markup for W3C C14N test suite (GH-26556) https://github.com/python/cpython/commit/71be46170490d08743c714b9fa4484038aa7a23e ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:34:23 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 06 Jun 2021 02:34:23 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622946863.85.0.701735519958.issue44320@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:34:30 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Jun 2021 02:34:30 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622946870.25.0.366213421389.issue44320@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25145 pull_request: https://github.com/python/cpython/pull/26558 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:57:02 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Jun 2021 02:57:02 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622948222.48.0.872572126032.issue44320@roundup.psfhosted.org> miss-islington added the comment: New changeset 3b87137176f790e93493fcb5543001f1cab8daf7 by Miss Islington (bot) in branch '3.10': bpo-44320: Fix markup for W3C C14N test suite (GH-26556) https://github.com/python/cpython/commit/3b87137176f790e93493fcb5543001f1cab8daf7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 22:57:27 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Jun 2021 02:57:27 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622948247.6.0.337762950312.issue44320@roundup.psfhosted.org> miss-islington added the comment: New changeset 8e2c0fd7ada79107f7e0d9c465e77fb36a9486e5 by Miss Islington (bot) in branch '3.9': bpo-44320: Fix markup for W3C C14N test suite (GH-26556) https://github.com/python/cpython/commit/8e2c0fd7ada79107f7e0d9c465e77fb36a9486e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 5 23:01:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 06 Jun 2021 03:01:12 +0000 Subject: [issue44320] License for W3C C14N test suite is rendered as blockquote In-Reply-To: <1622944127.79.0.396883426351.issue44320@roundup.psfhosted.org> Message-ID: <1622948472.19.0.717265394376.issue44320@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 03:21:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Jun 2021 07:21:05 +0000 Subject: [issue44186] TimedRotatingFileHandler overwrite log In-Reply-To: <1621506119.34.0.442557367091.issue44186@roundup.psfhosted.org> Message-ID: <1622964065.06.0.71546627609.issue44186@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> vinay.sajip nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 03:59:50 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 06 Jun 2021 07:59:50 +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: <1622966390.42.0.184773120978.issue43654@roundup.psfhosted.org> Tal Einat added the comment: > The unknown is whether anyone has changed these pseudoevent bindings and if so, how much do we care? Let's ask on idle-dev. > Guido, do you have any comment on this proposal from a change policy perspective? I'm not an ex-BDFL, but I can't think of a reason this shouldn't be backported as per our usual policy regarding IDLE. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 04:24:45 2021 From: report at bugs.python.org (PeterChu) Date: Sun, 06 Jun 2021 08:24:45 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1622967885.09.0.354841423519.issue44227@roundup.psfhosted.org> Change by PeterChu : ---------- nosy: +PeterChu nosy_count: 2.0 -> 3.0 pull_requests: +25146 pull_request: https://github.com/python/cpython/pull/26548 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:38:52 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Jun 2021 10:38:52 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622975932.37.0.957918950858.issue44246@roundup.psfhosted.org> Ken Jin added the comment: The new test `test_entry_points_by_index` (added in c34ed08d975fb7daa7b329f7c631647782290393 ) seems to fail on some windows buildbots: https://dev.azure.com/Python/cpython/_build/results?buildId=81807&view=logs&j=c8a71634-e5ec-54a0-3958-760f4148b765&t=599737bc-ad72-560d-1530-0f89b05729e4 A copy of the error output for everyone's convenience: ====================================================================== ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) Prior versions of Distribution.entry_points would return a ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\b\layout-appx-amd64\lib\test\test_importlib\test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration ---------------------------------------------------------------------- BTW, the same buildbot is currently failing on main with a different error which masks that error above. I'll do more digging if no one takes this up by next week. Currently I'm not able to reproduce that locally on my windows machine. Thanks all! ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:40:29 2021 From: report at bugs.python.org (Samuel Marks) Date: Sun, 06 Jun 2021 10:40:29 +0000 Subject: [issue44321] os.EX_OK for Windows Message-ID: <1622976029.7.0.66701832067.issue44321@roundup.psfhosted.org> New submission from Samuel Marks : Since Python 2.3 alpha 2 [19-Feb-2003] `EX_OK` has existed? but only for Unix. This adds support for Windows. ---------- components: Windows messages: 395203 nosy: paul.moore, samuelmarks, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: os.EX_OK for Windows type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:41:44 2021 From: report at bugs.python.org (Samuel Marks) Date: Sun, 06 Jun 2021 10:41:44 +0000 Subject: [issue44321] os.EX_OK for Windows In-Reply-To: <1622976029.7.0.66701832067.issue44321@roundup.psfhosted.org> Message-ID: <1622976104.18.0.00592118918522.issue44321@roundup.psfhosted.org> Change by Samuel Marks : ---------- keywords: +patch pull_requests: +25147 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26559 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:51:36 2021 From: report at bugs.python.org (wyz23x2) Date: Sun, 06 Jun 2021 10:51:36 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1622976696.19.0.0105005269821.issue44317@roundup.psfhosted.org> Change by wyz23x2 : ---------- type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:52:33 2021 From: report at bugs.python.org (Samuel Marks) Date: Sun, 06 Jun 2021 10:52:33 +0000 Subject: [issue44321] os.EX_OK for Windows In-Reply-To: <1622976029.7.0.66701832067.issue44321@roundup.psfhosted.org> Message-ID: <1622976753.3.0.202660001296.issue44321@roundup.psfhosted.org> Samuel Marks added the comment: `EXIT_SUCCESS` is defined in `stdlib.h`, as per https://docs.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure (following the standard https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html) There are also https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants which has many equivalents to the `` (in ``). Kinda related: https://bugs.python.org/issue24053 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 06:59:47 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 06 Jun 2021 10:59:47 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622977187.29.0.76238658593.issue39573@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- nosy: +BTaskaya nosy_count: 10.0 -> 11.0 pull_requests: +25148 pull_request: https://github.com/python/cpython/pull/26550 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 07:12:43 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 06 Jun 2021 11:12:43 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622977963.0.0.573732403633.issue39573@roundup.psfhosted.org> Ken Jin 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. 3 windows buildbots using python debug mode is affected. Python compiled with release mode is *not* affected and passes the test. Here's an example error on one of the buildbots: https://buildbot.python.org/all/#/builders/596/builds/354/steps/4/logs/stdio I can also reproduce this locally. I tracked this issue down after a recursion in AST also caused a stack overflow, see my message here: https://bugs.python.org/msg395172 TLDR: Windows builds seems to set stack size to 2MB, on *nix it's probably higher (usually 8MB). I suspect the static inline functions are not being inlined in windows debug builds, so every function call adds to the stack. In that message I proposed to increase the stack size on windows but there are some concerns (see msg395177). What do you think? ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 07:21:15 2021 From: report at bugs.python.org (William Pickard) Date: Sun, 06 Jun 2021 11:21:15 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1622978475.9.0.407671481175.issue39573@roundup.psfhosted.org> William Pickard added the comment: MSVC by default disables method inlining (/Ob0) when '/Od' is specified on the command line while the optimization options specify '/Ob2'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 11:04:57 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 06 Jun 2021 15:04:57 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1622991897.31.0.903760261188.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: The line where the failure occurs is the point where it's checking that the warning was issued. The fact that a StopIteration is raised indicates that no warnings were caught. I can think of a couple of scenarios where that could happen: - That warning is somehow disabled. - The `Distribution` object returned by `distribution('distinfo-pkg')` is somehow an older implementation (perhaps an older importlib_metadata is present). Given that the DeprecationWarnings aren't missed on other tests, the latter seems to be a more likely candidate. I notice that the regular tests are passing. It's only in the 'appx' environment where the test fails. I'm not familiar with appx, but it seems likely that something from the appx environment creation is a factor in the divergent behavior. Steve, can you advise on how appx environments are created and how one could replicate a test failure that only occurs in that environment? ---------- nosy: +steve.dower _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 11:28:24 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 06 Jun 2021 15:28:24 +0000 Subject: [issue37768] IDLE: Show help(object) output in a text viewer In-Reply-To: <1565038566.59.0.841955505333.issue37768@roundup.psfhosted.org> Message-ID: <1622993304.4.0.172177687599.issue37768@roundup.psfhosted.org> Change by Tal Einat : ---------- pull_requests: +25150 pull_request: https://github.com/python/cpython/pull/26561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 11:28:24 2021 From: report at bugs.python.org (Tal Einat) Date: Sun, 06 Jun 2021 15:28:24 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1622993304.27.0.290203147406.issue40468@roundup.psfhosted.org> Change by Tal Einat : ---------- keywords: +patch pull_requests: +25149 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26561 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 14:08:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 06 Jun 2021 18:08:02 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields Message-ID: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> New submission from Terry J. Reedy : Document that SyntaxError args[1] is a tuple of the other attributes and how the meaning of the attributes is adjusted when the syntax error is in an f-string field replacement expression. Also add compile() to the list of builtins that can raise SyntaxError. PR to follow immediately. I wrote most of the text so that it works for 3.9 and 3.10+, with the new end info. In the example, the main part of the message changed from "invalid syntax" to "invalid syntax. Perhaps you forgot a comma?". I hid that with '...' but each could be given in the respective versions. args[1] changes from "('', 1, 4, '(a b)\n')" to "('', 1, 2, '(a b)\n', 1, 5)" and that will have to be changed in a 3.9 backport. Spinoff from #43705. I will create a separate issue for using this information in IDLE. ---------- assignee: docs at python components: Documentation messages: 395208 nosy: ammar2, docs at python, pablogsal, terry.reedy priority: normal severity: normal stage: patch review status: open title: Document SyntaxError args and interpretation for f-string fields versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 14:12:37 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Sun, 06 Jun 2021 18:12:37 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1623003157.02.0.0490208533123.issue44297@roundup.psfhosted.org> Dominic Davis-Foster added the comment: Is this a re-regression of https://bugs.python.org/issue43933? ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 14:17:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 06 Jun 2021 18:17:40 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623003460.5.0.599730795893.issue44322@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +25151 pull_request: https://github.com/python/cpython/pull/26562 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 14:24:13 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 06 Jun 2021 18:24:13 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1623003853.48.0.201610696524.issue44227@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25152 pull_request: https://github.com/python/cpython/pull/26563 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 15:40:31 2021 From: report at bugs.python.org (Battant) Date: Sun, 06 Jun 2021 19:40:31 +0000 Subject: [issue44323] insttall module faid on wondows 10 Message-ID: <1623008431.46.0.342907692424.issue44323@roundup.psfhosted.org> New submission from Battant : Hello Configuration : windows 10 python install p: python3.9 from microsoft store step to reproduce : on windows, install visual studio and buid tools clone cpython repository main branch https://github.com/python/cpython compile python with command pCbuil/bauld.bat run command : .\PCbuild\amd64\py.exe .\setup.py install Actuel result : cpython\setup.py", line 131, in set_compiler_flags sysconfig.get_config_vars()[compiler_flags] = flags + ' ' + py_flags_nodist TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Detail : cpython\setup.py", line : 128 compile flag : CFLAGS py_flags_nodist = None compiler_flags : CFLAGS sysconfig : PY_CFLAGS_NODIST Question : why compile flag : CFLAGS py_flags_nodist = None ) Coud you help me to fix this issuus ? Best regards Battant ---------- components: Extension Modules messages: 395210 nosy: Battant priority: normal severity: normal status: open title: insttall module faid on wondows 10 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 15:53:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 06 Jun 2021 19:53:02 +0000 Subject: [issue44227] help(bisect.bisect_left) In-Reply-To: <1621904858.62.0.585664963614.issue44227@roundup.psfhosted.org> Message-ID: <1623009182.39.0.525144672873.issue44227@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset b5cedd098043dc58ecf9c2f33774cd7646506a92 by Miss Islington (bot) in branch '3.10': bpo-44227: Update bisect docstrings (GH-26548) (GH-26563) https://github.com/python/cpython/commit/b5cedd098043dc58ecf9c2f33774cd7646506a92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 16:07:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 06 Jun 2021 20:07:15 +0000 Subject: [issue43610] Ctrl C makes interpreter exit In-Reply-To: <1616555069.73.0.540309240427.issue43610@roundup.psfhosted.org> Message-ID: <1623010035.77.0.937251673116.issue43610@roundup.psfhosted.org> Terry J. Reedy added the comment: I verified that sndhdr.what(0) calls "with open(0, rb)" so that Eryk's comment applies. (On Windows, handle 0 is invalid, so the call errors immediately instead of hanging.) ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 16:38:43 2021 From: report at bugs.python.org (Arjun) Date: Sun, 06 Jun 2021 20:38:43 +0000 Subject: [issue44324] add a "expected expression" syntax error Message-ID: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> New submission from Arjun : Recently, CPython got a new syntax error, "SyntaxError: expression expected after dictionary key and ':'". I propose to add a "expected expression" in general for consistency. I would like to have it changed for all the "equals" (e.g. PLUSEQUAL, MINEQUAL, etc). >>> x = File "", line 1 x = ^ SyntaxError: invalid syntax Would be enhanced by: >>> x += File "", line 1 x = ^ SyntaxError: expected expression ---------- components: Parser messages: 395213 nosy: CCLDArjun, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: add a "expected expression" syntax error type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 16:44:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 06 Jun 2021 20:44:50 +0000 Subject: [issue44325] IDLE: Fix shell comment anomalies Message-ID: <1623012290.47.0.522226397666.issue44325@roundup.psfhosted.org> New submission from Terry J. Reedy : Spinoff from #38673, about standard REPL, msg356271 (me) and msg356348 (Guido). In the following interactions, no blank lines were entered. 3.9 behavior >>> #a >>> # a >>> #a >>> # a >>> Mystery 1: why the blank continuation line? I previously wrote "ast.dump(ast.parse(' # a\n', '', 'single')) gives the same result, 'Module(body=[], type_ignores=[])', as without [space after #]". Today, 3.8.10, 3.9.5, 3.10, and 3.11 say "unexpected EOF while parsing". 3.10 behavior >>> #a ... >>> # a >>> #a >>> # a ... >>> Mystery 2: why the new continuation line after '#a'? 3.11 behavior >>> #a >>> # a >>> #a >>> #a >>> # a ... >>> Mystery 3: why does the 3.10 regression for '#a' disappear? Perhaps IDLE should handle initial blank lines itself, but I will investigate what codeop._maybe_compile is getting and doing in the different cases first. ---------- messages: 395214 nosy: taleinat, terry.reedy priority: normal severity: normal stage: test needed status: open title: IDLE: Fix shell comment anomalies type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 16:46:09 2021 From: report at bugs.python.org (Arjun) Date: Sun, 06 Jun 2021 20:46:09 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623012369.35.0.574544003707.issue44324@roundup.psfhosted.org> Arjun added the comment: I forgot to add, I would be willing to make the necessary changes, if accepted ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:27:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:27:15 +0000 Subject: [issue44326] [sqlite3] remove unused db member from pysqlite_Statement Message-ID: <1623014835.09.0.0517265568225.issue44326@roundup.psfhosted.org> New submission from Erlend E. Aasland : The db member of pysqlite_Statement is only "used" in the __init__ method. Suggesting to remove this. A couple of lines less of code, a couple of bytes less per statement object. ---------- assignee: erlendaasland components: Extension Modules messages: 395216 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] remove unused db member from pysqlite_Statement type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:27:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:27:42 +0000 Subject: [issue44326] [sqlite3] remove unused db member from pysqlite_Statement In-Reply-To: <1623014835.09.0.0517265568225.issue44326@roundup.psfhosted.org> Message-ID: <1623014862.76.0.730857697719.issue44326@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25153 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26564 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:28:26 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:28:26 +0000 Subject: [issue44326] [sqlite3] remove unused db member from pysqlite_Statement Message-ID: <1623014906.15.0.0171562668912.issue44326@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- Removed message: https://bugs.python.org/msg395216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:28:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:28:37 +0000 Subject: [issue44326] [sqlite3] remove unused db member from pysqlite_Statement Message-ID: <1623014917.48.0.194652850007.issue44326@roundup.psfhosted.org> New submission from Erlend E. Aasland : The db member of pysqlite_Statement is only "used" in the statement create method. Suggesting to remove this. A couple of lines less of code, a couple of bytes less per statement object. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:33:08 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:33:08 +0000 Subject: [issue44326] [sqlite3] remove unused members from pysqlite_Statement In-Reply-To: <1623014917.48.0.194652850007.issue44326@roundup.psfhosted.org> Message-ID: <1623015188.63.0.766651003766.issue44326@roundup.psfhosted.org> Erlend E. Aasland added the comment: The "sql" member is also unused. Removing this will make the tp_clear method redundant, as there are no PyObjects to clear anymore. ---------- title: [sqlite3] remove unused db member from pysqlite_Statement -> [sqlite3] remove unused members from pysqlite_Statement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:46:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:46:11 +0000 Subject: [issue44327] [sqlite3] remove unused members from pysqlite_Connection Message-ID: <1623015971.21.0.951801606377.issue44327@roundup.psfhosted.org> New submission from Erlend E. Aasland : The timeout and timeout_started members of pysqlite_Connection are never used. Suggesting to remove them. ---------- assignee: erlendaasland components: Extension Modules messages: 395219 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] remove unused members from pysqlite_Connection type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:46:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 21:46:48 +0000 Subject: [issue44327] [sqlite3] remove unused members from pysqlite_Connection In-Reply-To: <1623015971.21.0.951801606377.issue44327@roundup.psfhosted.org> Message-ID: <1623016008.14.0.328529878383.issue44327@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25154 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26565 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:47:15 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 06 Jun 2021 21:47:15 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623016035.24.0.762503322255.issue41299@roundup.psfhosted.org> Ryan Hileman added the comment: I just ran into this. GetTickCount64() is a bad choice even without improving the Windows timer resolution, as every mutex wait will have 16ms of jitter. Here are some lock.acquire(timeout=0.001) times measured with time.perf_counter(): elapsed=21.215ms elapsed=30.960ms elapsed=21.686ms elapsed=30.998ms elapsed=30.794ms Here's the same lock.acquire(timeout=0.001) with CPython patched to use QueryPerformanceCounter() instead of GetTickCount64(). Notice this is less overhead than even the original post's Python 2.x times. elapsed=9.554ms elapsed=14.516ms elapsed=13.985ms elapsed=13.434ms elapsed=13.724ms Here's the QueryPerformanceCounter() test in a timeBeginPeriod(1) block: elapsed=1.135ms elapsed=1.204ms elapsed=1.189ms elapsed=1.052ms elapsed=1.052ms I'd like to submit a PR to fix the underlying issue by switching to QueryPerformanceCounter() in EnterNonRecursiveMutex(). QueryInterruptTime() is a bad candidate because it's only supported on Windows 10, and CPython still supports Windows 8. Improvements based on QueryPerformanceCounter() can be backported to at least 3.8 (3.8 dropped Windows XP support, which was the last Windows version where QueryPerformanceCounter() could fail). I checked and the only other use of GetTickCount64() seems to be in time.monotonic(). Honestly I would vote to change time.monotonic() to QueryPerformanceCounter() as well, as QueryPerformanceCounter() can no longer fail on any Windows newer than XP (which is no longer supported by Python), but that's probably a topic for a new BPO. ---------- nosy: +lunixbochs2 versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 17:55:21 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 06 Jun 2021 21:55:21 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623016521.14.0.17904661555.issue41299@roundup.psfhosted.org> Change by Ryan Hileman : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:05:07 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 06 Jun 2021 22:05:07 +0000 Subject: [issue44328] time.monotonic() should use QueryPerformanceCounter() on Windows Message-ID: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> New submission from Ryan Hileman : Related to https://bugs.python.org/issue41299#msg395220 Presumably `time.monotonic()` on Windows historically used GetTickCount64() because QueryPerformanceCounter() could fail. However, that hasn't been the case since Windows XP: https://docs.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter > On systems that run Windows XP or later, the function will always succeed and will thus never return zero I've run into issues with this when porting python-based applications to Windows. On other platforms, time.monotonic() was a decent precision so I used it. When I ported to Windows, I had to replace all of my time.monotonic() calls with time.perf_counter(). I would pretty much never knowingly call time.monotonic() if I knew ahead of time it could be quantized to 16ms. My opinion is that the GetTickCount64() monotonic time code in CPython should be removed entirely and only the QueryPerformanceCounter() path should be used. I also think some of the failure checks could be removed from QueryPerformanceCounter() / QueryPerformanceFrequency(), as they're documented to never fail in modern Windows and CPython has been dropping support for older versions of Windows, but that's less of a firm opinion. ---------- components: Library (Lib), Windows messages: 395221 nosy: lunixbochs2, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: time.monotonic() should use QueryPerformanceCounter() on Windows type: performance versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:11:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:11:52 +0000 Subject: [issue44327] [sqlite3] remove unused members from pysqlite_Connection In-Reply-To: <1623015971.21.0.951801606377.issue44327@roundup.psfhosted.org> Message-ID: <1623017512.3.0.0517042623634.issue44327@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 505624e917a2d3d845304f8d34fccd41f06d4720 by Erlend Egeberg Aasland in branch 'main': bpo-44327: Remove unused members from pysqlite_Connection (GH-26565) https://github.com/python/cpython/commit/505624e917a2d3d845304f8d34fccd41f06d4720 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:12:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:12:19 +0000 Subject: [issue44326] [sqlite3] remove unused members from pysqlite_Statement In-Reply-To: <1623014917.48.0.194652850007.issue44326@roundup.psfhosted.org> Message-ID: <1623017539.49.0.875713683401.issue44326@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0d12f245523178eb62e22f5da5a276bfc7004ac4 by Erlend Egeberg Aasland in branch 'main': bpo-44326: Remove unused members from pysqlite_Statement (GH-26564) https://github.com/python/cpython/commit/0d12f245523178eb62e22f5da5a276bfc7004ac4 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:21:32 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 22:21:32 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create Message-ID: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, pysqlite_statement_create() approx. looks like this: 1. some sanity checks (type, sql lenght, etc.) 2. allocate (PyObject_GC_New) 3. initialise members 4. determine if statement is a DML statement 5. create the statement (sqlite3_prepare_v2) 6. PyObject_GC_Track 7. check statement return value 8. more sanity checking 9. done! Suggesting to refactor as this: 1. all sanity checks => early exit on failure 2. create the statement and validate return value 3. determine if statement is a DML statement => no need to do this if statement creation failed 4. allocate 5. initialise members 5. return This will avoid unneeded allocations/GC tracking, it will avoid unneeded statement creation, and it will be more readable/maintainable. ---------- assignee: erlendaasland components: Extension Modules messages: 395224 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] refactor pysqlite_statement_create type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:26:04 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 22:26:04 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623018364.26.0.310181713184.issue44329@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25155 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26566 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:26:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:26:24 +0000 Subject: [issue44327] [sqlite3] remove unused members from pysqlite_Connection In-Reply-To: <1623015971.21.0.951801606377.issue44327@roundup.psfhosted.org> Message-ID: <1623018384.16.0.969706598785.issue44327@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:26:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:26:18 +0000 Subject: [issue44326] [sqlite3] remove unused members from pysqlite_Statement In-Reply-To: <1623014917.48.0.194652850007.issue44326@roundup.psfhosted.org> Message-ID: <1623018378.08.0.672110695858.issue44326@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:28:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:28:19 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623018499.51.0.142855130892.issue44324@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This one will be very tricky to do correctly because the '=' is very context-sensitive and the parser can be confused when backtracking, so this *may* be quite delicate/complex. I need to play a bit with this to know how feasible this would be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:42:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 22:42:57 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623019377.11.0.140969698524.issue44324@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I suspect this is going to be a pain for malformed expressions on the right. For instance: >>> a = {x: for x in {}} File "", line 1 a = {x: for x in {}} ^^^ SyntaxError: expected an expression ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:48:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 06 Jun 2021 22:48:18 +0000 Subject: [issue44325] IDLE: Fix shell comment anomalies In-Reply-To: <1623012290.47.0.522226397666.issue44325@roundup.psfhosted.org> Message-ID: <1623019698.66.0.128587266405.issue44325@roundup.psfhosted.org> Terry J. Reedy added the comment: I added debug prints to _maybe_compile and confirmed 1) trailing whitespace (' ' and '\t' at least) is removed before this function is called. I presume in IDLE rather than code.II, but cannot find where. It is not with .rstrip. (Note: doing so after '\' is a bug in that it lets buggy input such as 'a\ \n + 2' run instead of raising.) 2. code is otherwise delivered intact and blanks lines become 'pass'. Thus any difference noted above is not due to compile(). The report was based on Windows with 3.9.5, 3.10.0b2, and fresh main. I repeated the Shell experiments on a Mac Airbook, and a slower machine, with 3.10.b1. There was never a spurious ... -- once the proper >>> was printed. However, I sometimes saw ... appear very briefly, only to be overwritten with >>>. (I saw this once, *very briefly*, on Windows with main, on the first comment I tried.) I also saw ... appear and disappear when there was a SyntaxError or print output. I suspect that Sidebar always adds ..., only to be deleted or overwritten when it is a mistake. I then tried 3.9.5 on the Mac and saw a spurious blank line with ' # a' once, on the first try, but not again in several attempts. There seems to be a 'warmup' effect. My conclusion so far: sidebar might be a culprit, but because of the 3.9 behavior, I think it more likely a victim of pyshell prematurely marking the new line as a possible continuation line. As long as there was not continuation prompt, this might seem innocuous. But it might also be a factor in other spurious blank lines. In particular, >>> if 1: # Hit return on indented line. ... print(2) ... ... < undeleted 4 space indent 2 >>> if 1: # Delete indent first. Get proper behavior. ... print(2) ... 2 >>> I am stopping here. Tal, what do you think with your better knowledge of pyshell internals? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 18:58:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 22:58:55 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1623020335.21.0.00502387742371.issue44087@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25156 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26567 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:14:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 23:14:53 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623021293.28.0.0385373667679.issue44329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > will avoid unneeded allocations/GC tracking, I am not sure what you mean, in the happy path you still need to GC track and allocate. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:18:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 23:18:45 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623021525.87.0.755601276948.issue44329@roundup.psfhosted.org> Erlend E. Aasland added the comment: > I am not sure what you mean, in the happy path you still need to GC track and allocate. Currently, we allocate the object, then try to create the statement using the SQLite API. If we create the statement first, we can do the sanity check on the return value and just return NULL; then we can allocate the Py object and initialise the members. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:20:14 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 23:20:14 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623021614.45.0.902888561651.issue44329@roundup.psfhosted.org> Erlend E. Aasland added the comment: ... to expand: so currently, if statement creation fails, we must deallocate the PyObject. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:27:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 06 Jun 2021 23:27:30 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623022050.34.0.394705492277.issue44329@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ah, I see I formulated myself a bit unclear: Yes, we need to allocate/track every time. I just propose to do so as late as possible, in order to avoid allocating a PyObject before we know if it is possible to actually create the statement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:34:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 23:34:57 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623022497.67.0.701372562677.issue44329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Yes, we need to allocate/track every time. I just propose to do so as late as possible, in order to avoid allocating a PyObject before we know if it is possible to actually create the statement. That describes much better the intent :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:42:37 2021 From: report at bugs.python.org (Arjun) Date: Sun, 06 Jun 2021 23:42:37 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623022957.88.0.314706956468.issue44324@roundup.psfhosted.org> Arjun added the comment: > This one will be very tricky to do correctly because the '=' is very context-sensitive and the parser can be confused when backtracking, so this *may* be quite delicate/complex Well, I was thinking we could just do a simple check in _PyPegen_check_tokenizer_errors or _PyPegen_run_parser functions. If the last three tokens in the Parser object's tokens array are NAME, EQUAL/MINEQUAL/etc and NEWLINE, we raise the special error. Is this the right way to do it? I saw that unclosed parentheses' special error are checked in the same place. > I suspect this is going to be a pain for malformed expressions on the right Yea, I realized that the "expected an expression" error can be used in multiple places. Could be added one by one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:52:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 23:52:11 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623023531.92.0.69695749892.issue44324@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >> Well, I was thinking we could just do a simple check in _PyPegen_check_tokenizer_errors or _PyPegen_run_parser functions. If the last three tokens in the Parser object's tokens array are NAME, EQUAL/MINEQUAL/etc and NEWLINE, we raise the special error. Is this the right way to do it? I saw that unclosed parentheses' special error are checked in the same place. I find that quite inelegant and error prone. A PEG parser is not assured to finish when you think it will finish as it can backtrack and expand to parse left recursive rules. Incorrect syntax must be handled by the parser itself using the parser process, not after the fact. Once the parser has finished, the semantic information is gone and you are left with unstructured tokens. > Yea, I realized that the "expected an expression" error can be used in multiple places. Could be added one by one? Not sure what you mean here, but this should be added in a single place related to the assignment rule, otherwise is going to be quite difficult to maintain. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:57:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 06 Jun 2021 23:57:10 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623023830.0.0.821178379845.issue44324@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I saw that unclosed parentheses' special error are checked in the same place. Just to clarify: unclosed parentheses is a tokenizer error, not a parser error and this is handled by checking the tokenize status when it has already failed. The reason is done after the failed parser is because our tokenizer is made lazy and to check for unclosed pantheses you need to fully parse everything, and this needs a driver. There is no semantic analysis here, just checking the lexer status: that's why is handled separately ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:57:28 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 06 Jun 2021 23:57:28 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623023848.97.0.860366308835.issue41299@roundup.psfhosted.org> Change by Ryan Hileman : ---------- keywords: +patch pull_requests: +25157 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26568 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 19:58:51 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sun, 06 Jun 2021 23:58:51 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623023931.22.0.810430702274.issue41299@roundup.psfhosted.org> Ryan Hileman added the comment: Ok, I filed a PR for this. I used pytime's interface to avoid duplicating the QueryPerformanceFrequency() code. I found a StackOverflow answer that says QueryPerformance functions will only fail if you pass in an unaligned pointer: https://stackoverflow.com/a/27258700 Per that, I used Py_FatalError to catch this case, as there is probably something wrong with the compiler at that point, and the other recovery options would be likely to result in incorrect program behavior (e.g. dead lock). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 21:05:26 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 07 Jun 2021 01:05:26 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623027926.1.0.0182269484934.issue44328@roundup.psfhosted.org> Ryan Hileman added the comment: I found these two references: - https://stackoverflow.com/questions/35601880/windows-timing-drift-of-performancecounter-c - https://bugs.python.org/issue10278#msg143209 Which suggest QueryPerformanceCounter() may be bad because it can drift. However, these posts are fairly old and the StackOverflow post also says the drift is small on newer hardware / Windows. Microsoft's current stance is that QueryPerformanceCounter() is good: https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps > Guidance for acquiring time stamps > Windows has and will continue to invest in providing a reliable and efficient performance counter. When you need time stamps with a resolution of 1 microsecond or better and you don't need the time stamps to be synchronized to an external time reference, choose QueryPerformanceCounter I looked into how a few other languages provide monotonic time on Windows: Golang seems to read the interrupt time (presumably equivalent to QueryInterruptTime) directly by address. https://github.com/golang/go/blob/a3868028ac8470d1ab7782614707bb90925e7fe3/src/runtime/sys_windows_amd64.s#L499 Rust uses QueryPerformanceCounter: https://github.com/rust-lang/rust/blob/38ec87c1885c62ed8c66320ad24c7e535535e4bd/library/std/src/time.rs#L91 V8 uses QueryPerformanceCounter after checking for old CPUs: https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021d964952728/src/base/platform/time.cc#L672 Ruby uses QueryPerformanceCounter: https://github.com/ruby/ruby/blob/44cff500a0ad565952e84935bc98523c36a91b06/win32/win32.c#L4712 C# implements QueryPerformanceCounter on other platforms using CLOCK_MONOTONIC, indicating that they should be roughly equivalent: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/src/coreclr/pal/src/misc/time.cpp#L175 Swift originally used QueryPerformanceCounter, but switched to QueryUnbiasedInterruptTime() because they didn't want to count time the system spent asleep: https://github.com/apple/swift-corelibs-libdispatch/commit/766d64719cfdd07f97841092bec596669261a16f ------ Note that none of these languages use GetTickCount64(). Swift is an interesting counter point, and I noticed QueryUnbiasedInterruptTime() is available on Windows 8 while QueryInterruptTime() is new as of Windows 10. The "Unbiased" just refers to whether it advances during sleep. I'm not actually sure whether time.monotonic() in Python counts time spent asleep, or whether that's desirable. Some kinds of timers using monotonic time should definitely freeze during sleep so they don't cause a flurry of activity on wake, but others definitely need to roughly track wall clock time, even during sleep. Perhaps the long term answer would be to introduce separate "asleep" and "awake" monotonic clocks in Python, and possibly deprecate perf_counter() if it's redundant after this (as I think it's aliased to monotonic() on non-Windows platforms anyway). ---------- title: time.monotonic() should use QueryPerformanceCounter() on Windows -> time.monotonic() should use a different clock source on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 21:41:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 01:41:12 +0000 Subject: [issue44330] IDLE: Colorizer test hangs on macOS Message-ID: <1623030071.98.0.487829717412.issue44330@roundup.psfhosted.org> New submission from Terry J. Reedy : Ned, have you seen or heard anything about tkinter/tk8.6.11 freezing on macOS? It is happening in many places. On my MacBook, python3.9 -m test -ugui -v test_idle runs OK in about 10 seconds. With installed python3.10.0b2, it runs test_colorizer ColorCongigTest, ColorDelagatorInstantionTest, and ColorDelagatorTest.test_LoadTagDefs. It hangs on test_case_soft_keyword, which is new in 3.10 for the new match statement soft keywords. With added skips, it hangs on test_def_statement test_incremental_editing test_match_soft_keyword test_recolorize_main test_removecolors and then test_colorizer passes. At this point, I thought the problem was the fancy new test methods and helpers. But running test_idle again, test_outwin.OutputWindowTest.test_goto_file_line (line 105) hangs displaying a blank window. The test writes something at 115 which did not appear. However, debug prints indicate that it is the 2nd write, about 121, that does not return. The write method just inserts into the text widget. Nothing apparently fancy. The failure is deterministic (over 10 times). In 3.9.5, the same test and all of test_idle ran OK 3 times. Adding .update() and .update_idletasks() before the write did nothing. Making this test method fail before the write, let the test continue until it hung in test_write. The problem seems to be in the test environment. Tests of match, case, and _ in Shell looked corrected. Grepping idlelib for 'tkinter' returned 222 hits and multiple gotos for different files and lines within a file worked normally. ---------- messages: 395239 nosy: ned.deily, taleinat, terry.reedy priority: normal severity: normal status: open title: IDLE: Colorizer test hangs on macOS versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 21:41:37 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 01:41:37 +0000 Subject: [issue44330] IDLE: Colorizer and output tests hang on macOS In-Reply-To: <1623030071.98.0.487829717412.issue44330@roundup.psfhosted.org> Message-ID: <1623030097.79.0.807126485216.issue44330@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: IDLE: Colorizer test hangs on macOS -> IDLE: Colorizer and output tests hang on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 21:42:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 01:42:40 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623030160.44.0.245753166164.issue44322@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 67dfa6f2a508c325715625fe442f2ce20270a8b3 by Terry Jan Reedy in branch 'main': bpo-44322: Document more SyntaxError details. (GH-26562) https://github.com/python/cpython/commit/67dfa6f2a508c325715625fe442f2ce20270a8b3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 21:42:49 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Jun 2021 01:42:49 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623030169.61.0.475871349216.issue44322@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25159 pull_request: https://github.com/python/cpython/pull/26569 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:08:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 02:08:30 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623031710.12.0.0652200298236.issue44322@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +25160 pull_request: https://github.com/python/cpython/pull/26570 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:09:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 02:09:43 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623031783.85.0.288338486588.issue44322@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 2af690fdb26d0312de056b54ddb113d3c44dee8c by Miss Islington (bot) in branch '3.10': bpo-44322: Document more SyntaxError details. (GH-26562) https://github.com/python/cpython/commit/2af690fdb26d0312de056b54ddb113d3c44dee8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:14:53 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 07 Jun 2021 02:14:53 +0000 Subject: [issue37449] Move ensurepip off of pkgutil and to importlib.resources In-Reply-To: <1561860772.49.0.185483718697.issue37449@roundup.psfhosted.org> Message-ID: <1623032093.9.0.54602971814.issue37449@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset afb2eed72b32a35b4726ff35f92e4fbf54926046 by wim glenn in branch 'main': bpo-37449: ensurepip uses importlib.resources.files() traversable APIs (#22659) https://github.com/python/cpython/commit/afb2eed72b32a35b4726ff35f92e4fbf54926046 ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:41:46 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 07 Jun 2021 02:41:46 +0000 Subject: [issue44331] Generate static PyCodeObjects for faster startup Message-ID: <1623033706.49.0.452269314092.issue44331@roundup.psfhosted.org> New submission from Neil Schemenauer : Note: This is a proof of concept and not ready for merging as is. This is based on 'frozen_modules' from Jeethu Rao , via Larry Hastings. Larry's git branch was: git at github.com:larryhastings/cpython.git not_another_use_of_the_word_frozen Usage: - Compile Python as normal - Run "make regen-freeze-startup" to re-generate Python/frozenmodules_code.c - Compile Python a second time Changes from Larry's branch: - Move static C code generation tool to Tools/freeze2 - Move _serializer to Modules - Rebase on Python 3.10.0b1 - determine startup modules by running sys.executable - use importlib.util.find_spec() to get code objects - fix ref-counting when setting __path__ - put static frozen modules in frozen_code_objects dict - reduce set of "bad" modules as it seems only _collections_abc needs exclusion - fix the is_frozen_package() and is_frozen() functions to find static frozen code It's not passing all unit tests yet but I'm somewhat hopeful there are no deep problems. Porting the changes from 3.6 to 3.8 and then to 3.10 was not too horrible. There was a few changes to PyGC_Head, to the PyCodeObject structure and to the runtime initialization process. That gives me some hope that it wouldn't be too burdensome to maintain this in the long-term. Mostly it would be updating _serialize.c to keep up with PyCodeObject changes. Based on benchmarking with 3.8, this gives a decent speedup for startup of a trival program, e.g. python -c "True". I measure it as taking 76% of the time. The savings are mostly in marshal.c but there is also some importlib/filesystem overhead that's removed. ---------- messages: 395243 nosy: nascheme priority: low severity: normal stage: patch review status: open title: Generate static PyCodeObjects for faster startup type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:42:59 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 07 Jun 2021 02:42:59 +0000 Subject: [issue44331] Generate static PyCodeObjects for faster startup In-Reply-To: <1623033706.49.0.452269314092.issue44331@roundup.psfhosted.org> Message-ID: <1623033779.6.0.788540162338.issue44331@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- keywords: +patch pull_requests: +25161 pull_request: https://github.com/python/cpython/pull/26571 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 6 22:57:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 02:57:56 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623034676.64.0.720780862828.issue44322@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset d5f8bd60e1203a41996b3ee370d6f09389070627 by Terry Jan Reedy in branch '3.9': [3.9] bpo-44322: Document more SyntaxError details. (GH-26562) https://github.com/python/cpython/commit/d5f8bd60e1203a41996b3ee370d6f09389070627 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 00:38:43 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Mon, 07 Jun 2021 04:38:43 +0000 Subject: [issue41391] Make test_unicodedata pass when running without network In-Reply-To: <1595672814.77.0.412111562602.issue41391@roundup.psfhosted.org> Message-ID: <1623040723.46.0.596424049011.issue41391@roundup.psfhosted.org> Chih-Hsuan Yen added the comment: Closing in favor of a simpler fix merged from issue43144. Thanks for the fix! ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 00:56:39 2021 From: report at bugs.python.org (Debasis Satapathy) Date: Mon, 07 Jun 2021 04:56:39 +0000 Subject: [issue44332] For Loop temporary variable scope should be local to For loop Message-ID: <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org> New submission from Debasis Satapathy : numbers = [1, 2, 3, 4, 5, 6, 7, 8] for x in numbers: print(x) print(x) In the above code, print(x) statement should give error. Because x scope should be local to for loop only. 99% cases, developers will not use the temporary variable x outside of the for loop. So x will keep on consuming memory always. So it is a bad usage of memory. Ideally x memory should be free once for loop execution is completed. ---------- components: Library (Lib) messages: 395246 nosy: deb_ctc priority: normal severity: normal status: open title: For Loop temporary variable scope should be local to For loop type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 01:24:11 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 05:24:11 +0000 Subject: [issue44322] Document SyntaxError args and interpretation for f-string fields In-Reply-To: <1623002882.29.0.18089696259.issue44322@roundup.psfhosted.org> Message-ID: <1623043451.21.0.192224047496.issue44322@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 Mon Jun 7 01:43:32 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 07 Jun 2021 05:43:32 +0000 Subject: [issue44332] For Loop temporary variable scope should be local to For loop In-Reply-To: <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org> Message-ID: <1623044612.05.0.220372511122.issue44332@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug, it is intentional design and has been since Python 1. You are incorrect about x consuming memory "always". If the value bound to x is in use elsewhere, deleting x will save no memory. If the value is not in use elsewhere, it will be garbage collected as soon as x goes out of scope, which will be at the end of the function. Shifting to block-scope for for-loops has been discussed before, it is not a popular idea and I expect that most people will oppose it. You can search the Python-Ideas mailing list if you want to find out more. If you still feel strongly that this is an enhancement, as it is a major change in language behaviour it would require a PEP to be written. https://www.python.org/dev/peps/pep-0001/ Even if the PEP was accepted, the earliest it could go into the language would be Python 3.11 or better, and that would likely require a special `__future__` import. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 01:45:45 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 07 Jun 2021 05:45:45 +0000 Subject: [issue44332] For Loop temporary variable scope should be local to For loop In-Reply-To: <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org> Message-ID: <1623044745.25.0.201873892779.issue44332@roundup.psfhosted.org> Steven D'Aprano added the comment: By the way, loop variables are not considered to be "temporary" in Python. They are no more temporary than any other local variable -- they *are* local variables with exactly the same scope and lifetime as all other local variables. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 02:54:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Jun 2021 06:54:54 +0000 Subject: [issue44323] install module fail on windows 10 In-Reply-To: <1623008431.46.0.342907692424.issue44323@roundup.psfhosted.org> Message-ID: <1623048894.58.0.918715247812.issue44323@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: insttall module faid on wondows 10 -> install module fail on windows 10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 02:58:19 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 07 Jun 2021 06:58:19 +0000 Subject: [issue44332] For Loop temporary variable scope should be local to For loop In-Reply-To: <1623041799.48.0.127398218724.issue44332@roundup.psfhosted.org> Message-ID: <1623049099.5.0.561293042562.issue44332@roundup.psfhosted.org> Change by Mark Dickinson : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 03:06:42 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 07 Jun 2021 07:06:42 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1623049602.01.0.771552738555.issue44258@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 89e50ab36fac6a0e7f1998501f36fcd2872a6604 by Sergey B Kirpichev in branch 'main': bpo-44258: support PEP 515 for Fraction's initialization from string (GH-26422) https://github.com/python/cpython/commit/89e50ab36fac6a0e7f1998501f36fcd2872a6604 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 03:07:33 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 07 Jun 2021 07:07:33 +0000 Subject: [issue44258] Support PEP 515 for Fraction's initialization from string In-Reply-To: <1622180851.71.0.222300329356.issue44258@roundup.psfhosted.org> Message-ID: <1623049653.98.0.213985651329.issue44258@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 03:33:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 07 Jun 2021 07:33:49 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1623051229.64.0.363028054321.issue44317@roundup.psfhosted.org> Serhiy Storchaka added the comment: See also issue43833. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 04:02:22 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Mon, 07 Jun 2021 08:02:22 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623052942.47.0.929011029302.issue38323@roundup.psfhosted.org> Change by Shreyan Avigyan : ---------- pull_requests: +25162 pull_request: https://github.com/python/cpython/pull/26574 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 04:12:07 2021 From: report at bugs.python.org (Kuldeep Daksh) Date: Mon, 07 Jun 2021 08:12:07 +0000 Subject: [issue44333] Segmentation fault Message-ID: <1623053527.52.0.368644825796.issue44333@roundup.psfhosted.org> New submission from Kuldeep Daksh : I am getting Segmentation fault when i run server.starttls() method. ---------- components: Library (Lib) files: segment_fault.png messages: 395251 nosy: mechatronickuldeep priority: normal severity: normal status: open title: Segmentation fault versions: Python 3.6 Added file: https://bugs.python.org/file50094/segment_fault.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 04:33:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Jun 2021 08:33:20 +0000 Subject: [issue44331] Generate static PyCodeObjects for faster startup In-Reply-To: <1623033706.49.0.452269314092.issue44331@roundup.psfhosted.org> Message-ID: <1623054800.44.0.1847782506.issue44331@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 04:50:36 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Jun 2021 08:50:36 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623053527.52.0.368644825796.issue44333@roundup.psfhosted.org> Message-ID: <1623055836.25.0.97234473141.issue44333@roundup.psfhosted.org> Eric V. Smith added the comment: Python 3.6 is no longer supported. Please try to reproduce this with python 3.8 or 3.9. Without seeing the code that causes the failure, it's not possible for us to provide any help. Please try to reproduce the code with the smallest possible example and include the code here. Please do not post images, as they make it impossible for us to copy and paste from the file you upload. They also make it difficult for visually impaired people to read them. ---------- nosy: +eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 04:58:54 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 07 Jun 2021 08:58:54 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1623056334.09.0.224792714317.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +25163 pull_request: https://github.com/python/cpython/pull/26575 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 05:00:48 2021 From: report at bugs.python.org (Kuldeep Daksh) Date: Mon, 07 Jun 2021 09:00:48 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623055836.25.0.97234473141.issue44333@roundup.psfhosted.org> Message-ID: Kuldeep Daksh added the comment: I am not getting this error when I run same code in other window. I am not able to get why this is happening. On Mon, Jun 7, 2021, 14:20 Eric V. Smith wrote: > > Eric V. Smith added the comment: > > Python 3.6 is no longer supported. Please try to reproduce this with > python 3.8 or 3.9. > > Without seeing the code that causes the failure, it's not possible for us > to provide any help. Please try to reproduce the code with the smallest > possible example and include the code here. > > Please do not post images, as they make it impossible for us to copy and > paste from the file you upload. They also make it difficult for visually > impaired people to read them. > > ---------- > nosy: +eric.smith > status: open -> pending > > _______________________________________ > Python tracker > > _______________________________________ > ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 05:12:05 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Jun 2021 09:12:05 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623053527.52.0.368644825796.issue44333@roundup.psfhosted.org> Message-ID: <1623057125.7.0.693584089939.issue44333@roundup.psfhosted.org> Eric V. Smith added the comment: If you can't provide any more information, we can't help you and I'll have to close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 05:14:17 2021 From: report at bugs.python.org (Kuldeep Daksh) Date: Mon, 07 Jun 2021 09:14:17 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623057125.7.0.693584089939.issue44333@roundup.psfhosted.org> Message-ID: Kuldeep Daksh added the comment: I am having lunch right now.after lunch I will give you the information. On Mon, Jun 7, 2021, 14:42 Eric V. Smith wrote: > > Eric V. Smith added the comment: > > If you can't provide any more information, we can't help you and I'll have > to close this issue. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 05:50:39 2021 From: report at bugs.python.org (Kuldeep Daksh) Date: Mon, 07 Jun 2021 09:50:39 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: Message-ID: Kuldeep Daksh added the comment: I run same code on different window with python3.6. at other place smtp working in a right way but as I run it in my project its still giving the error. please find the attachment of my code. On Mon, 7 Jun 2021 at 14:44, Kuldeep Daksh wrote: > > Kuldeep Daksh added the comment: > > I am having lunch right now.after lunch I will give you the information. > > On Mon, Jun 7, 2021, 14:42 Eric V. Smith wrote: > > > > > Eric V. Smith added the comment: > > > > If you can't provide any more information, we can't help you and I'll > have > > to close this issue. > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- Added file: https://bugs.python.org/file50095/alert_emailer.py _______________________________________ Python tracker _______________________________________ -------------- next part -------------- import os import inspect import logging import smtplib,ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from jinja2 import FileSystemLoader, Environment from alerts.models.alert_rule import AlertRule from alerts.models.user import User from alerts.models.asset import Asset from alerts.repositories.user_alert_email_count_repo import UserAlertEmailCountRepository class AlertEmailer: __instance = None __config = None __from = None __pwd = None __server = None __image_url = 'https://s3-us-west-2.amazonaws.com/s3-us-west-2.amazonaws.com.public-images/alert.png' __user_email_count_repo = None @staticmethod def getInstance(config): if AlertEmailer.__instance == None: AlertEmailer(config) return AlertEmailer.__instance def __init__(self, config): self.logger = logging.getLogger(__name__) if self.__config is None: self.__config = config self.context = ssl.create_default_context() with smtplib.SMTP_SSL("smtp.gmail.com", 465, context=self.context) as server: self.__from = config.email_from self.__pwd = config.email_from_pwd server.login(self.__from, self.__pwd) if self.__user_email_count_repo is None: self.__user_email_count_repo = UserAlertEmailCountRepository(self.__config) if AlertEmailer.__instance is not None: raise Exception("This class is a singleton class!") else: AlertEmailer.__instance = self def send_email(self, title: str, al_msg: str, alert_rule: AlertRule): users = alert_rule.get_users() if len(users) > 0: recipients = [] for user in users: if user.is_email_alerts_enabled(): self.logger.info(user.get_email()) if alert_rule.is_critical(): recipients.append(user.get_email()) elif self.__should_send_alert_email(user, alert_rule): recipients.append(user.get_email()) if len(recipients) > 0: self.__send_default(title, al_msg, recipients) else: self.logger.info("No recipient for sending email.") def send_fault_alert_email(self, title: str, al_msg: str, asset: Asset): users = ["ksingh at sensegrow.com"] if (len(users) > 0): recipients = ["ksingh at sensegrow.com"] # for user in users: # self.logger.info(user.get_email()) # recipients.append(user.get_email()) self.__send_default(title, al_msg, recipients) else: self.logger.info("No recipient for sending email.") def __should_send_alert_email(self, user: User, alert_rule: AlertRule): try: alert_count = self.__user_email_count_repo.get_alert_rule_count(user, alert_rule) alert_group_count = self.__user_email_count_repo.get_alert_rule_group_count(user, alert_rule) if user.get_alert_msg_rate_limit_throttle() > alert_count: if alert_group_count < 1: self.__user_email_count_repo.update_count(user, alert_rule); return True return False except Exception as ex: self.logger.error(ex) return False def __send_default(self, title: str, al_msg: str, recipients): current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) file_name = 'alert_email_template.html' template_loader = FileSystemLoader(searchpath=current_dir) template_env = Environment(loader=template_loader) template = template_env.get_template(file_name) message = template.render(img_url=self.__image_url, heading=title, message=al_msg) body = MIMEText(message, 'html') msg = MIMEMultipart('alternative') msg['Subject'] = 'ioEYE Predict : ' + title msg['From'] = self.__from msg['To'] = ", ".join(recipients) msg.attach(body) self.__server.sendmail(self.__from, recipients, msg.as_string()) self.logger.info("Email send successfully.") def send_test_email(self): recipients = ["ksingh at sensegrow.com", "ksingh+p3 at sensegrow.com"] print(", ".join(recipients)) heading = 'RMS Velocity' al_msg = 'Motor-2 (sfrasdf) located at CP RMS Velocity axis H reading 9.85 mm/sec at 2020-02-13 13:03:52 PM has exceeded the threshold of 4.5 mm/sec .' current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) file_name = 'alert_email_template.html' template_loader = FileSystemLoader(searchpath=current_dir) template_env = Environment(loader=template_loader) template = template_env.get_template(file_name) message = template.render(img_url=self.__image_url, heading=heading, message=al_msg) HTML_BODY = MIMEText(message, 'html') msg = MIMEMultipart('alternative') msg['Subject'] = 'ioEYE Predict : ' + 'High Acc Alert!' msg['From'] = self.__from msg['To'] = ", ".join(recipients) msg.attach(HTML_BODY) self.__server.sendmail(self.__from, recipients, msg.as_string()) self.logger.info("Email send successfully.") From report at bugs.python.org Mon Jun 7 05:51:46 2021 From: report at bugs.python.org (Kuldeep Daksh) Date: Mon, 07 Jun 2021 09:51:46 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: Message-ID: Kuldeep Daksh added the comment: Please ignore previous attachment and find new one. On Mon, 7 Jun 2021 at 15:20, Kuldeep Daksh wrote: > I run same code on different window with python3.6. at other place smtp > working in a right way but as I run it in my project its still giving the > error. please find the attachment of my code. > > On Mon, 7 Jun 2021 at 14:44, Kuldeep Daksh wrote: > >> >> Kuldeep Daksh added the comment: >> >> I am having lunch right now.after lunch I will give you the information. >> >> On Mon, Jun 7, 2021, 14:42 Eric V. Smith wrote: >> >> > >> > Eric V. Smith added the comment: >> > >> > If you can't provide any more information, we can't help you and I'll >> have >> > to close this issue. >> > >> > ---------- >> > >> > _______________________________________ >> > Python tracker >> > >> > _______________________________________ >> > >> >> ---------- >> >> _______________________________________ >> Python tracker >> >> _______________________________________ >> > ---------- Added file: https://bugs.python.org/file50096/alert_emailer.py _______________________________________ Python tracker _______________________________________ -------------- next part -------------- import os import inspect import logging import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from jinja2 import FileSystemLoader, Environment from alerts.models.alert_rule import AlertRule from alerts.models.user import User from alerts.models.asset import Asset from alerts.repositories.user_alert_email_count_repo import UserAlertEmailCountRepository class AlertEmailer: __instance = None __config = None __from = None __pwd = None __server = None __image_url = 'https://s3-us-west-2.amazonaws.com/s3-us-west-2.amazonaws.com.public-images/alert.png' __user_email_count_repo = None @staticmethod def getInstance(config): if AlertEmailer.__instance == None: AlertEmailer(config) return AlertEmailer.__instance def __init__(self, config): self.logger = logging.getLogger(__name__) if self.__config is None: self.__config = config if self.__server is None: self.__server = smtplib.SMTP('smtp.gmail.com', 587) self.__server.starttls() self.__from = config.email_from self.__pwd = config.email_from_pwd self.__server.login(self.__from, self.__pwd) if self.__user_email_count_repo is None: self.__user_email_count_repo = UserAlertEmailCountRepository(self.__config) if AlertEmailer.__instance is not None: raise Exception("This class is a singleton class!") else: AlertEmailer.__instance = self def send_email(self, title: str, al_msg: str, alert_rule: AlertRule): users = alert_rule.get_users() if len(users) > 0: recipients = [] for user in users: if user.is_email_alerts_enabled(): self.logger.info(user.get_email()) if alert_rule.is_critical(): recipients.append(user.get_email()) elif self.__should_send_alert_email(user, alert_rule): recipients.append(user.get_email()) if len(recipients) > 0: self.__send_default(title, al_msg, recipients) else: self.logger.info("No recipient for sending email.") def send_fault_alert_email(self, title: str, al_msg: str, asset: Asset): users = ["ksingh at sensegrow.com"] if (len(users) > 0): recipients = ["ksingh at sensegrow.com"] # for user in users: # self.logger.info(user.get_email()) # recipients.append(user.get_email()) self.__send_default(title, al_msg, recipients) else: self.logger.info("No recipient for sending email.") def __should_send_alert_email(self, user: User, alert_rule: AlertRule): try: alert_count = self.__user_email_count_repo.get_alert_rule_count(user, alert_rule) alert_group_count = self.__user_email_count_repo.get_alert_rule_group_count(user, alert_rule) if user.get_alert_msg_rate_limit_throttle() > alert_count: if alert_group_count < 1: self.__user_email_count_repo.update_count(user, alert_rule); return True return False except Exception as ex: self.logger.error(ex) return False def __send_default(self, title: str, al_msg: str, recipients): current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) file_name = 'alert_email_template.html' template_loader = FileSystemLoader(searchpath=current_dir) template_env = Environment(loader=template_loader) template = template_env.get_template(file_name) message = template.render(img_url=self.__image_url, heading=title, message=al_msg) body = MIMEText(message, 'html') msg = MIMEMultipart('alternative') msg['Subject'] = 'ioEYE Predict : ' + title msg['From'] = self.__from msg['To'] = ", ".join(recipients) msg.attach(body) self.__server.sendmail(self.__from, recipients, msg.as_string()) self.logger.info("Email send successfully.") def send_test_email(self): recipients = ["ksingh at sensegrow.com","ksingh+p3 at sensegrow.com"] print(", ".join(recipients)) heading = 'RMS Velocity' al_msg = 'Motor-2 (sfrasdf) located at CP RMS Velocity axis H reading 9.85 mm/sec at 2020-02-13 13:03:52 PM has exceeded the threshold of 4.5 mm/sec .' current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) file_name = 'alert_email_template.html' template_loader = FileSystemLoader(searchpath=current_dir) template_env = Environment(loader=template_loader) template = template_env.get_template(file_name) message = template.render(img_url=self.__image_url,heading=heading,message=al_msg) HTML_BODY = MIMEText(message, 'html') msg = MIMEMultipart('alternative') msg['Subject'] = 'ioEYE Predict : ' + 'High Acc Alert!' msg['From'] = self.__from msg['To'] = ", ".join(recipients) msg.attach(HTML_BODY) self.__server.sendmail(self.__from, recipients, msg.as_string()) self.logger.info("Email send successfully.") From report at bugs.python.org Mon Jun 7 06:39:52 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 07 Jun 2021 10:39:52 +0000 Subject: [issue44325] IDLE: Fix shell comment anomalies In-Reply-To: <1623012290.47.0.522226397666.issue44325@roundup.psfhosted.org> Message-ID: <1623062392.11.0.865655964092.issue44325@roundup.psfhosted.org> Tal Einat added the comment: > 1) trailing whitespace (' ' and '\t' at least) is removed before this function is called. I presume in IDLE rather than code.II, but cannot find where. It is not with .rstrip. You're probably looking for this code in EditorWindow.newline_and_indent_event(): # Strip whitespace after insert point. while text.get("insert") in " \t": text.delete("insert") See: https://github.com/python/cpython/blob/89e50ab36fac6a0e7f1998501f36fcd2872a6604/Lib/idlelib/editor.py#L1390 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 06:41:31 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 07 Jun 2021 10:41:31 +0000 Subject: [issue44325] IDLE: Fix shell comment anomalies In-Reply-To: <1623012290.47.0.522226397666.issue44325@roundup.psfhosted.org> Message-ID: <1623062491.24.0.799521360899.issue44325@roundup.psfhosted.org> Tal Einat added the comment: > However, I sometimes saw ... appear very briefly, only to be overwritten with >>>. This is a known limitation of the current sidebar implementation, which was very difficult to avoid and was considered minor enough to let be for now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 06:44:58 2021 From: report at bugs.python.org (Tal Einat) Date: Mon, 07 Jun 2021 10:44:58 +0000 Subject: [issue44325] IDLE: Fix shell comment anomalies In-Reply-To: <1623012290.47.0.522226397666.issue44325@roundup.psfhosted.org> Message-ID: <1623062698.71.0.263798159586.issue44325@roundup.psfhosted.org> Tal Einat added the comment: The sidebar doesn't seem to be causing this issue, it's just making it a bit more visible, since what was previously a blank line now also has a more visible "..." continuation prompt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 06:46:33 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 07 Jun 2021 10:46:33 +0000 Subject: [issue42349] Compiler front-end produces a broken CFG In-Reply-To: <1605288236.63.0.535930114151.issue42349@roundup.psfhosted.org> Message-ID: <1623062793.76.0.0734539895821.issue42349@roundup.psfhosted.org> Mark Shannon added the comment: Basic blocks have only a single exit, at the end. https://en.wikipedia.org/wiki/Basic_block If the devguide says otherwise it is wrong. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 08:38:14 2021 From: report at bugs.python.org (Muralidhar BN) Date: Mon, 07 Jun 2021 12:38:14 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module In-Reply-To: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> Message-ID: <1623069494.92.0.703556953556.issue44226@roundup.psfhosted.org> Muralidhar BN added the comment: Dear Eric Smith, Do we have any analysis for this issue for information shared ? Appreciate your quick reply. PS: Making a simple socket connection instead of paramiko or pyssh ssh connection gives similar error Thank you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 08:57:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Jun 2021 12:57:09 +0000 Subject: [issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module In-Reply-To: <1621882516.37.0.78116563301.issue44226@roundup.psfhosted.org> Message-ID: <1623070629.77.0.219419700006.issue44226@roundup.psfhosted.org> Eric V. Smith added the comment: No, I'm sorry that I don't. The example is too large for me (or probably any of our volunteers) to look through and reason about. I think asking on a forum like Stack Overflow is your best bet, but even there they will ask for a simpler example. Or maybe try the python-list mailing list https://mail.python.org/mailman/listinfo/python-list. If you could get this down to a 10 to 20 line example, maybe we could determine here if it's a python bug, or a deliberate change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 08:58:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 07 Jun 2021 12:58:09 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623053527.52.0.368644825796.issue44333@roundup.psfhosted.org> Message-ID: <1623070689.77.0.457578551545.issue44333@roundup.psfhosted.org> Eric V. Smith added the comment: The code you've attached doesn't generate the error you provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 10:08:45 2021 From: report at bugs.python.org (Anders Munch) Date: Mon, 07 Jun 2021 14:08:45 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623074925.25.0.615232437352.issue44283@roundup.psfhosted.org> Anders Munch added the comment: Are you sure you want to do this? This optimisation is not applicable if the matched values are given symbolic names. You would be encouraging people to write bad code with lots of literals, for speed. ---------- nosy: +AndersMunch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 10:48:44 2021 From: report at bugs.python.org (Anthony Sottile) Date: Mon, 07 Jun 2021 14:48:44 +0000 Subject: [issue44295] self.assertDictContainsSubset warning is unhelpful In-Reply-To: <1622676760.31.0.209382096259.issue44295@roundup.psfhosted.org> Message-ID: <1623077324.29.0.899202382078.issue44295@roundup.psfhosted.org> Change by Anthony Sottile : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 11:07:39 2021 From: report at bugs.python.org (Mustafa El Agamey) Date: Mon, 07 Jun 2021 15:07:39 +0000 Subject: [issue44334] urllib cannot parse large data Message-ID: <1623078459.0.0.104370862751.issue44334@roundup.psfhosted.org> Change by Mustafa El Agamey : ---------- components: Extension Modules nosy: eng.mustafaelagamey priority: normal severity: normal status: open title: urllib cannot parse large data type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 11:09:38 2021 From: report at bugs.python.org (Mustafa El Agamey) Date: Mon, 07 Jun 2021 15:09:38 +0000 Subject: [issue44334] urllib.parse.parse_qsl cannot parse large data Message-ID: <1623078578.77.0.440219808954.issue44334@roundup.psfhosted.org> Change by Mustafa El Agamey : ---------- title: urllib cannot parse large data -> urllib.parse.parse_qsl cannot parse large data _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 11:16:13 2021 From: report at bugs.python.org (Mustafa El Agamey) Date: Mon, 07 Jun 2021 15:16:13 +0000 Subject: [issue44334] urllib.parse.parse_qsl cannot parse large data Message-ID: <1623078973.97.0.639122253733.issue44334@roundup.psfhosted.org> Change by Mustafa El Agamey : ---------- keywords: +patch pull_requests: +25164 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26576 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 11:23:56 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 15:23:56 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623079436.43.0.992744736028.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +25165 pull_request: https://github.com/python/cpython/pull/26577 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 12:04:11 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 07 Jun 2021 16:04:11 +0000 Subject: [issue44333] Segmentation fault In-Reply-To: <1623053527.52.0.368644825796.issue44333@roundup.psfhosted.org> Message-ID: <1623081851.38.0.129231554308.issue44333@roundup.psfhosted.org> Zachary Ware added the comment: Your examples appear to use code from outside the standard library, some of which may include C code that will happily segfault your process well outside of Python's control. You'll need to reduce your problem to the smallest possible reproducer (100 lines or less is almost always possible) using no code from outside of the standard library. If you can do so, please reopen this issue with your small reproducer. Until then, though, I'm closing the issue as probably third-party. ---------- nosy: +zach.ware resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:07:47 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 07 Jun 2021 17:07:47 +0000 Subject: [issue44335] "Wrong" invalid character identified Message-ID: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> New submission from Andre Roberge : When using Python 3.10.0b2 on a line with more than one invalid characters, the second one is identified as being incorrect, whereas in previous versions the first such character was identified. > py -3.8 unicode_quote.py File "unicode_quote.py", line 2 a = ? hello ? ? world ? ^ SyntaxError: invalid character in identifier > py -3.9 unicode_quote.py File "C:\...\unicode_quote.py", line 2 a = ? hello ? ? world ? ^ SyntaxError: invalid character '?' (U+00AB) > py -3.10 unicode_quote.py File "C:\...\unicode_quote.py", line 2 a = ? hello ? ? world ? ^ SyntaxError: invalid character '?' (U+00BB) ---------- messages: 395267 nosy: aroberge, pablogsal priority: normal severity: normal status: open title: "Wrong" invalid character identified versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:07:52 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 07 Jun 2021 17:07:52 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit Message-ID: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> New submission from Jeremy Kloth : Currently, a stack overflow is causing the debug build Windows buildbots to abort (bpo-11105). Once the regrtest process is terminated, the buildbot test process hangs indefinitely waiting for handles to be closed (see msg350191 from bpo-37531 for some details). ---------- components: Tests, Windows messages: 395268 nosy: jkloth, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows buildbots hang after fatal exit versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:16:40 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 07 Jun 2021 17:16:40 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1623086200.22.0.415694791039.issue44336@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- keywords: +patch pull_requests: +25166 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:24:36 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 07 Jun 2021 17:24:36 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1623086676.99.0.171065629118.issue44336@roundup.psfhosted.org> Jeremy Kloth added the comment: To verify the PR, can someone please add the test-with-buildbots label on GH? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:38:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 07 Jun 2021 17:38:16 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1623087496.79.0.330097181903.issue44187@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 001eb520b5757294dc455c900d94b7b153de6cdd by Mark Shannon in branch 'main': bpo-44187: Quickening infrastructure (GH-26264) https://github.com/python/cpython/commit/001eb520b5757294dc455c900d94b7b153de6cdd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 13:48:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 07 Jun 2021 17:48:35 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1623088115.39.0.618952554118.issue44187@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 14:03:40 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 07 Jun 2021 18:03:40 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter Message-ID: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> New submission from Mark Shannon : Port the implementation of LOAD_ATTR to the new adaptive interpreter ---------- messages: 395271 nosy: Mark.Shannon priority: normal severity: normal status: open title: Port LOAD_ATTR to adaptive interpreter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 14:04:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 07 Jun 2021 18:04:54 +0000 Subject: [issue44338] Port LOAD_GLOBAL to adaptive interpreter Message-ID: <1623089094.6.0.928459069961.issue44338@roundup.psfhosted.org> New submission from Mark Shannon : Port the implementation of LOAD_GLOBAL to the new adaptive interpreter Once this and https://bugs.python.org/issue44337 are implemented we can remove the old opcache. ---------- messages: 395272 nosy: Mark.Shannon priority: normal severity: normal status: open title: Port LOAD_GLOBAL to adaptive interpreter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 14:22:46 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 18:22:46 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623090166.69.0.046673466723.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6 by Eric Snow in branch 'main': bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577) https://github.com/python/cpython/commit/2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 14:46:14 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Mon, 07 Jun 2021 18:46:14 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1623091574.69.0.27140890538.issue44336@roundup.psfhosted.org> Jeremy Kloth added the comment: The PR has been successfully run on the buildbots. Before: https://buildbot.python.org/all/#/builders/593/builds/58 After: https://buildbot.python.org/all/#/builders/593/builds/59 With these changes, at least now aborted runs can be seen as direct failures of Python's tests instead of just builder exceptions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 14:54:15 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 07 Jun 2021 18:54:15 +0000 Subject: [issue27901] DOC: inspect.ismethod returns different results on the same basic code between Python2.7 Python3.5 In-Reply-To: <1472585181.25.0.672560198795.issue27901@psf.upfronthosting.co.za> Message-ID: <1623092055.77.0.482169329392.issue27901@roundup.psfhosted.org> Andrei Kulakov added the comment: The data model docs still have 2 references to unbound methods: For callables, it may indicate that an instance of the given type (or a subclass) is expected or required as the first positional argument (for example, CPython sets this attribute for unbound methods that are implemented in C). ... Incorrectly attempting to invoke an unbound method of a class in this way is sometimes referred to as ?metaclass confusion?, and is avoided by bypassing the instance when looking up special methods: So the concept of unbound methods is still valid, and in addition I would expect that majority of users think of a method defined in a class as a "method" rather than "function defined in class that will become a method" - perhaps because the former is much shorter ;-) Therefore inspect.ismethod() returning False can easily cause confusion. I think it might be worth adding this note to `ismethod` docs, something like: "While the term 'unbound method' is commonly used for functions defined on class objects, from the point of view of `inspect` it is not a method because the object itself is just a plain function." I can make a PR if this sounds reasonable? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:10:54 2021 From: report at bugs.python.org (=?utf-8?b?54uC55S36aOO?=) Date: Mon, 07 Jun 2021 19:10:54 +0000 Subject: [issue42627] urllib.request.getproxies() misparses Windows registry proxy settings In-Reply-To: <1607804872.9.0.5170746987.issue42627@roundup.psfhosted.org> Message-ID: <1623093054.91.0.758129979481.issue42627@roundup.psfhosted.org> ??? added the comment: We should have no problem with how to parse HTTP proxy and HTTPS proxy. But I recently discovered an additional problem when using `requests`, that is, how to parse the SOCKS proxy correctly. I investigated the parsing of some commonly used software: `curl` will try to read the `all_proxy` variable first, if not, then read the two system environment variables `http_proxy` and `https_proxy`. Only these two environment variables related to proxy exist in most Linux distributions. The following formats are valid for `curl`: ``` export http_proxy=socks4h://127.0.0.1:5050 export https_proxy=socks5://1.1.1.1:4040 ``` The `h` in `socks4h` means doing DNS query on the proxy server. `requests` also follows this format. If you want to use the socks proxy in `requests[socks]`, you need to specify the proxies parameter: ``` proxies['http']='socks4://127.0.0.1:6060' proxies['https']='socks5h://127.0.0.1:7070' ``` Since it is customary to resolve SOCKS proxies in this way, I think CPython can consider doing the same with Windows registry. In previous versions, CPython parsed the SOCKS proxy in the Windows registry `socks=localhost:8080` as: ``` proxies['socks']='socks://localhost:8080' ``` I think it can be changed to ``` proxies['http']=proxies['http'] or'socks4://localhost:8080' proxies['https']=proxies['http'] or'socks4://localhost:8080' proxies['socks']='socks://localhost:8080' ``` The use of `or` is to prevent the existing HTTP and HTTPS proxy settings from being overwritten. I tried it on my Win10 PC. When I set up HTTP and SOCKS proxies at the same time, IE and Edge will use HTTP proxy. The reason using `socks4` instead of `socks4h` or `socks5` is that, when I change system proxy setting to a remote SOCKS proxy, I found that IE and Edge do not query DNS from the proxy but from local DNS polluted by the ISP. And if the running socks proxy version is SOCKS5, it will output errors of `unsupported socks version 0x4`. So Windows only supports the SOCKS proxy `socks4://`. It's a pity that we don't know the code of Windows, and I can't prove it with the codes. `proxies['socks']` is reserved for backward compatibility. If you have any comments or suggestions, please let me know. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:13:36 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 07 Jun 2021 19:13:36 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf Message-ID: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> New submission from Mark Dickinson : For floats x and y, x ** y and math.pow(x, y) mostly agree. There are three points of difference: 1. if x is finite and negative and y is finite and non-integral, then x ** y returns a complex number, while math.pow(x, y) raises ValueError 2. for cases where x ** y raises ZeroDivisionError (for example, 0.0 ** -1.0), math.pow(x, y) raises ValueError instead 3. the special cases 0.0 ** -inf and (-0.0) ** -inf return inf, but the equivalent math.pow calls raise ValueError That third discrepancy is a surprising one: in particular, it's the only case where math.pow does not follow IEEE 754 rules. Note that the math.pow behaviour is not accidental. The special cases were based on C99 Annex F (and are documented to do so), but the standards themselves have evolved here. In chronological order: - IEEE 754-1985 did not cover transcendental functions, so has nothing to say on the topic of special values for pow. - C99 ?F.9.4.4 implies that pow(0, -inf) should raise the "divide-by-zero" exception; the relevant clause covers pow(0, y) for any y satisfying y < 0 and y not an odd integer - IEEE 754-2008 ?9.2.1 has an explicit clause specifying that pow(0, -inf) should be inf and that the operation does not raise any exception. - C11 ?F.10.4.4 mentions the case pow(0, -inf) explicitly and now says "may raise the divide-by-zero floating-point exception". The "may" is significant: other clauses simply say "raises the "divide-by-zero" floating-point exception". - IEEE 754-2019 ?9.2.1 is unchanged from IEEE 754-2008 for this particular special case. - Similarly, C17 is unchanged from C11 in this respect. For Python 3.11, I propose changing the behaviour of math.pow in this corner case so that it returns inf instead of raising. This would make math.pow conformant with IEEE 754, consistent with C11 and later, and consistent with the built-in pow function. ---------- messages: 395277 nosy: mark.dickinson priority: normal severity: normal status: open title: Discrepancy between math.pow(0.0, -inf) and 0.0**-inf versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:14:52 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 07 Jun 2021 19:14:52 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623093292.3.0.313264831922.issue44339@roundup.psfhosted.org> Change by Mark Dickinson : ---------- components: +Library (Lib) type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:30:42 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 07 Jun 2021 19:30:42 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623094242.68.0.941985877551.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: > Are you sure you want to do this? No, not yet. But there has been some positive feedback here, and it seems like an interesting project to prototype. :) > This optimisation is not applicable if the matched values are given symbolic names. You would be encouraging people to write bad code with lots of literals, for speed. I had the same concern initially, but I'm honestly not losing too much sleep over it. Literals already get lots of optimizations that symbolic constants don't, and to me it seems a bit silly to avoid optimizing literals here when it is quite straightforward (and powerful) to do so. There are also many cases where using symbolic constants for certain literals doesn't make much sense. I'd be okay not loudly publicizing this change if it lands. After all, I'm the guy who spent the better part of a year trying to convince people that this is Not A Switch Statement. :) (Although, on the flip side, maybe it will help appease the people who have been asking for one all these years.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:36:01 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Mon, 07 Jun 2021 19:36:01 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1623094561.36.0.749162356744.issue41249@roundup.psfhosted.org> Nils Kattenbeck added the comment: > I believe it had something to do with TypedDict instances being instances of dict at runtime, but I can't actually reconstruct the reason. Hm that may be true. My limited low-level Python knowledge leads me to believe that this could also be done using __new__ but I also read that most magic methods get called as type(Foo).__magic__(bar, ...) so that might not be possible. (However also no methods can be declared on a TypedDict class so that might not be a problem?) > Maybe it's written up in PEP 589, but I suspect not (I skimmed and couldn't find it). I read it completely and could not find anything > If you ask on typing-sig maybe David Foster (who contributed the initial idea and implementation) remembers. I asked [here on typing-sig](https://mail.python.org/archives/list/typing-sig at python.org/thread/RNFWPRLHTUTZES2FDSSMY472JFGMD4EW/) but did not yet get any responses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 15:42:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 19:42:17 +0000 Subject: [issue44334] Use bytearray in urllib.unquote_to_bytes Message-ID: <1623094937.48.0.800312363654.issue44334@roundup.psfhosted.org> New submission from Terry J. Reedy : 'eng' claimed in original title that "urllib.parse.parse_qsl cannot parse large data". On original PR, said problem with 6-7 millions bytes. Claim should be backed up by a generated example that fails with original code and succeeds with new code. Claims of 'faster' also needs some examples. Original PRs must nearly all propose merging a branch created from main into main. Performance enhancements are often not backported. ---------- nosy: +orsenthil, terry.reedy title: urllib.parse.parse_qsl cannot parse large data -> Use bytearray in urllib.unquote_to_bytes versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:09:04 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 07 Jun 2021 20:09:04 +0000 Subject: [issue44334] Use bytearray in urllib.unquote_to_bytes In-Reply-To: <1623094937.48.0.800312363654.issue44334@roundup.psfhosted.org> Message-ID: <1623096544.37.0.202232880335.issue44334@roundup.psfhosted.org> Gregory P. Smith added the comment: fwiw this sort of thing may be reasonable to backport to 3.9 as it is more than just a performance enhancement but also a resource consumption bug and should result in no behavior change. """ In case of form contain very large data ( in my case the string to parse was about 6000000 byte ) Old code use list of bytes during parsing consumes a lot of memory New code will use bytearry , which use less memory """ - text from the original PR ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:09:11 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 07 Jun 2021 20:09:11 +0000 Subject: [issue44334] Use bytearray in urllib.unquote_to_bytes In-Reply-To: <1623094937.48.0.800312363654.issue44334@roundup.psfhosted.org> Message-ID: <1623096551.53.0.892373133839.issue44334@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:17:54 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Jun 2021 20:17:54 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623097074.27.0.75688481987.issue44246@roundup.psfhosted.org> Steve Dower added the comment: The appx layout is also the only one in CI that actually uses an installed layout - all the rest run tests from the source tree. So it could be related to that. If it's a warning, it could also be that the warning is being triggered somewhere else first. Since tests run in a random order, you'll want to look for how reliable the failure is. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:22:52 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Jun 2021 20:22:52 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623097372.47.0.811139584787.issue41299@roundup.psfhosted.org> Steve Dower added the comment: Change looks good. 3.8 is security fixes only at this stage, but it can go back to 3.9 ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:26:13 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Jun 2021 20:26:13 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623097573.83.0.723024023221.issue41299@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +25167 pull_request: https://github.com/python/cpython/pull/26579 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:26:09 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 07 Jun 2021 20:26:09 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623097569.51.0.262487169771.issue41299@roundup.psfhosted.org> Steve Dower added the comment: New changeset 449e6f0ef395231e3abe467f910b02d7f075c27f by Ryan Hileman in branch 'main': bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision time source (GH-26568) https://github.com/python/cpython/commit/449e6f0ef395231e3abe467f910b02d7f075c27f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:28:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 07 Jun 2021 20:28:51 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623097731.28.0.113365284071.issue41299@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25168 pull_request: https://github.com/python/cpython/pull/26580 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:38:41 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 07 Jun 2021 20:38:41 +0000 Subject: [issue44330] IDLE: Colorizer and output tests hang on macOS In-Reply-To: <1623030071.98.0.487829717412.issue44330@roundup.psfhosted.org> Message-ID: <1623098321.09.0.444866261415.issue44330@roundup.psfhosted.org> Ned Deily added the comment: I can reproduce test_idle hanging on all of the current python.org macOS universal2 variants (3.8.10, 3.9.5, 3.10.0b2) which use Tk 8.6.11 but not with the legacy 10.9 variants for 3.8.10 and 3.9.5 which use Tk 8.6.8. I've tried it on a few older systems, as far back as 10.9, and they all seem to hang the same way. For 3.9.5 (and 3.8.10 now in security-fix mode), the first hang seems to be in test_removecolors which I need to Ctrl-C out of: /usr/local/bin/python3.9 -m test -v -uall test_idle [...] test_insert (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok test_notify_range (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok test_recolorize (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok test_recolorize_main (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... ok test_removecolors (idlelib.idle_test.test_colorizer.ColorDelegatorTest) ... I also see the hangs with current MacPorts Pythons linked with their build of Tk 8.6.11. ---------- priority: normal -> critical versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 16:58:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Jun 2021 20:58:11 +0000 Subject: [issue43933] Regression in python3.10 with traceback frame having lineno of -1 In-Reply-To: <1619294193.93.0.370565760758.issue43933@roundup.psfhosted.org> Message-ID: <1623099491.76.0.81889675502.issue43933@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44297. ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 17:03:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Jun 2021 21:03:04 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1623099784.35.0.845652110902.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: Ken Jin: Please open a separated issue for test_exceptions.test_recursion_in_except_handler(). It's not directly related to marking PyObject opaque, as William Pickard explained. See my notes on the stack size and stack overflow on a recursion error on Windows: https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 17:06:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 07 Jun 2021 21:06:01 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1623099961.78.0.935574976738.issue42213@roundup.psfhosted.org> STINNER Victor added the comment: I like the new code, thanks for these enhancements Erlend ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 17:24:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Jun 2021 21:24:48 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1623101088.47.0.602984299804.issue39573@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 17:30:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 07 Jun 2021 21:30:06 +0000 Subject: [issue42213] Get rid of cyclic GC hack in sqlite3.Connection and sqlite3.Cache In-Reply-To: <1604094251.24.0.415072580215.issue42213@roundup.psfhosted.org> Message-ID: <1623101406.14.0.765958921897.issue42213@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, Victor :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:11:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 07 Jun 2021 22:11:14 +0000 Subject: [issue44330] IDLE: Colorizer and output tests hang on macOS In-Reply-To: <1623030071.98.0.487829717412.issue44330@roundup.psfhosted.org> Message-ID: <1623103874.61.0.73340569254.issue44330@roundup.psfhosted.org> Terry J. Reedy added the comment: Yes, I have the 'old' 3.9.5. In IDLE, ^C does not break the hang, but Restart Shell does. As I expected, I had to skip test_outwin's test_write and test_writelines to stop that test hanging. Next failure: test_sidebar.LineNumbersTest ends with test_toggle_linenumbering ... OK. That is the last test method and the hang is in tearDownClass "cls.root.update()". Changing to .update_idletasks() fixes this. I believe that the latter is what we usually use before destroying root. But still, update should not crash. At worst, a TclError. With this fix, test_idle passes. So do test_tcl and test_ttk_textonly. Test_tk and test_ttk_guionly each have 1 failure. (For me) The test suite as a whole is a mess, with multiple Python-crashed message boxes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:11:27 2021 From: report at bugs.python.org (Xiang Zhong) Date: Mon, 07 Jun 2021 22:11:27 +0000 Subject: [issue44013] tempfile.TemporaryFile: name of file descriptor cannot be reused in consecutive initialization In-Reply-To: <1619994815.29.0.724748719135.issue44013@roundup.psfhosted.org> Message-ID: <1623103887.12.0.976750745226.issue44013@roundup.psfhosted.org> Xiang Zhong added the comment: Dear Mr. Jollans, Thanks for your additions, I think I know well about the SHELL programming language, now, every thing about the low-level file descriptors is linked together. I guess now I completely know your writing, thanks again for your detail explanations! The potential ?bug? of your consideration is the post operation caused by OS.close() in the delay/conflict of tempfile.Temporary(), as a result, fd does not know whether its linked file descriptor is valid or not due to ?with? method. However, if you have a look on ?test_4? in attached ?xtempfile.py?, you will see that in the first fd generated by tempfile.Temporary(), it is assumed to be handled by the first ?with?, no more other operations are executed. Even after first ?with? it becomes invalid, there are no further executions performed. On the second fd returned by tempfile.TemporaryFile(), it should be a valid file descriptor no matter how the first one is dealt with. From the coding perspective, these two variables are just ?happen to? be the same chars. Besides, from my testing, changing any one of them to the different variable name, then the problem is gone. Furthermore, if you have a look on ?test_3?, ?test_5? and ?test_6? (xtempfile.py), especially on ?test_5?, they all prove that it should be a bug. To go deeper, I attached another test file ?new-xtempfile.py?, on ?test_11?, you will see that it should have some problems on "__del__" method if its linking file descriptor is closed by os.close(). They two may or may not be the same problem. Thanks again for your illustration of ?fd.fileno()? and ?fd.name?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:33:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 07 Jun 2021 22:33:56 +0000 Subject: [issue31472] "Emulating callable objects" documentation misleading In-Reply-To: <1505409903.44.0.981302539758.issue31472@psf.upfronthosting.co.za> Message-ID: <1623105236.37.0.841895190753.issue31472@roundup.psfhosted.org> Andrei Kulakov added the comment: I don't think the docs in current form imply keyword args are disallowed: "arguments" covers both positional and keyword args, and the call as given in example would work for both positional and keyword args (though not overriding the default value of an arg). It seems to me this can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:38:11 2021 From: report at bugs.python.org (Brett Holman) Date: Mon, 07 Jun 2021 22:38:11 +0000 Subject: [issue44340] Add support for building cpython with clang thin lto Message-ID: <1623105491.02.0.949113840673.issue44340@roundup.psfhosted.org> New submission from Brett Holman : The existing --with-lto argument could be extended to pass through a value to select non-default lto compiler options: CC=clang ./configure --with-lto=thin This would allow default behavior to remain unchanged, while allowing those that want to use thin lto to opt in. For what it's worth, the tests (make test) pass using clang 11.1.0 and thinlto. ---------- components: Interpreter Core messages: 395293 nosy: holmanb priority: normal severity: normal status: open title: Add support for building cpython with clang thin lto type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:47:48 2021 From: report at bugs.python.org (Brett Holman) Date: Mon, 07 Jun 2021 22:47:48 +0000 Subject: [issue44340] Add support for building cpython with clang thin lto In-Reply-To: <1623105491.02.0.949113840673.issue44340@roundup.psfhosted.org> Message-ID: <1623106068.99.0.412039586341.issue44340@roundup.psfhosted.org> Change by Brett Holman : ---------- keywords: +patch pull_requests: +25169 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26585 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:49:50 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 07 Jun 2021 22:49:50 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623106190.57.0.850248127815.issue44242@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +25170 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26586 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 18:52:09 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 22:52:09 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623106329.51.0.0622910579162.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 631f9938b1604d4f893417ec339b9e0fa9196fb1 by Eric Snow in branch 'main': bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396) https://github.com/python/cpython/commit/631f9938b1604d4f893417ec339b9e0fa9196fb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:03:19 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 23:03:19 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623106999.02.0.129468776128.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +25172 pull_request: https://github.com/python/cpython/pull/26587 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:22:08 2021 From: report at bugs.python.org (Finn Mason) Date: Mon, 07 Jun 2021 23:22:08 +0000 Subject: [issue44341] Conflict between re.match and match keyword Message-ID: <1623108127.98.0.605122773588.issue44341@roundup.psfhosted.org> New submission from Finn Mason : >>> import re >>> re.match('str', 'str').group() 'str' >>> match 'str': ... case 'str': ... print('match!') ... match! >>> from re import match >>> match As the above example demonstrates, while re.match doesn't raise an error despite having a keyword name, importing re.match directly into __main__ replaces the keyword with the function. The obvious solution is to rename re.match, but this would break many, many pieces of code. ---------- components: Library (Lib), Regular Expressions messages: 395295 nosy: ezio.melotti, finnjavier08, mrabarnett priority: normal severity: normal status: open title: Conflict between re.match and match keyword type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:22:35 2021 From: report at bugs.python.org (Finn Mason) Date: Mon, 07 Jun 2021 23:22:35 +0000 Subject: [issue44341] Conflict between re.match and match keyword In-Reply-To: <1623108127.98.0.605122773588.issue44341@roundup.psfhosted.org> Message-ID: <1623108155.06.0.447849454322.issue44341@roundup.psfhosted.org> Change by Finn Mason : ---------- nosy: -finnjavier08 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:28:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 07 Jun 2021 23:28:25 +0000 Subject: [issue44341] Conflict between re.match and match keyword In-Reply-To: <1623108127.98.0.605122773588.issue44341@roundup.psfhosted.org> Message-ID: <1623108505.78.0.107010832287.issue44341@roundup.psfhosted.org> Steven D'Aprano added the comment: `match` is a soft keyword. Which means that the interpreter should still recognise `match 'str': ...` even if the *name* "match" is defined. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:34:34 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 23:34:34 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623108874.22.0.0991291350109.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +25173 pull_request: https://github.com/python/cpython/pull/26588 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 19:58:55 2021 From: report at bugs.python.org (Eric Snow) Date: Mon, 07 Jun 2021 23:58:55 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623110335.49.0.979670546431.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 165c884154901deae46b5e328a6414d130e6bfff by Eric Snow in branch 'main': bpo-43693: Silence some compiler warnings. (gh-26588) https://github.com/python/cpython/commit/165c884154901deae46b5e328a6414d130e6bfff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:06:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 00:06:39 +0000 Subject: [issue44341] Conflict between re.match and match keyword In-Reply-To: <1623108127.98.0.605122773588.issue44341@roundup.psfhosted.org> Message-ID: <1623110799.63.0.512192381316.issue44341@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't understand this example. > importing re.match directly into __main__ replaces the keyword with the function. It has not replaced anything, if you do a match statement it works and doesn't call your function. For example: >>> x = [1,2] >>> >>> def match(*args): ... print("Oh no") ... >>> match x: ... case [y,z]: ... print(y,z) ... 1 2 Here "match" when used as a statement has not been replaced by the function that prints "oh no" so the match statement works as expected and so does the function: >>> match ---------- nosy: +pablogsal resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:07:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 00:07:54 +0000 Subject: [issue44341] Conflict between re.match and match keyword In-Reply-To: <1623108127.98.0.605122773588.issue44341@roundup.psfhosted.org> Message-ID: <1623110874.12.0.623686106813.issue44341@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As Steven mentions, match is a soft keyword: >>> import keyword >>> keyword.softkwlist ['_', 'case', 'match'] And they don't follow the same rules as keywords. Check the pattern matching PEPs for more info. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:14:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 00:14:36 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623111276.76.0.741160944715.issue44335@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25174 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26589 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:21:22 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 08 Jun 2021 00:21:22 +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: <1623111682.86.0.153506428252.issue40120@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:56:53 2021 From: report at bugs.python.org (Tom Brown) Date: Tue, 08 Jun 2021 00:56:53 +0000 Subject: [issue44342] enum with inherited type won't pickle Message-ID: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> New submission from Tom Brown : The following script runs without error in 3.8.5 and raises an error in 3.8.6, 3.9.5 and 3.10.0b1. Source: ``` import enum, pickle class MyInt(int): pass # work-around: __reduce_ex__ = int.__reduce_ex__ class MyEnum(MyInt, enum.Enum): A = 1 pickle.dumps(MyEnum.A) ``` Error (same in 3.8.6, 3.9.5 and 3.10.0b1): ``` Traceback (most recent call last): File "/home/thecap/projects/covid-data-model/./enum-pickle.py", line 12, in pickle.dumps(MyEnum.A) File "/home/thecap/.pyenv/versions/3.10.0b1/lib/python3.10/enum.py", line 83, in _break_on_call_reduce raise TypeError('%r cannot be pickled' % self) TypeError: MyEnum.A cannot be pickled ``` Like https://bugs.python.org/issue41889 this seems to be related to the fix for https://bugs.python.org/issue39587 which changes member_type from int to MyInt. A work-around is in the comment above. ---------- components: Library (Lib) messages: 395300 nosy: Tom.Brown priority: normal severity: normal status: open title: enum with inherited type won't pickle versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 20:58:58 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 08 Jun 2021 00:58:58 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623113938.47.0.801086130651.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Steve for the feedback. > If it's a warning, it could also be that the warning is being triggered somewhere else first. Since tests run in a random order, you'll want to look for how reliable the failure is. It is a warning, but it seems unlikely that any other code is calling it, given that the supporting codepath was not present until the same PR. > The appx layout is also the only one in CI that actually uses an installed layout - all the rest run tests from the source tree. So it could be related to that. If someone could help by producing a docker image that can build the appx layout and run the tests, that would help me as I don't have a lot of proficiency with installing build tools on Windows through the CLI... and the experience I do have has been fraught with challenges. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 21:12:11 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 08 Jun 2021 01:12:11 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623114731.09.0.915123024911.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 22:38:29 2021 From: report at bugs.python.org (Joongi Kim) Date: Tue, 08 Jun 2021 02:38:29 +0000 Subject: [issue44343] Adding the "with" statement support to ContextVar Message-ID: <1623119909.23.0.724701230762.issue44343@roundup.psfhosted.org> New submission from Joongi Kim : This is just an idea: ContextVar.set() and ContextVar.reset() looks naturally mappable with the "with" statement. For example: a = ContextVar('a') token = a.set(1234) ... a.reset(token) could be naturally rewritten as: a = ContextVar('a') with a.set(1234): ... Is there any particular reason *not* to do this? If not, I'd like make a PR to add this API. Naming suggestions of this API are welcome, but it also seems possible to keep it "set()" if we retain the reference to the ContextVar instance in the Token instance. ---------- components: Library (Lib) messages: 395302 nosy: achimnol priority: normal severity: normal status: open title: Adding the "with" statement support to ContextVar type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 22:41:32 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 08 Jun 2021 02:41:32 +0000 Subject: [issue44343] Adding the "with" statement support to ContextVar In-Reply-To: <1623119909.23.0.724701230762.issue44343@roundup.psfhosted.org> Message-ID: <1623120092.38.0.112229801239.issue44343@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 22:43:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 08 Jun 2021 02:43:56 +0000 Subject: [issue44343] Adding the "with" statement support to ContextVar In-Reply-To: <1623119909.23.0.724701230762.issue44343@roundup.psfhosted.org> Message-ID: <1623120236.52.0.28434969353.issue44343@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +aeros, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 23:06:14 2021 From: report at bugs.python.org (Tim Peters) Date: Tue, 08 Jun 2021 03:06:14 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623121574.44.0.21700909191.issue44339@roundup.psfhosted.org> Tim Peters added the comment: +1. Although, to be fair, I'd personally be happy if (+-0)**inf returned, say, 1.375 instead ;-) ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 7 23:31:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 03:31:21 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623123081.47.0.172721814494.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: There are two immediate issues. 2. Issues are blocked because of lack of room on the General pane. The Windows Preferences frame is about as large as the Editor and Shell frame together. Splitting that way will leave room for enough more options for quite a while. 1. The screen on my 2012 MacBook Air is 768 pixels tall. There are other people with screens about this small, though I doubt much smaller. With the dock on the bottom, the configdialog buttons are not accessible. (The are if IDLE is made full screen.) The Additional Help Source box takes up over 20% of the Notebook pane height. With it removed and all panes shortened, the problem on my screen and other at least as tall will be fixed. I am therefore adopting EP's idea of moving the Help menu extension to the Extensions tab. I think it fits there better than on the Font page or either split of the General tab. I am starting now to separate out a HelpSrc frame class in the code and a HelpSrcTest class in the test file. --- EP, coordinated help on this other dialog issue is welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 00:13:36 2021 From: report at bugs.python.org (Erik Y. Adams) Date: Tue, 08 Jun 2021 04:13:36 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type Message-ID: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> New submission from Erik Y. Adams : https://docs.python.org/3/library/functions.html#pow The built-in pow() function will return a complex number if the base is negative and the exponent is a float between 0 and 1. For example, the value returned by `pow(-1, 1.0/3)` is `(1.0000000000000002+1.7320508075688772j)` The answer is mathematically correct, but `-2.0` is also mathematically correct. There is nothing in the documentation currently to suggest that a complex number might be returned; in fact, given the statement "[with] mixed operand types, the coercion rules for binary arithmetic operators apply", one might reasonably expect `-2.0` as the answer. I suggest the following sentences be added to the end of the second paragraph: "If `base` is negative and the `exp` is a `float` between 0 and 1, a complex number will be returned. For example, `pow(-8, 1.0/3)` will return `(1.0000000000000002+1.7320508075688772j)`, and not `-2.0.`" ---------- assignee: docs at python components: Documentation messages: 395305 nosy: docs at python, eyadams priority: normal severity: normal status: open title: Documentation for pow() should include the possibility of complex numbers as a return type type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 00:53:30 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 04:53:30 +0000 Subject: [issue44345] The First-line (comment) of the parser.c is incorrect. Message-ID: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> New submission from Akira Nonaka : The First-line (comment) of the parser.c is incorrect. "// @generated by pegen.py from ./Grammar/python.gram" pegen.py no longer exists. It is now "pegen" package. ---------- components: Demos and Tools messages: 395306 nosy: anonaka priority: normal severity: normal status: open title: The First-line (comment) of the parser.c is incorrect. versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 00:54:38 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 04:54:38 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623128078.48.0.00336536586944.issue44345@roundup.psfhosted.org> Change by Akira Nonaka : ---------- title: The First-line (comment) of the parser.c is incorrect. -> The first line (comment) of the parser.c is incorrect. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 01:05:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 08 Jun 2021 05:05:49 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623128749.75.0.999627053589.issue44339@roundup.psfhosted.org> Raymond Hettinger added the comment: +1 from me as well. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 01:29:28 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 05:29:28 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623130168.06.0.0709806116493.issue44345@roundup.psfhosted.org> Change by Akira Nonaka : ---------- keywords: +patch pull_requests: +25175 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26591 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 01:56:47 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 08 Jun 2021 05:56:47 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1623131807.45.0.246306238679.issue44344@roundup.psfhosted.org> Dennis Sweeney added the comment: For some prior art, https://www.wolframalpha.com/input/?i=%28-8%29+%5E+%281%2F3%29 says it defaults to using "the principal root" over "the real-valued root" Also, I think the relevant property is that the exponent is not an integer; being between 0 and 1 is irrelevant: >>> pow(-8, 4/3) (-8.000000000000005-13.856406460551014j) Maybe the tweak could be something like "Note that using a negative base with a non-integer exponent will return the principal complex exponent value, even if a different real value exists." ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 02:36:08 2021 From: report at bugs.python.org (Arjun) Date: Tue, 08 Jun 2021 06:36:08 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623134168.48.0.500269515841.issue44324@roundup.psfhosted.org> Change by Arjun : ---------- keywords: +patch pull_requests: +25176 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26592 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:07:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 07:07:34 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623136054.78.0.274764949961.issue40468@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +25177 pull_request: https://github.com/python/cpython/pull/26593 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:11:43 2021 From: report at bugs.python.org (elonjigar) Date: Tue, 08 Jun 2021 07:11:43 +0000 Subject: [issue41716] SyntaxError: EOL while scanning string literal In-Reply-To: <1599221526.43.0.8824911096.issue41716@roundup.psfhosted.org> Message-ID: <1623136303.47.0.395842489289.issue41716@roundup.psfhosted.org> elonjigar added the comment: An EOL while scanning string literal error indicates that the Python interpreter expected a particular character or set of characters to have occurred in a specific line of code, but that those characters were not found before the end of the line . This results in Python stopping the program execution and throwing a syntax error . In most cases, this is due to the following reasons: Missing quotes Strings spanning multiple lines Strings can't normally span multiple lines. If you don't want the string to appear on multiple lines but you want to initialize it on multiple lines (so you can read it more easily), you can "escape" the newline by putting a backslash before the newline. If you want it to appear on multiple lines, you can use triple quotes around the string. http://net-informations.com/python/err/eol.htm ---------- nosy: +elonjigar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:13:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 07:13:46 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623136426.84.0.752881565423.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: The new PR moves the helplist. The extensions page looks much better. Not all of the helplist height is recovered. I believe this is because the Font/Tabs page and in particular the overly large indentation setting now determines height. (The other frames on the general page expanded a bit.) *33962 is about using a ttk spinbox here and I will do that tomorrow. ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:23:06 2021 From: report at bugs.python.org (Julien Palard) Date: Tue, 08 Jun 2021 07:23:06 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1623136986.41.0.788096945563.issue42238@roundup.psfhosted.org> Julien Palard added the comment: New changeset 227a09325e7bf82ecd303b4696c054a086b29a00 by Julien Palard in branch 'main': bpo-42238: Doc CI: Disable suspicious checks. (GH-26575) https://github.com/python/cpython/commit/227a09325e7bf82ecd303b4696c054a086b29a00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:47:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 08 Jun 2021 07:47:57 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623138477.14.0.539457335128.issue44339@roundup.psfhosted.org> Serhiy Storchaka added the comment: What about math.pow(0.0, -1.0)? Should it return -inf or raise ZeroDivisionError? And what about math.pow(-0.0, -inf)? Should it return inf, -inf or nan or raise an exception? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 03:52:22 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 08 Jun 2021 07:52:22 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623138742.36.0.69331700125.issue44339@roundup.psfhosted.org> Mark Dickinson added the comment: > What about math.pow(0.0, -1.0)? Should it return -inf or raise ZeroDivisionError? Neither: it should raise ValueError, as it does now. This matches IEEE 754 along with the math module's mapping of IEEE 754 floating-point exceptions to Python exceptions. > And what about math.pow(-0.0, -inf)? This should return inf, the same as math.pow(0.0, -inf). The relevant clauses of the C standard and IEEE 754 cover both these cases; I should have written `math.pow(?0.0, -inf)` throughout my previous message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 04:29:36 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 08 Jun 2021 08:29:36 +0000 Subject: [issue44346] Fraction constructor may accept spaces around '/' Message-ID: <1623140976.11.0.768118294716.issue44346@roundup.psfhosted.org> New submission from Sergey B Kirpichev : Per https://bugs.python.org/msg394731 suggestion. For instance, mpq_set_str() does support this. Also, gmpy2.mpq(). Tentative patch attached. ---------- components: Library (Lib) files: fraction-spaces.diff keywords: patch messages: 395314 nosy: Sergey.Kirpichev priority: normal severity: normal status: open title: Fraction constructor may accept spaces around '/' versions: Python 3.11 Added file: https://bugs.python.org/file50097/fraction-spaces.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 05:17:12 2021 From: report at bugs.python.org (Tilman Vogel) Date: Tue, 08 Jun 2021 09:17:12 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() Message-ID: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> New submission from Tilman Vogel : I donot understand this sentence: "dirs_exist_ok dictates whether to raise an exception in case dst or any missing parent directory already exists." How can a "missing parent directory already exist"? My understanding would be that an existing `dst` would be OK (and copied into) but missing parent directories are just the ones above `dst` that also don't exist. Until 3.7, missing parent directories were documented to be auto-created (`mkdir -p`-style) according to the documentation ("The destination directory, named by dst, must not already exist; it will be created as well as missing parent directories."). Was this feature really removed? If not, then this part was accidentally (?) dropped from documentation? What am I missing? I think, the documentation should be amended to make that clear. ---------- assignee: docs at python components: Documentation messages: 395315 nosy: docs at python, tilman.vogel priority: normal severity: normal status: open title: Unclear documentation for shutil.copytree() type: enhancement versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 05:47:57 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 08 Jun 2021 09:47:57 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds Message-ID: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> New submission from Ken Jin : Hi all, I created this issue after discussion in https://bugs.python.org/issue39573#msg395206: In issue39573 "[C API] Make PyObject an opaque structure in the limited C API" the commit f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 ("Py_TYPE becomes a static inline function") may have caused test_recursion_in_except_handler to fail only on windows debug builds (according to git bisect anyways) due to higher stack consumption causing a stack overflow. That test was added in 4e7a69bdb63a104587759d7784124492dcdd496e (Dec 2020), and was passing until last week. Currently another test (bpo-11105, test_ast test_recursion_direct) is masking the broken test, but it's also a stack overflow in windows debug. When I reverted commit f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970, test_recursion_in_except_handler passes but test_recursion_direct still fails. For test_recursion_direct, the overflow occurs after the Py_Enter/LeaveRecursiveCall guard, when calling some other function like _PyObject_LookupAttr. I can think of a few possible ways to fix this (in no particular order): 1. Increase stack size for windows builds from 2MB (some valid points against this though, see msg395177). 2. Decrease the global recursion limit only for windows debug. 3. Custom recursion limits for each module depending on OS, which Batuhan has been working on for AST module at GH-26550. 4. Skip the tests on windows debug, since most people on windows use release builds anyways which are unaffected. Thanks for your time! Which approach would you prefer? ---------- components: Windows messages: 395316 nosy: BTaskaya, kj, pablogsal, paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 06:26:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 08 Jun 2021 10:26:05 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623147965.34.0.128021235015.issue44337@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25178 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26595 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 06:43:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 10:43:37 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623149017.81.0.0789623052579.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Hi, Unfortunately, the address sanitizer buildbot has been broken by commit631f9938b1604d4f893417ec339b9e0fa9196fb1 : https://buildbot.python.org/all/#/builders/585 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 06:45:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 10:45:56 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623149156.09.0.964697872256.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Here is the top trace: test_jump_in_nested_finally_3 (test.test_sys_settrace.JumpTestCase) ... ok test_jump_into_finally_block (test.test_sys_settrace.JumpTestCase) ... ok test_jump_into_finally_block_from_try_block (test.test_sys_settrace.JumpTestCase) ... ok ================================================================= ==28726==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000db2c8 at pc 0x55fb8bd662d1 bp 0x7ffef9e25cf0 sp 0x7ffef9e25ce0 READ of size 4 at 0x6040000db2c8 thread T0 #0 0x55fb8bd662d0 in PyFrame_FastToLocalsWithError Objects/frameobject.c:985 #1 0x55fb8bbad5a3 in call_trampoline Python/sysmodule.c:953 #2 0x55fb8bbb0eb5 in trace_trampoline Python/sysmodule.c:1008 #3 0x55fb8bac9a03 in call_trace Python/ceval.c:5618 #4 0x55fb8bacd3c6 in call_trace_protected Python/ceval.c:5576 #5 0x55fb8bad8a57 in _PyEval_EvalFrameDefault Python/ceval.c:1631 #6 0x55fb8bafc2ff in ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 06:49:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 10:49:38 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623149378.18.0.642449780181.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Eric, I saw thay you ran the buildbots on your PR (thanks a lot), but something has gone wrong in some of them and they didn't run correctly. For example: https://buildbot.python.org/all/#/builders/581/builds/58 I'm investigating why that this. Meanwhile, could you take a look? We have already some problems on windows and we don't want more stuff to pile up. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:02:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:02:30 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623150150.25.0.98314851828.issue44348@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: There are many buildbot failures today and this is getting a bit out of hand so I'm starting with a revert of f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 until we have a better plan. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:07:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:07:12 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1623150432.53.0.721102254057.issue39573@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 13.0 -> 14.0 pull_requests: +25180 pull_request: https://github.com/python/cpython/pull/26596 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:07:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:07:12 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623150432.39.0.0191059510491.issue44348@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25179 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26596 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:11:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:11:38 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623150698.37.0.0191591076783.issue43693@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25181 pull_request: https://github.com/python/cpython/pull/26597 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:12:36 2021 From: report at bugs.python.org (hai shi) Date: Tue, 08 Jun 2021 11:12:36 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1623150756.85.0.642953149225.issue37224@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +25182 pull_request: https://github.com/python/cpython/pull/26598 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:24:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:24:22 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623151462.59.0.482972802413.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The problem seems to be that The problem is that PyFrame_LocalsToFast(frame, 1); calls into PyFrame_LocalsToFast where co->co_nlocals has a value of 3, and this causes co->co_cell2arg[i - co->co_nlocals]; to access outside the bounds of the array. As this change is affecting all tests (there are many tests in the test suite that fail with a buffer overflow in the ASAN builds) I opened PR 26597 to revert commit commit631f9938b1604d4f893417ec339b9e0fa9196fb1. As always, please, recommit commit631f9938b1604d4f893417ec339b9e0fa9196fb1 once this issues are fixed. To reproduce these failures locally you can: $ export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0 $ ./configure --with-address-sanitizer --without-pymalloc $ make -j -s $ ./python -m test test_sys_settrac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:24:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:24:57 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623151497.6.0.0971684918394.issue44348@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6d518bb3a11f9b16098f45b21a13ebe8f537f045 by Pablo Galindo in branch 'main': bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function (GH-26493)" (GH-26596) https://github.com/python/cpython/commit/6d518bb3a11f9b16098f45b21a13ebe8f537f045 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:24:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:24:57 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1623151497.67.0.994479248178.issue39573@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6d518bb3a11f9b16098f45b21a13ebe8f537f045 by Pablo Galindo in branch 'main': bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function (GH-26493)" (GH-26596) https://github.com/python/cpython/commit/6d518bb3a11f9b16098f45b21a13ebe8f537f045 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:25:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:25:26 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623151526.04.0.0451723771917.issue44335@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d334c73b56756e90c33ce06e3a6ec23271aa099d by Pablo Galindo in branch 'main': bpo-44335: Fix a regression when identifying invalid characters in syntax errors (GH-26589) https://github.com/python/cpython/commit/d334c73b56756e90c33ce06e3a6ec23271aa099d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:25:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 11:25:40 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623151540.65.0.447499971041.issue44335@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25183 pull_request: https://github.com/python/cpython/pull/26600 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 07:28:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 11:28:25 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623151705.05.0.0985356961044.issue44335@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 Jun 8 07:47:05 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 11:47:05 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623152825.24.0.706930090982.issue44335@roundup.psfhosted.org> miss-islington added the comment: New changeset 933b5b63598968c1ab4976f92570696a33c72cc4 by Miss Islington (bot) in branch '3.10': bpo-44335: Fix a regression when identifying invalid characters in syntax errors (GH-26589) https://github.com/python/cpython/commit/933b5b63598968c1ab4976f92570696a33c72cc4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 08:18:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 12:18:01 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623154681.62.0.262727132696.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3fe921cd49959181163671364c8b84faa88f7895 by Pablo Galindo in branch 'main': Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. (gh-26396)" (GH-26597) https://github.com/python/cpython/commit/3fe921cd49959181163671364c8b84faa88f7895 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 08:35:07 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 12:35:07 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623155707.57.0.236340791521.issue44345@roundup.psfhosted.org> Change by Akira Nonaka : ---------- pull_requests: +25184 pull_request: https://github.com/python/cpython/pull/26602 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:09:06 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 13:09:06 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623157746.16.0.331418794081.issue44345@roundup.psfhosted.org> Akira Nonaka added the comment: I have just signed the contributor agreement. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:11:25 2021 From: report at bugs.python.org (=?utf-8?b?2ZBBYmR1bHJhaG1hbiDZkFNoYXdh?=) Date: Tue, 08 Jun 2021 13:11:25 +0000 Subject: [issue14547] Python symlink to script behaves unexpectedly In-Reply-To: <1334155369.29.0.554259242167.issue14547@psf.upfronthosting.co.za> Message-ID: <1623157885.39.0.898106425352.issue14547@roundup.psfhosted.org> ?Abdulrahman ?Shawa added the comment: hello guys I am facing problem with my sqlite3 database when i make changes it saves the changes for almost 13 hours and then retakes back all the changes that i made, i am using two threads in my code and i am not committing the data but i set the isolation mode to None, i was using the same queries with mysql database with setting autocommit to on and it was working fine what could be the problem in your opinion? we searched and ask a lot about this issue but nothing was helpful. ---------- nosy: +free.abdo.sh type: enhancement -> behavior versions: +Python 3.6, Python 3.7, Python 3.8 -Python 2.7, Python 3.4, Python 3.5 Added file: https://bugs.python.org/file50098/main.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:11:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 08 Jun 2021 13:11:31 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623157891.36.0.812349785064.issue43693@roundup.psfhosted.org> Mark Shannon added the comment: Pablo, Is there a bpo issue for the buildbot failures on Windows? The failures I've been seeing are C stack overflows. Long term, I expect to fix it by decoupling the C and Python stacks. In the short term I have a couple of changes that might get it working again ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:19:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 13:19:40 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623158380.17.0.0592086889634.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yes, this one: https://bugs.python.org/issue44348 > s there a bpo issue for the buildbot failures on Windows? The failures I've been seeing are C stack overflows. But the ones affecting this issue are the ones in ASAN: https://buildbot.python.org/all/#/builders/581/builds/58 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:21:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 13:21:23 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623158483.72.0.626735903949.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Long term, I expect to fix it by decoupling the C and Python stacks. That won't fix half of the Windows failures because the stack overflow you are seeing are for C to C calls if I am not mistaken. This happens on very deep calls when converting Python objects to C objects. There are no Python frames involved in that case IIRC. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:22:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 13:22:56 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623158576.7.0.193804466246.issue43693@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg395330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 09:24:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 13:24:19 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623158659.91.0.0615769283733.issue43693@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Are there a bpo issue for the buildbot failures on Windows? Yes, this one: https://bugs.python.org/issue44348 But just to clarify, the ones affecting this issue are the ones in ASAN, for example: https://buildbot.python.org/all/#/builders/582/builds/227/steps/5/logs/stdio ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 10:17:33 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 08 Jun 2021 14:17:33 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623161853.93.0.440229320854.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: here's the performance regressions, they affect any callers of `distributions()` and are even worse on callers of the new apis. a call to distributions() is about 3x slower than in 3.9 here is the setup I am using: virtualenv venv39 -ppython3.9 venv39/bin/pip install flake8 pytest twine pre-commit virtualenv venv310 -ppython3.10 venv310/bin/pip install flake8 pytest twine pre-commit to test just the `distributions()` call I'm using the following: ```console $ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()' 20 loops, best of 20: 12.5 msec per loop $ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()' 20 loops, best of 20: 36.7 msec per loop ``` this is a less-extreme example, many applications have more dependencies installed -- but even in this case this is adding ~24ms startup to any application using `entry_points()` -- and it gets worse the return value of `entry_points()` alone isn't all that useful, next an application needs to retrieve its entry points. let's start for the somewhat normal case of retrieving a single category of entry points: ```console $ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points()["flake8.extension"]' 20 loops, best of 20: 12.7 msec per loop $ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points(name="flake8.extension")' 20 loops, best of 20: 37.1 msec per loop $ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'entry_points().select(group="flake8.extension")' 20 loops, best of 20: 37.1 msec per loop ``` again, 3x slower and very real time to the end user (~24-25ms) now let's show an example usage that something like flake8 uses where multiple groups are requested (this is common for apps and plugin systems which provide multiple distinct functionalities) ```console $ venv39/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'eps = entry_points(); eps["flake8.extension"]; eps["flake8.report"]' 20 loops, best of 20: 12.6 msec per loop $ venv310/bin/python -m timeit -n 20 -r 20 -s 'from importlib.metadata import entry_points' 'eps = entry_points(); eps.select(group="flake8.extension"); eps.select(group="flake8.report")' 20 loops, best of 20: 38.2 msec per loop ``` also slower, but an additional ms per call to `.select(...)` and it only gets worse with more and more packages installed here's the versions I'm using to ensure they are up to date: ```console $ venv39/bin/python --version --version Python 3.9.5 (default, May 19 2021, 11:32:47) [GCC 9.3.0] $ venv310/bin/python --version --version Python 3.10.0b2 (default, Jun 2 2021, 00:22:18) [GCC 9.3.0] ``` ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 11:01:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 15:01:02 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623164462.78.0.900972587287.issue44329@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1c02655fb08043b3027748ca1179c416c21a4277 by Erlend Egeberg Aasland in branch 'main': bpo-44329: Refactor sqlite3 statement creation (GH-26566) https://github.com/python/cpython/commit/1c02655fb08043b3027748ca1179c416c21a4277 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 11:20:17 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 15:20:17 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623165617.09.0.678698661109.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25185 pull_request: https://github.com/python/cpython/pull/26603 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 11:20:14 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 08 Jun 2021 15:20:14 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623165614.68.0.436589326824.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 257e400a19b34c7da6e2aa500d80b54e4c4dbf6f by Petr Viktorin in branch 'main': bpo-43795: Note Stable ABI PEP in What's New (GH-26479) https://github.com/python/cpython/commit/257e400a19b34c7da6e2aa500d80b54e4c4dbf6f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 11:42:07 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Tue, 08 Jun 2021 15:42:07 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623166927.6.0.473983952895.issue44310@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: Reading this bug thread last week made me realize we had made the following error in our code: class SomethingView(): @functools.lru_cache() def get_object(self): return self._object Now, as this class was instantiated for every (particular kind of) request to a webserver and this method called (a few times), the lru_cache just kept filling up and up. We had been having a memory leak we couldn't track down, and this was it. I think this is an easy mistake to make and it was rooted, not so much in hard references though (without that though, it would have not leaked memory) but because of the fact the cache lives on the class and not the object. ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 11:57:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 08 Jun 2021 15:57:40 +0000 Subject: [issue44329] [sqlite3] refactor pysqlite_statement_create In-Reply-To: <1623018092.83.0.126983081124.issue44329@roundup.psfhosted.org> Message-ID: <1623167860.8.0.414019263047.issue44329@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 Tue Jun 8 12:00:40 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 08 Jun 2021 16:00:40 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623168040.22.0.900562102675.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 75185561a9a3b6dede3ad87bd83bab66847bd425 by Miss Islington (bot) in branch '3.10': bpo-43795: Note Stable ABI PEP in What's New (GH-26479) (GH-26603) https://github.com/python/cpython/commit/75185561a9a3b6dede3ad87bd83bab66847bd425 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 12:18:22 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 08 Jun 2021 16:18:22 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623169102.87.0.528882149508.issue43693@roundup.psfhosted.org> Eric Snow added the comment: Thanks, Pablo! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 12:20:04 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 08 Jun 2021 16:20:04 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1623169204.19.0.515385919207.issue44344@roundup.psfhosted.org> Mark Dickinson added the comment: [Dennis] > I think the relevant property is that the exponent is not an integer Yep: the delegation to complex pow kicks in after handling infinities and nans, and only for strictly negative base (-0.0 doesn't count as negative for this purpose) and non-integral exponent. Here's the relevant code: https://github.com/python/cpython/blob/257e400a19b34c7da6e2aa500d80b54e4c4dbf6f/Objects/floatobject.c#L773-L782 To avoid confusion, we should probably not mention fractions like `1/3` and `4/3` as example exponents in the documentation, since those hit the What-You-See-Is-Not-What-You-Get nature of binary floating-point. Mathematically, `z^(1/3)` is a very different thing from `z^(6004799503160661/18014398509481984)` for a negative real number `z`, and the latter is what's _actually_ being computed with `z**(1/3)`. The advantage of the principal branch approach is that it's continuous in the exponent, so that `z^(1/3)` and `z^(6004799503160661/18014398509481984)` only differ by a tiny amount. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 12:24:49 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Tue, 08 Jun 2021 16:24:49 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623169489.9.0.454446824762.issue11105@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth nosy_count: 11.0 -> 12.0 pull_requests: +25186 pull_request: https://github.com/python/cpython/pull/26578 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 12:55:17 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 16:55:17 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623171317.66.0.183339873435.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset e58d762c1fb4ad5e021d016c80c2bc4513632d2f by Batuhan Taskaya in branch 'main': bpo-11105: reduce the recursion limit for tests (GH-26550) https://github.com/python/cpython/commit/e58d762c1fb4ad5e021d016c80c2bc4513632d2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:00:31 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:00:31 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623171631.0.0.68961613632.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25187 pull_request: https://github.com/python/cpython/pull/26604 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 12:51:19 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 08 Jun 2021 16:51:19 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623171079.86.0.909170339285.issue44348@roundup.psfhosted.org> Steve Dower added the comment: > Decrease the global recursion limit only for windows debug. This is already what we do, so if someone has increased stack usage, they should also decrease the value here. Hopefully the non-debug value doesn't have to be reduced. In that case, it's worth looking at the stack allocations to reduce it (e.g. I once fixed this by moving a rarely used buffer into a dynamic allocation rather than a local, which saved about 1KB/frame). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:03:37 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:03:37 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623171817.65.0.577332537779.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25188 pull_request: https://github.com/python/cpython/pull/26605 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:04:24 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:04:24 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623171864.07.0.343304179679.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25190 pull_request: https://github.com/python/cpython/pull/26607 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:04:13 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 08 Jun 2021 17:04:13 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623171853.43.0.720343164649.issue44339@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +25189 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26606 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:39:24 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:39:24 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623173964.16.0.333154007826.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 8004c4570b1d1277ea8754e22b5eb60e63f5026c by Batuhan Taskaya in branch 'main': bpo-11105: document the new test.support.infinite_recursion context manager (GH-26604) https://github.com/python/cpython/commit/8004c4570b1d1277ea8754e22b5eb60e63f5026c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:39:38 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:39:38 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623173978.87.0.737724616764.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset bd6f0d3eadfe5623657db6aeb69b94d21f86f4a0 by Batuhan Taskaya in branch '3.10': [3.10] bpo-11105: reduce the recursion limit for tests. (GH-26607) https://github.com/python/cpython/commit/bd6f0d3eadfe5623657db6aeb69b94d21f86f4a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:39:54 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:39:54 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623173994.98.0.547138822469.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 87f502231c6d5b04a4d8aa23fba24fcf5303aebb by Batuhan Taskaya in branch '3.9': [3.9] bpo-11105: reduce the recursion limit for tests. (GH-26605) https://github.com/python/cpython/commit/87f502231c6d5b04a4d8aa23fba24fcf5303aebb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:42:26 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:42:26 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623174146.07.0.15232632403.issue11105@roundup.psfhosted.org> Batuhan Taskaya added the comment: The issue has been solved, all buildbots should now pass. Will continue to monitor the situation. Thanks for the report @kj! ---------- priority: release blocker -> resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:42:44 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:42:44 +0000 Subject: [issue11105] Compiling recursive Python ASTs crash the interpreter In-Reply-To: <1296709360.51.0.0254918555785.issue11105@psf.upfronthosting.co.za> Message-ID: <1623174164.97.0.641686028934.issue11105@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:50:20 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 08 Jun 2021 17:50:20 +0000 Subject: [issue44349] Edge case in pegen's error displaying with non-utf8 lines Message-ID: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> New submission from Ammar Askar : The AST currently stores column offsets for characters as byte-offsets. However, when displaying errors, these byte-offsets must be turned into character-offsets so that the characters line up properly with the characters on the line when printed. This is done with the function `byte_offset_to_character_offset` (https://github.com/python/cpython/blob/fdc7e52f5f1853e350407c472ae031339ac7f60c/Parser/pegen.c#L142-L161) which assumes that the line is UTF8 encoded. However, consider a file like this: '????????????' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError This prints File "test-normal.py", line 1 '????????????' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Generator expression must be parenthesized as expected. However if we use a custom source encoding line: # -*- coding: cp437 -*- '????????????' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError it ends up printing out File "C:\Users\ammar\junk\test-utf16.py", line 2 '??????' + f(4, 'Hi' for x in range(1)) # This line has a SyntaxError ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Generator expression must be parenthesized where the carets/offsets are misaligned with the actual characters. This is because the string "??" has the display width of 2 characters and encodes to 2 bytes in cp437 but when interpreted as utf-8 is the single character "?" with a display width of 1. Note that this edge case is relatively hard to trigger because ordinarily what will happen here is that the call to PyErr_ProgramTextObject will fail because it tries to decode the line as utf-8: https://github.com/python/cpython/blob/ae3c66acb89a6104fcd0eea760f80a0287327cc4/Python/errors.c#L1693-L1696 after which the error handling logic uses the tokenizer's internal buffer which has a proper utf-8 string. So this bug requires the input to be valid as both utf-8 and the source encoding. (Discovered while implementing PEP 657 https://github.com/colnotab/cpython/issues/10) ---------- components: Parser messages: 395347 nosy: ammar2, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Edge case in pegen's error displaying with non-utf8 lines versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 13:49:58 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 08 Jun 2021 17:49:58 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623174598.72.0.449831923637.issue44337@roundup.psfhosted.org> Batuhan Taskaya added the comment: Mark would you mind sharing your opinions on this: https://bugs.python.org/issue44313 (should we still keep generating LOAD_METHOD/CALL_METHOD for potential objects imported through `from x import y`, or they also generate LOAD_ATTR/CALL_FUNCTION). ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:13:50 2021 From: report at bugs.python.org (Aivar Annamaa) Date: Tue, 08 Jun 2021 18:13:50 +0000 Subject: [issue44350] Support Message-ID: <1623176030.37.0.450096721589.issue44350@roundup.psfhosted.org> Change by Aivar Annamaa : ---------- nosy: Aivar.Annamaa priority: normal severity: normal status: open title: Support _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:15:49 2021 From: report at bugs.python.org (Aivar Annamaa) Date: Tue, 08 Jun 2021 18:15:49 +0000 Subject: [issue44350] Support Command-click on window title on macOS Message-ID: <1623176149.18.0.85572317265.issue44350@roundup.psfhosted.org> New submission from Aivar Annamaa : Many macOS apps show location info about current document on command-clicking on window title. I just found out how to do it in Tkinter, so I wanted to share it in case someone wants to add it for IDLE: https://sourceforge.net/p/tcl/mailman/tcl-mac/thread/CAEbkakfc%2B5hUGMyWpjGF2DO7dWOX-3AyR8UOjGfbP8djWWtG-A%40mail.gmail.com/#msg37298382 ---------- assignee: -> terry.reedy components: +IDLE nosy: +terry.reedy title: Support -> Support Command-click on window title on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:27:21 2021 From: report at bugs.python.org (Aivar Annamaa) Date: Tue, 08 Jun 2021 18:27:21 +0000 Subject: [issue44350] Support Command-click on window title on macOS In-Reply-To: <1623176149.18.0.85572317265.issue44350@roundup.psfhosted.org> Message-ID: <1623176841.88.0.434065241612.issue44350@roundup.psfhosted.org> Aivar Annamaa added the comment: In short: window.wm_attributes("-titlepath", stringContainingTheAbsolutePathOfTheDocument) Passing empty string as the second argument turned the feature off. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:30:36 2021 From: report at bugs.python.org (Aivar Annamaa) Date: Tue, 08 Jun 2021 18:30:36 +0000 Subject: [issue44350] Make IDLE support Command-click on window title on macOS In-Reply-To: <1623176149.18.0.85572317265.issue44350@roundup.psfhosted.org> Message-ID: <1623177036.67.0.317734427647.issue44350@roundup.psfhosted.org> Change by Aivar Annamaa : ---------- title: Support Command-click on window title on macOS -> Make IDLE support Command-click on window title on macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:31:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 18:31:13 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623177073.76.0.677906002986.issue44335@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25191 pull_request: https://github.com/python/cpython/pull/26608 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:31:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 18:31:28 +0000 Subject: [issue44349] Edge case in pegen's error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623177088.44.0.0487535188793.issue44349@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Lysandros, could you take a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:32:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 18:32:27 +0000 Subject: [issue44349] Edge case in when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623177147.97.0.242041308567.issue44349@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This affects also older versions: python3.8 lel.py File "lel.py", line 3 ^ SyntaxError: Generator expression must be parenthesized ---------- title: Edge case in pegen's error displaying with non-utf8 lines -> Edge case in when error displaying with non-utf8 lines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:38:29 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 08 Jun 2021 18:38:29 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623177509.77.0.825883345028.issue44349@roundup.psfhosted.org> Change by Ammar Askar : ---------- title: Edge case in when error displaying with non-utf8 lines -> Edge case in compiler when error displaying with non-utf8 lines _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 14:39:27 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 08 Jun 2021 18:39:27 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623177567.63.0.0301917393797.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +25192 pull_request: https://github.com/python/cpython/pull/26609 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:00:01 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Tue, 08 Jun 2021 19:00:01 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 Message-ID: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> New submission from Miro Hron?ok : Hello. I think https://github.com/python/cpython/pull/23142 changed the behavior of distutils.sysconfig.parse_makefile(). A downstream Fedora report with an affected petsc package: https://bugzilla.redhat.com/show_bug.cgi?id=1959088 Reproducers (DeprecationWarnings removed for readability): $ cat makefile ALL: lib DIRS = ssls asls # isls rscs LOCDIR = src/tao/complementarity/impls/ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules include ${PETSC_DIR}/lib/petsc/conf/test $ python3.9 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['ssls', 'asls'] $ python3.10 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['ssls', 'asls', '#', 'isls', 'rscs'] And: $ cat makefile -include ../../../../petscdir.mk ALL: lib LIBBASE = libpetscksp DIRS = cr bcgs bcgsl cg cgs gmres cheby rich lsqr preonly tcqmr tfqmr \ qcg bicg minres symmlq lcd ibcgs python gcr fcg tsirm fetidp hpddm LOCDIR = src/ksp/ksp/impls/ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules include ${PETSC_DIR}/lib/petsc/conf/test $ python3.9 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 'preonly', 'tcqmr', 'tfqmr', 'qcg', 'bicg', 'minres', 'symmlq', 'lcd', 'ibcgs', 'python', 'gcr', 'fcg', 'tsirm', 'fetidp', 'hpddm'] $ python3.10 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['cr', 'bcgs', 'bcgsl', 'cg', 'cgs', 'gmres', 'cheby', 'rich', 'lsqr', 'preonly', 'tcqmr', 'tfqmr', '\\'] And: $ cat makefile -include ../../../../petscdir.mk ALL: lib LIBBASE = libpetscksp DIRS = jacobi none sor shell bjacobi mg eisens asm ksp composite redundant spai is pbjacobi vpbjacobi ml\ mat hypre tfs fieldsplit factor galerkin cp wb python \ chowiluviennacl chowiluviennaclcuda rowscalingviennacl rowscalingviennaclcuda saviennacl saviennaclcuda\ lsc redistribute gasm svd gamg parms bddc kaczmarz telescope patch lmvm hmg deflation hpddm hara LOCDIR = src/ksp/pc/impls/ include ${PETSC_DIR}/lib/petsc/conf/variables include ${PETSC_DIR}/lib/petsc/conf/rules include ${PETSC_DIR}/lib/petsc/conf/test $ python3.9 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml', 'mat', 'hypre', 'tfs', 'fieldsplit', 'factor', 'galerkin', 'cp', 'wb', 'python', 'chowiluviennacl', 'chowiluviennaclcuda', 'rowscalingviennacl', 'rowscalingviennaclcuda', 'saviennacl', 'saviennaclcuda', 'lsc', 'redistribute', 'gasm', 'svd', 'gamg', 'parms', 'bddc', 'kaczmarz', 'telescope', 'patch', 'lmvm', 'hmg', 'deflation', 'hpddm', 'hara'] $ python3.10 >>> from distutils.sysconfig import parse_makefile >>> makevars = parse_makefile('makefile') >>> makevars.get('DIRS','').split() ['jacobi', 'none', 'sor', 'shell', 'bjacobi', 'mg', 'eisens', 'asm', 'ksp', 'composite', 'redundant', 'spai', 'is', 'pbjacobi', 'vpbjacobi', 'ml\\'] ---------- components: Library (Lib) messages: 395352 nosy: frenzy, hroncok, petr.viktorin priority: normal severity: normal status: open title: distutils.sysconfig.parse_makefile() regression in Python 3.10 type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:02:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 19:02:12 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623178932.59.0.364375217354.issue44335@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bafe0aade5741ab0d13143ee261711fdd65e8a1f by Pablo Galindo in branch 'main': bpo-44335: Ensure the tokenizer doesn't go into Python with the error set (GH-26608) https://github.com/python/cpython/commit/bafe0aade5741ab0d13143ee261711fdd65e8a1f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:02:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 19:02:23 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623178943.79.0.846544678334.issue44335@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25193 pull_request: https://github.com/python/cpython/pull/26610 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:03:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 19:03:32 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623179012.1.0.401838095496.issue44349@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25194 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26611 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:04:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 19:04:33 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623179073.49.0.195469056449.issue44349@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think the simplest solution is PR 26611. Ammar, can you check if that works for you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:05:21 2021 From: report at bugs.python.org (Mike Kaganski) Date: Tue, 08 Jun 2021 19:05:21 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow Message-ID: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> New submission from Mike Kaganski : On a Windows 10 system, which TZ is set to Moscow (UTC+3), I use a native Windows Python build (as opposed to e.g. one from Cygwin). Specifically, I tested both custom Python build created by LibreOffice project, as well as the Python by Python Software Foundation available from MS Store [1]. 1. Open command prompt on Windows (cmd.exe). 2. Execute 'set TZ=Europe/Moscow' 3. Execute 'python' 4. In the Python prompt, execute 'import datetime' 5. Execute 'datetime.datetime.now()' The result of this is a time that is two hours off, e.g. > datetime.datetime(2021, 6, 8, 19, 59, 21, 925240) instead of proper > datetime.datetime(2021, 6, 8, 21, 59, 21, 925240) which appears when step #2 is skipped. Possibly Python takes both system time zone information *and* the environment variable into account when calculating the time. I suppose it should only consider one or the other, not both. Note that the problem does not happen with Cygwin's Python, which works fine with the same TZ environment variable value. For a real-life problem that results from this, see case at [2], where unit test is failing only from 00:00 till 02:00 on my local system, obviously telling me that I should sleep at that time, not try to run unit tests :-) [1] https://www.microsoft.com/en-us/p/python-38/9mssztt1n39l [2] https://gerrit.libreoffice.org/c/core/+/92217/2#message-f55091795e7cde9d75adc00ddb69451121b644f6 ---------- components: Windows messages: 395355 nosy: mikekaganski, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:25:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 19:25:25 +0000 Subject: [issue44335] "Wrong" invalid character identified In-Reply-To: <1623085667.6.0.884749551164.issue44335@roundup.psfhosted.org> Message-ID: <1623180325.22.0.782506330941.issue44335@roundup.psfhosted.org> miss-islington added the comment: New changeset 2a8d7122e0ceeb56b716cff7f8f31f13c26ad691 by Miss Islington (bot) in branch '3.10': bpo-44335: Ensure the tokenizer doesn't go into Python with the error set (GH-26608) https://github.com/python/cpython/commit/2a8d7122e0ceeb56b716cff7f8f31f13c26ad691 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:35:26 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 19:35:26 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623180926.16.0.951364558939.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25195 pull_request: https://github.com/python/cpython/pull/26612 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:35:17 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 19:35:17 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623180917.9.0.79064089097.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset ab36b9f83424a020fbd672f218612e6f19257a32 by Terry Jan Reedy in branch 'main': bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593) https://github.com/python/cpython/commit/ab36b9f83424a020fbd672f218612e6f19257a32 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 15:35:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 19:35:33 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623180933.34.0.569216895011.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25196 pull_request: https://github.com/python/cpython/pull/26613 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:01:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 20:01:31 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623182491.54.0.397214017832.issue40468@roundup.psfhosted.org> miss-islington added the comment: New changeset 2cfe0e7061e9a2113e56e44a3e0c3f824cbc65db by Miss Islington (bot) in branch '3.10': bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593) https://github.com/python/cpython/commit/2cfe0e7061e9a2113e56e44a3e0c3f824cbc65db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:21:48 2021 From: report at bugs.python.org (Joseph Perez) Date: Tue, 08 Jun 2021 20:21:48 +0000 Subject: [issue44353] PEP 604 NewType Message-ID: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> New submission from Joseph Perez : `typing.NewType` doesn't support PEP 604. ``` >>> import typing >>> A = typing.NewType("A", int) >>> B = typing.NewType("B", str) >>> A | B Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for |: 'function' and 'function' ``` ---------- messages: 395359 nosy: joperez priority: normal severity: normal status: open title: PEP 604 NewType versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:29:54 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 08 Jun 2021 20:29:54 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623184194.41.0.088628776943.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: As mentioned in msg394775, I'd like to decouple the performance concerns from the original incompatibility. I recognize that performance regressions are in their own way a form of incompatibility, but there have been a lot of changes to entry points with respect to performance, both prior to beta 1 and in beta 2, including changes that intentionally traded performance for correctness (https://github.com/python/importlib_metadata/pull/281). To that end, I've filed https://github.com/python/importlib_metadata/issues/324 to track the concerns. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:33:34 2021 From: report at bugs.python.org (Anthony Sottile) Date: Tue, 08 Jun 2021 20:33:34 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623184414.75.0.520523852794.issue44246@roundup.psfhosted.org> Anthony Sottile added the comment: they are directly coupled which is why I commented here the api redesign forces O(N) lookups and O(N) constructions which directly impact performance causing the regression ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:36:09 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 08 Jun 2021 20:36:09 +0000 Subject: [issue44354] ssl deprecation warnings erganomics Message-ID: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> New submission from Thomas Grainger : The ssl module OP_NO_* deprecation warning message is slightly wrong: The error message prints out "is deprecated is deprecated" because of an earlier format template There's a colon in the warning message `ssl module:` and that makes it difficult to use in simplefilter The NPN deprecation warnning raises a UserWarning instead of DeprecationWarning see also UserWarning: ssl module: NPN is deprecated, use ALPN instead ---------- messages: 395362 nosy: alex, christian.heimes, dstufft, graingert, janssen priority: normal pull_requests: 25197 severity: normal status: open title: ssl deprecation warnings erganomics versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 16:58:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 20:58:32 +0000 Subject: [issue44350] IDLE: support Command-click on window title on macOS In-Reply-To: <1623176149.18.0.85572317265.issue44350@roundup.psfhosted.org> Message-ID: <1623185912.54.0.789387705015.issue44350@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren title: Make IDLE support Command-click on window title on macOS -> IDLE: support Command-click on window title on macOS versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 17:25:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 21:25:08 +0000 Subject: [issue44350] IDLE: support Command-click on window title on macOS In-Reply-To: <1623176149.18.0.85572317265.issue44350@roundup.psfhosted.org> Message-ID: <1623187508.91.0.271066077317.issue44350@roundup.psfhosted.org> Terry J. Reedy added the comment: Documented as macOS specific at https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm. But I would not know about C-click from "Specifies the path of the file referenced as the window proxy icon (which can be dragged and dropped in lieu of the file's finder icon). " IDLE document windows already have the absolute path in the title. There is only an issue if it is too long for the space, such as when editing installed idlelib test files. I don't know what will happen if/when you use tabbed windows. In the meanwhile, it would be easy to add if long and sys.platform == 'darwin': # Only valid as long as 'long' is absolute path. self.top.wm_attributes("-titlepath", long) to the end of editor.EditorWindow.saved_change_hook. Ned or Ronald, is this worth it? Is there any downside to this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 17:27:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 08 Jun 2021 21:27:08 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623187628.35.0.407432085139.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset c03f0ab259dc6d1447d47e845c6465b59f9a032c by Miss Islington (bot) in branch '3.9': bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593) https://github.com/python/cpython/commit/c03f0ab259dc6d1447d47e845c6465b59f9a032c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 18:01:42 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 08 Jun 2021 22:01:42 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623189702.17.0.930052184699.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset 3e1c7167d86a2a928cdcb659094aa10bb5550c4c by Eric Snow in branch 'main': bpo-43693: Un-revert commit f3fa63e. (#26609) https://github.com/python/cpython/commit/3e1c7167d86a2a928cdcb659094aa10bb5550c4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 18:31:50 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 08 Jun 2021 22:31:50 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623191510.09.0.0257784910677.issue44354@roundup.psfhosted.org> Thomas Grainger added the comment: the "ssl module:" part of the warning message, I think, is redundant as it should be defined in the https://docs.python.org/3/library/warnings.html#warnings.warn_explicit module kwarg ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:20:28 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 08 Jun 2021 23:20:28 +0000 Subject: [issue44340] Add support for building cpython with clang thin lto In-Reply-To: <1623105491.02.0.949113840673.issue44340@roundup.psfhosted.org> Message-ID: <1623194428.27.0.124287657184.issue44340@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Build -Interpreter Core nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:31:18 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 23:31:18 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1623195078.64.0.575068939286.issue43833@roundup.psfhosted.org> miss-islington added the comment: New changeset 2ea6d890281c415e0a2f00e63526e592da8ce3d9 by Serhiy Storchaka in branch 'main': bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466) https://github.com/python/cpython/commit/2ea6d890281c415e0a2f00e63526e592da8ce3d9 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:31:20 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 23:31:20 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1623195080.82.0.273519148084.issue43833@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25198 pull_request: https://github.com/python/cpython/pull/26614 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:52:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 23:52:31 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1623196351.5.0.681833681223.issue43833@roundup.psfhosted.org> miss-islington added the comment: New changeset eeefa7f6c0cc64bc74c3b96a0ebbff1a2b9d3199 by Miss Islington (bot) in branch '3.10': bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466) https://github.com/python/cpython/commit/eeefa7f6c0cc64bc74c3b96a0ebbff1a2b9d3199 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:53:29 2021 From: report at bugs.python.org (Akira Nonaka) Date: Tue, 08 Jun 2021 23:53:29 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623196409.63.0.311965978349.issue44345@roundup.psfhosted.org> Change by Akira Nonaka : ---------- pull_requests: +25199 pull_request: https://github.com/python/cpython/pull/26615 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:54:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 08 Jun 2021 23:54:37 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623196477.96.0.452365239993.issue44349@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25200 pull_request: https://github.com/python/cpython/pull/26616 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:54:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 23:54:36 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623196476.74.0.586662731451.issue44349@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9fd21f649d66dcb10108ee395fd68ed32c8239cd by Pablo Galindo in branch 'main': bpo-44349: Fix edge case when displaying text from files with encoding in syntax errors (GH-26611) https://github.com/python/cpython/commit/9fd21f649d66dcb10108ee395fd68ed32c8239cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 19:55:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 08 Jun 2021 23:55:24 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623196524.05.0.882431451496.issue44349@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 Jun 8 20:25:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 00:25:00 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1623198300.35.0.460440695604.issue43833@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 Jun 8 20:29:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 00:29:32 +0000 Subject: [issue44349] Edge case in compiler when error displaying with non-utf8 lines In-Reply-To: <1623174620.92.0.143887592684.issue44349@roundup.psfhosted.org> Message-ID: <1623198572.92.0.644983308823.issue44349@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c0496093e54edb78d2bd09b083b73e1e5b9e7242 by Miss Islington (bot) in branch '3.10': bpo-44349: Fix edge case when displaying text from files with encoding in syntax errors (GH-26611) (GH-26616) https://github.com/python/cpython/commit/c0496093e54edb78d2bd09b083b73e1e5b9e7242 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:09:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 01:09:49 +0000 Subject: [issue35800] remove smtpd.MailmanProxy In-Reply-To: <1548091630.84.0.140233087609.issue35800@roundup.psfhosted.org> Message-ID: <1623200989.23.0.377239293577.issue35800@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 4.0 -> 5.0 pull_requests: +25201 pull_request: https://github.com/python/cpython/pull/26617 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:10:05 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 09 Jun 2021 01:10:05 +0000 Subject: [issue44355] Allow spaces in format strings Message-ID: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> New submission from Steven D'Aprano : Format strings should allow spaces around keys and indices. This might be as simple as running str.strip() on the contents of curly braces? Aside from indentation and newlines, in most other contexts whitespace is insignificant. E.g. in subscripting `seq[ index ]`. But format strings treat spaces as part of the index or key, which is surprising. f-strings, on the other hand, already allow spaces around expressions and keys: >>> name = 'Brian' >>> f'{ name.upper() }' 'BRIAN' Examples: '{ }'.format(30) Expect to get '30' but get KeyError: ' ' '{ 0 }'.format(30) Expect to get '30' but get KeyError: ' 0 ' '{ x }'.format(x=30) Expect to get '30' but get KeyError: ' x ' See discussion here: https://discuss.python.org/t/please-help-key-error/9168/1 ---------- messages: 395371 nosy: steven.daprano priority: normal severity: normal status: open title: Allow spaces in format strings type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:12:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 09 Jun 2021 01:12:29 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623201149.87.0.363582643035.issue40468@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +25202 pull_request: https://github.com/python/cpython/pull/26618 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:19:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 09 Jun 2021 01:19:25 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623201565.75.0.417928227732.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: PR-26618 wraps the extension functions in a new class, ExtPage, and then moves the new class after GenPage. I verified that replacing the indent slider with a spinbox results in the dialog being shorter by the full height of the helplist frame. I will do that (or use a plain entry box) when I move it Window Preferences, after splitting GenPage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:25:57 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Jun 2021 01:25:57 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1623201957.79.0.0750958688264.issue44355@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:43:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 09 Jun 2021 01:43:57 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623203037.48.0.769015858431.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 5571cabf1b3385087aba2c7c10289bba77494e08 by Terry Jan Reedy in branch 'main': bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618) https://github.com/python/cpython/commit/5571cabf1b3385087aba2c7c10289bba77494e08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:44:00 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 01:44:00 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623203040.76.0.926212239104.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25203 pull_request: https://github.com/python/cpython/pull/26619 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 21:46:29 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 01:46:29 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623203189.09.0.237893415685.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25204 pull_request: https://github.com/python/cpython/pull/26620 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 22:05:35 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 02:05:35 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623204335.86.0.824550399555.issue40468@roundup.psfhosted.org> miss-islington added the comment: New changeset c8353239eda0d05f7facd1a19acc2b836a057807 by Miss Islington (bot) in branch '3.9': bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618) https://github.com/python/cpython/commit/c8353239eda0d05f7facd1a19acc2b836a057807 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 22:11:34 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 02:11:34 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623204694.1.0.809831015017.issue40468@roundup.psfhosted.org> miss-islington added the comment: New changeset 33a7a24288988134e89200a33802af56a2dee31e by Miss Islington (bot) in branch '3.10': bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618) https://github.com/python/cpython/commit/33a7a24288988134e89200a33802af56a2dee31e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 22:43:36 2021 From: report at bugs.python.org (Yury Selivanov) Date: Wed, 09 Jun 2021 02:43:36 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623206616.44.0.188979446884.issue38323@roundup.psfhosted.org> Yury Selivanov added the comment: > MultiLoopChildWatcher must ensures that the event loop is awaken when it receives a signal by using signal.setwakeup(). This is done by _UnixSelectorEventLoop.add_signal_handler(). Maybe MultiLoopChildWatcher could reuse this function, rather than calling directly signal.signal(). I think this is a good idea. MultiLoopChildWatcher could use setwakeupfd with some no-op callback just to wakeup the loop. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 22:44:42 2021 From: report at bugs.python.org (Duane Griffin) Date: Wed, 09 Jun 2021 02:44:42 +0000 Subject: [issue39345] Py_Initialize Hangs on Windows 10 In-Reply-To: <1579114556.26.0.996943969176.issue39345@roundup.psfhosted.org> Message-ID: <1623206682.6.0.478952178329.issue39345@roundup.psfhosted.org> Duane Griffin added the comment: I can reproduce this on Windows 10 with Python 3.9. See attached source. At least for us, it is hanging when one thread is doing a read on the file descriptor while a second calls Py_Initialize (or just dup directly). The windows kernel call stack shows the dup call is waiting on a critical section, while the thread reading from stdin is waiting in ReadFile. I can get a full stack trace from WinDbg if it is helpful, but hopefully the attached code should be enough to reproduce the problem at will for anyone interested. If stdin is receiving input, or is closed, then the read call will complete and unblock dup in due course. However if not then it will hang indefinitely. If we can fix this to work reliably in Python that would be great. Otherwise, or in the meantime, we could just add a note to the documentation. We are going to try and work-around it by using a different file descriptor instead of stdin. Other applications might be able to avoid IO using stdin until after python is initialised. ---------- nosy: +duaneg Added file: https://bugs.python.org/file50099/dup-hang.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 8 23:33:44 2021 From: report at bugs.python.org (Cameron Simpson) Date: Wed, 09 Jun 2021 03:33:44 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1623209624.69.0.667802708314.issue44355@roundup.psfhosted.org> Change by Cameron Simpson : ---------- nosy: +cameron _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 00:20:29 2021 From: report at bugs.python.org (Jordan Ephron) Date: Wed, 09 Jun 2021 04:20:29 +0000 Subject: [issue44356] Abstract enum mixins not allowed Message-ID: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> New submission from Jordan Ephron : Prior to 3.8 it was possible to create "abstract" enums (without members) and mix them together. To motivate with an example, perhaps we're modeling an API and want to be robust in the face of inconsistent casing class CaseInsensitiveStrEnum(str, Enum): @classmethod def _missing_(cls, value): for member in cls._member_map_.values(): if member._value_.lower() == value.lower(): return member return super()._missing_(value) and perhaps we also want to be robust in response to extensibility class LenientStrEnum(str, Enum): @classmethod def _missing_(cls, value): logger.warning( f"[{cls.__name__}] encountered an unknown value!\n" f"Luckily I'm a LenientStrEnum, so I won't crash just yet.\n" f"You might want to add a new case though.\n" f"Value was: '{value}'" ) return UnexpectedStr(value) but we also want to model some known good set of values, so mixing together the abstract enums we'd get something like class JobStatus(CaseInsensitiveStrEnum, LenientStrEnum): ACTIVE = "active" PENDING = "pending" TERMINATED = "terminated" However, due to the resolution of https://bugs.python.org/issue39587 this no longer works, instead producing: TypeError: 'JobStatus': too many data types: [, ] The relevant change is https://github.com/ethanfurman/cpython/commit/bff01f3a3aac0c15fe8fbe8b2f561f7927d117a1 I believe that if we made `data_types` a set rather than a list then the example would become valid once again. ---------- messages: 395378 nosy: JEphron priority: normal severity: normal status: open title: Abstract enum mixins not allowed type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 00:25:12 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 09 Jun 2021 04:25:12 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623212712.37.0.524055099277.issue44356@roundup.psfhosted.org> Change by Ethan Furman : ---------- assignee: -> ethan.furman nosy: +ethan.furman versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 02:18:22 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Wed, 09 Jun 2021 06:18:22 +0000 Subject: [issue44346] Fraction constructor may accept spaces around '/' In-Reply-To: <1623140976.11.0.768118294716.issue44346@roundup.psfhosted.org> Message-ID: <1623219502.06.0.242287164256.issue44346@roundup.psfhosted.org> Vedran ?a?i? added the comment: Of course, I'm for it. But we have to be consistent... I was surprised to realize `complex` doesn't accept '2 + 3j' (even though it accepts '(2+3j)', and even '\n2+3j\t'). There are a lot of slippery slopes here (e.g. how about 3_j?). I think that once we allowed _ in integer literals, suddenly we could add more separation between digits than around them in many contexts, and that just seems wrong. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 02:20:20 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 09 Jun 2021 06:20:20 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623219620.33.0.642463475167.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: Excellent bug report. But what is an `UnexpectedString()` ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 02:34:23 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Wed, 09 Jun 2021 06:34:23 +0000 Subject: [issue44346] Fraction constructor may accept spaces around '/' In-Reply-To: <1623219502.06.0.242287164256.issue44346@roundup.psfhosted.org> Message-ID: Sergey B Kirpichev added the comment: On Wed, Jun 09, 2021 at 06:18:22AM +0000, Vedran ?a?i? wrote: > I was surprised to realize `complex` doesn't accept '2 + 3j' Good catch, probably that should be allowed too. > e.g. how about 3_j? The PEP 515 added '_' as a separator between digits. But the imaginary unit is not a digit. For same reason '1_/_2' shouldn't be allowed for the Rational constructor. (Unfortunately, the Decimal class breaks this PEP convention as well as some other, see issue44267. For example, it accepts things like '1_._2'.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 02:56:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 06:56:21 +0000 Subject: [issue44346] Fraction constructor may accept spaces around '/' In-Reply-To: <1623140976.11.0.768118294716.issue44346@roundup.psfhosted.org> Message-ID: <1623221781.08.0.0904851695746.issue44346@roundup.psfhosted.org> Mark Dickinson added the comment: > I was surprised to realize `complex` doesn't accept '2 + 3j' See previous discussion in #9574. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 02:57:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Jun 2021 06:57:14 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1623221834.15.0.0992680769588.issue44355@roundup.psfhosted.org> Eric V. Smith added the comment: The problem with this change is that it wouldn't be backward compatible. I'm not sure how many people it would affect, but probably more than zero. >>> str.format('{ 0 }', **{' 0 ': 42}) '42' >>> str.format('{ }', **{' ': 43}) '43' Does that mean it can't be changed? Not necessarily, of course. I agree it's unfortunate that we didn't specify this back with PEP 3101. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:04:43 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Wed, 09 Jun 2021 07:04:43 +0000 Subject: [issue44346] Fraction constructor may accept spaces around '/' In-Reply-To: <1623140976.11.0.768118294716.issue44346@roundup.psfhosted.org> Message-ID: <1623222283.2.0.882441421859.issue44346@roundup.psfhosted.org> Sergey B Kirpichev added the comment: > See previous discussion in #9574. Given this, probably spaces around '/' should be disallowed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:08:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 09 Jun 2021 07:08:20 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623222499.99.0.80011527996.issue40468@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- pull_requests: +25205 pull_request: https://github.com/python/cpython/pull/26621 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:33:26 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Wed, 09 Jun 2021 07:33:26 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623224006.36.0.401288111218.issue44351@roundup.psfhosted.org> Lum?r Balhar added the comment: Thanks for the report. The regression is caused by the fact that the old implementation of parse_makefile in distutils.sysconfig was using feature-rich class TextFile which handles all the functionalities you reported as broken - stripping of comments, joining lines, and more. The new implementation of parse_makefile in sysconfig just reads all the lines without any processing. The TextFile class is deprecated together with the whole distutils. The class is not used outside of distutils modules, only in these functions: distutils.extension:read_setup_file distutils.sdist:read_template + its tests in distutils/tests/test_text_file.py If the functionality is something we want to preserve, we should find a new home for the class and then we can use it in the sysconfig module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:45:49 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 07:45:49 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root Message-ID: <1623224749.57.0.0756711881662.issue44357@roundup.psfhosted.org> Change by Ajith Ramachandran : ---------- components: Library (Lib) nosy: AjithRamachandran priority: normal severity: normal status: open title: Add math.cbrt() function: Cube Root type: enhancement versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:50:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 07:50:20 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). Message-ID: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> New submission from STINNER Victor : On RHEL8, gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) fails to build Python with LTO+PGO: the linker fails with "Dwarf Error". On ~200 builds, the linker error only occurred once (build 279) :-( It sounds really hard to reproduce. I suggest to close the issue as "out of date" if it doesn't come back next weeks. https://buildbot.python.org/all/#/builders/568/builds/279 gcc -pthread -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -fprofile-generate -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.11.a -lcrypt -lpthread -ldl -lutil -lm -lm /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). /usr/bin/ld: Dwarf Error: Could not find abbrev number 12095. Then the linker failed to find many symbols: /tmp/cccV00H7.lto.o: In function `signal_pthread_sigmask': :(.text+0x292cbc): undefined reference to `_Py_Sigset_Converter' /tmp/cccV00H7.lto.o: In function `fill_siginfo': :(.text+0x2930cb): undefined reference to `_PyLong_FromUid' /tmp/cccV00H7.lto.o: In function `signal_sigwaitinfo': :(.text+0x29325e): undefined reference to `_Py_Sigset_Converter' /tmp/cccV00H7.lto.o: In function `signal_sigtimedwait': :(.text+0x293566): undefined reference to `_Py_Sigset_Converter' /tmp/cccV00H7.lto.o: In function `signal_sigwait': :(.text+0x293af0): undefined reference to `_Py_Sigset_Converter' /tmp/cccV00H7.lto.o: In function `PyUnicode_FSDecoder': :(.text+0x315fed): undefined reference to `PyOS_FSPath' /tmp/cccV00H7.lto.o: In function `mkpwent': :(.text+0x31a78c): undefined reference to `_PyLong_FromUid' :(.text+0x31a7a1): undefined reference to `_PyLong_FromGid' /tmp/cccV00H7.lto.o: In function `pwd_getpwuid': :(.text+0x31afb6): undefined reference to `_Py_Uid_Converter' :(.text+0x31b1df): undefined reference to `_PyLong_FromUid' /tmp/cccV00H7.lto.o: In function `PyUnicode_FSConverter': :(.text+0x349247): undefined reference to `PyOS_FSPath' /tmp/cccV00H7.lto.o: In function `_io_open': :(.text+0x38781d): undefined reference to `PyOS_FSPath' /tmp/cccV00H7.lto.o:(.data+0x74528): undefined reference to `PyInit_posix' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:603: python] Error 1 make[3]: *** Waiting for unfinished jobs.... /usr/bin/ld: Dwarf Error: Could not find abbrev number 6864. /tmp/ccMUbctW.lto.o: In function `fill_siginfo': :(.text+0x1f010b): undefined reference to `_PyLong_FromUid' /tmp/ccMUbctW.lto.o: In function `signal_sigwait': :(.text+0x2a6d80): undefined reference to `_Py_Sigset_Converter' /tmp/ccMUbctW.lto.o: In function `signal_sigwaitinfo': :(.text+0x2a821e): undefined reference to `_Py_Sigset_Converter' /tmp/ccMUbctW.lto.o: In function `signal_pthread_sigmask': :(.text+0x2b05bc): undefined reference to `_Py_Sigset_Converter' /tmp/ccMUbctW.lto.o: In function `signal_sigtimedwait': :(.text+0x2b2536): undefined reference to `_Py_Sigset_Converter' /tmp/ccMUbctW.lto.o: In function `PyUnicode_FSDecoder': :(.text+0x30d08d): undefined reference to `PyOS_FSPath' /tmp/ccMUbctW.lto.o: In function `mkpwent': :(.text+0x30edac): undefined reference to `_PyLong_FromUid' :(.text+0x30edc1): undefined reference to `_PyLong_FromGid' /tmp/ccMUbctW.lto.o: In function `pwd_getpwuid': :(.text+0x30f5d6): undefined reference to `_Py_Uid_Converter' :(.text+0x30f7ff): undefined reference to `_PyLong_FromUid' /tmp/ccMUbctW.lto.o: In function `PyUnicode_FSConverter': :(.text+0x33b157): undefined reference to `PyOS_FSPath' /tmp/ccMUbctW.lto.o: In function `_io_open': :(.text+0x377d0d): undefined reference to `PyOS_FSPath' /tmp/ccMUbctW.lto.o:(.data+0x84748): undefined reference to `PyInit_posix' collect2: error: ld returned 1 exit status make[3]: *** [Makefile:744: Programs/_testembed] Error 1 make[3]: Leaving directory '/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build' make[2]: *** [Makefile:533: build_all_generate_profile] Error 2 make[2]: Leaving directory '/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build' make[1]: *** [Makefile:509: profile-gen-stamp] Error 2 make[1]: Leaving directory '/home/buildbot/buildarea/3.x.cstratak-RHEL8-x86_64.lto-pgo/build' make: *** [Makefile:521: profile-run-stamp] Error 2 program finished with exit code 2 elapsedTime=157.205212 ---------- components: Build messages: 395386 nosy: pablogsal, vstinner priority: normal severity: normal status: open title: AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:56:06 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 09 Jun 2021 07:56:06 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623225366.3.0.772739810967.issue44351@roundup.psfhosted.org> Petr Viktorin added the comment: IMO, the functionality should only be preserved until distutils is removed. So: - distutils.sysconfig.parse_makefile should use TextFile as before, so projects that use it aren't broken *yet* - nothing else should call distutils.sysconfig.parse_makefile, so it doesn't block removing distutils Would that make sense? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:58:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 07:58:31 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched Message-ID: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> New submission from STINNER Victor : test_ftplib fails with "env changed" if a socket operation times out in a thread (in the "dummy FTP server"). Example on AMD64 Fedora Rawhide LTO 3.10: https://buildbot.python.org/all/#/builders/653/builds/95 0:02:41 load avg: 8.20 [394/427/1] test_ftplib failed (env changed) -- running: test_lib2to3 (33.9 sec), test_peg_generator (2 min 37 sec), test_concurrent_futures (1 min 53 sec), test_gdb (1 min 37 sec) Warning -- Uncaught thread exception: Exception Exception in thread Thread-34: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py", line 420, in handle_read_event self.handle_read() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asynchat.py", line 171, in handle_read self.found_terminator() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py", line 129, in found_terminator method(arg) File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py", line 154, in cmd_pasv conn, addr = sock.accept() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() TimeoutError: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/threading.py", line 1006, in _bootstrap_inner self.run() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py", line 292, in run asyncore.loop(timeout=0.1, count=1) File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py", line 150, in poll read(obj) File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/home/buildbot/buildarea/3.10.cstratak-fedora-rawhide-x86_64.lto/build/Lib/test/test_ftplib.py", line 134, in handle_error raise Exception Exception test_abort (test.test_ftplib.TestFTPClass) ... ok (...) test__all__ (test.test_ftplib.MiscTestCase) ... ok ---------------------------------------------------------------------- Ran 94 tests in 8.491s OK (skipped=2) A similar issue (is it the same one?) can be reproduced with attached test_ftplib_timeout.patch which sets the timeout to 1 nanosecond and the command: $ ./python -m test test_ftplib -v --fail-env-changed -m test.test_ftplib.TestFTPClass.test_retrlines == CPython 3.11.0a0 (heads/main:257e400a19, Jun 8 2021, 18:04:17) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] == Linux-5.12.8-300.fc34.x86_64-x86_64-with-glibc2.33 little-endian == cwd: /home/vstinner/python/main/build/test_python_129053? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.03 Run tests sequentially 0:00:00 load avg: 1.03 [1/1] test_ftplib test_retrlines (test.test_ftplib.TestFTPClass) ... Warning -- Uncaught thread exception: Exception Exception in thread Thread-1: Traceback (most recent call last): File "/home/vstinner/python/main/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/home/vstinner/python/main/Lib/asyncore.py", line 420, in handle_read_event self.handle_read() File "/home/vstinner/python/main/Lib/asynchat.py", line 171, in handle_read self.found_terminator() File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 129, in found_terminator method(arg) File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 154, in cmd_pasv conn, addr = sock.accept() File "/home/vstinner/python/main/Lib/socket.py", line 293, in accept fd, addr = self._accept() TimeoutError: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/vstinner/python/main/Lib/threading.py", line 1006, in _bootstrap_inner self.run() File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 292, in run asyncore.loop(timeout=0.1, count=1) File "/home/vstinner/python/main/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/home/vstinner/python/main/Lib/asyncore.py", line 150, in poll read(obj) File "/home/vstinner/python/main/Lib/asyncore.py", line 87, in read obj.handle_error() File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 134, in handle_error raise Exception Exception ERROR ====================================================================== ERROR: test_retrlines (test.test_ftplib.TestFTPClass) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_ftplib.py", line 598, in test_retrlines self.client.retrlines('retr', received.append) File "/home/vstinner/python/main/Lib/ftplib.py", line 462, in retrlines with self.transfercmd(cmd) as conn, \ File "/home/vstinner/python/main/Lib/ftplib.py", line 393, in transfercmd return self.ntransfercmd(cmd, rest)[0] File "/home/vstinner/python/main/Lib/ftplib.py", line 354, in ntransfercmd conn = socket.create_connection((host, port), self.timeout, File "/home/vstinner/python/main/Lib/socket.py", line 844, in create_connection raise err File "/home/vstinner/python/main/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused ---------------------------------------------------------------------- Ran 1 test in 0.021s FAILED (errors=1) test test_ftplib failed test_ftplib failed == Tests result: FAILURE == 1 test failed: test_ftplib Total duration: 169 ms Tests result: FAILURE ---------- components: Tests files: test_ftplib_timeout.patch keywords: patch messages: 395389 nosy: vstinner priority: normal severity: normal status: open title: test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50100/test_ftplib_timeout.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 03:58:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Jun 2021 07:58:30 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root Message-ID: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> New submission from Serhiy Storchaka : See also issue27353. ---------- nosy: +lemburg, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:02:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Jun 2021 08:02:51 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1623225771.12.0.922100903501.issue44359@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:06:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 08:06:22 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x Message-ID: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> New submission from STINNER Victor : test_compile and test_multiprocessing_forkserver crashed with segfault (SIGSEGV) on AMD64 Ubuntu 3.x: https://buildbot.python.org/all/#/builders/708/builds/31 It *seems* like test_compile.test_stack_overflow() crashed, but the log is not reliable so I cannot confirm. According to buildbot, the responsible change is: "bpo-43693: Un-revert commit f3fa63e. (#26609)(10 hours ago)" https://github.com/python/cpython/commit/3e1c7167d86a2a928cdcb659094aa10bb5550c4c So Eric, can you please investigate the change? If nobody is available to fix the buildbot, I suggest to revert the change. Python was built in debug mode with: ./configure --prefix '$(PWD)/target' --with-pydebug make all test.pythoninfo: CC.version: gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0 os.uname: posix.uname_result(sysname='Linux', nodename='doxy.learntosolveit.com', release='5.11.0-18-generic', version='#19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021', machine='x86_64') platform.platform: Linux-5.11.0-18-generic-x86_64-with-glibc2.33 sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', version='NPTL 2.33') Logs: ./python ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=900 -j2 --junit-xml test-results.xml == CPython 3.11.0a0 (heads/main:3e1c7167d8, Jun 8 2021, 22:09:42) [GCC 10.3.0] == Linux-5.11.0-18-generic-x86_64-with-glibc2.33 little-endian == cwd: /home/buildbot/buildarea/3.x.skumaran-ubuntu-x86_64/build/build/test_python_1439770? == CPU count: 1 == encodings: locale=UTF-8, FS=utf-8 Using random seed 5059550 0:00:00 load avg: 0.97 Run tests in parallel using 2 child processes (timeout: 15 min, worker timeout: 20 min) (...) 0:00:43 load avg: 2.22 running: test_compile (34.7 sec), test_signal (30.8 sec) 0:01:12 load avg: 3.84 [ 13/427/1] test_compile crashed (Exit code -9) -- running: test_signal (59.6 sec) (...) 0:06:26 load avg: 1.84 running: test_concurrent_futures (42.0 sec), test_multiprocessing_forkserver (30.0 sec) 0:06:56 load avg: 3.91 running: test_concurrent_futures (1 min 12 sec), test_multiprocessing_forkserver (1 min) 0:07:26 load avg: 5.47 running: test_concurrent_futures (1 min 42 sec), test_multiprocessing_forkserver (1 min 30 sec) 0:07:58 load avg: 5.93 running: test_concurrent_futures (2 min 13 sec), test_multiprocessing_forkserver (2 min 2 sec) 0:08:30 load avg: 5.73 running: test_concurrent_futures (2 min 44 sec), test_multiprocessing_forkserver (2 min 33 sec) 0:08:48 load avg: 4.62 [ 85/427/2] test_multiprocessing_forkserver crashed (Exit code -9) -- running: test_concurrent_futures (3 min 3 sec) (...) 2 tests failed: test_compile test_multiprocessing_forkserver (...) 0:27:56 load avg: 1.28 Re-running test_compile in verbose mode test_and (test.test_compile.TestExpressionStackSize) ... ok (...) test_sequence_unpacking_error (test.test_compile.TestSpecifics) ... ok test_single_statement (test.test_compile.TestSpecifics) ... ok test_stack_overflow (test.test_compile.TestSpecifics) ... make: *** [Makefile:1256: buildbottest] Killed program finished with exit code 2 elapsedTime=1684.973552 ---------- components: Tests messages: 395390 nosy: eric.snow, pablogsal, vstinner priority: normal severity: normal status: open title: test_compile segfault on AMD64 Ubuntu 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:06:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 08:06:47 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623226007.27.0.779928916203.issue44360@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44348 "test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:06:57 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 08:06:57 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623226017.42.0.384592651289.issue44348@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44360 "test_compile segfault on AMD64 Ubuntu 3.x". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:12:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 08:12:30 +0000 Subject: [issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10 Message-ID: <1623226350.91.0.267462887988.issue44361@roundup.psfhosted.org> New submission from STINNER Victor : x86 Gentoo Non-Debug with X 3.10: https://buildbot.python.org/all/#/builders/698/builds/112 This buildbot worker has Internet connection issues, so my concern is only how test_smtpnet handles Internet issues. The two tests which fail use "with socket_helper.transient_internet(self.testServer):", but it seems like this context manager doesn't catch SMTPServerDisconnected. Maybe transient_internet() should be modified to catch smtplib.SMTPServerDisconnected (or even the generic smtplib.SMTPException)? ====================================================================== ERROR: test_connect_default_port (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py", line 60, in test_connect_default_port server = smtplib.SMTP_SSL(self.testServer) File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 1045, in __init__ SMTP.__init__(self, host, port, local_hostname, timeout, File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 255, in __init__ (code, msg) = self.connect(host, port) File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 343, in connect (code, msg) = self.getreply() File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 400, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed ====================================================================== ERROR: test_connect_using_sslcontext (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/test/test_smtpnet.py", line 70, in test_connect_using_sslcontext server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 1045, in __init__ SMTP.__init__(self, host, port, local_hostname, timeout, File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 255, in __init__ (code, msg) = self.connect(host, port) File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 343, in connect (code, msg) = self.getreply() File "/buildbot/buildarea/cpython/3.10.ware-gentoo-x86.nondebug/build/Lib/smtplib.py", line 400, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") smtplib.SMTPServerDisconnected: Connection unexpectedly closed ---------- components: Tests messages: 395393 nosy: vstinner priority: normal severity: normal status: open title: test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10 versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:14:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Jun 2021 08:14:33 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1623226473.96.0.0347623609544.issue44355@roundup.psfhosted.org> Serhiy Storchaka added the comment: Syntax of format strings cannot be the same as in f-strings. {0} means the first positional argument in format string an integer literal 0 in f-string. {a[x]} means the value of literal string key "x" of keyword argument a in format string, and indexing variable a with variable index/key x in f-string. Such things as {if}, {+.name} or {0[-]} are not even valid in f-strings. Since we cannot get rid of all differences between format strings and f-strings, I do not think that this one change is worth. It will only make differences more complex. Not mentioning that it is a compatibility breaking change, and can break user code. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:15:32 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Jun 2021 08:15:32 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623226532.56.0.76422233346.issue44360@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:15:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Jun 2021 08:15:46 +0000 Subject: [issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10 In-Reply-To: <1623226350.91.0.267462887988.issue44361@roundup.psfhosted.org> Message-ID: <1623226546.09.0.350644414703.issue44361@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:16:52 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 08:16:52 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623226612.58.0.0656623529883.issue44357@roundup.psfhosted.org> Change by Ajith Ramachandran : ---------- keywords: +patch pull_requests: +25206 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26622 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:31:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 08:31:50 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). In-Reply-To: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> Message-ID: <1623227510.35.0.488548864827.issue44358@roundup.psfhosted.org> STINNER Victor added the comment: On OFTC #gcc, I'm told that it can this known issue fixed in 2018: https://sourceware.org/bugzilla/show_bug.cgi?id=23425 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:33:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 08:33:57 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623227637.25.0.627615211475.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: +1. This is part of C99, so if it's also supported by Visual Studio, then this seems like a no-brainer. If it's _not_ also supported by Visual Studio, or if there are implementations that have serious numerical problems (as was the case with fma) we'll need to write our own fallback implementation, which is less simple. In principle it should be relatively easy for a math library to provide a correctly-rounded cbrt. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:46:39 2021 From: report at bugs.python.org (Joongi Kim) Date: Wed, 09 Jun 2021 08:46:39 +0000 Subject: [issue44343] Adding the "with" statement support to ContextVar In-Reply-To: <1623119909.23.0.724701230762.issue44343@roundup.psfhosted.org> Message-ID: <1623228399.11.0.650764013986.issue44343@roundup.psfhosted.org> Joongi Kim added the comment: After checking out PEP-567 (https://www.python.org/dev/peps/pep-0567/), I'm adding njs to the nosy list. ---------- nosy: +njs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:51:43 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 09 Jun 2021 08:51:43 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623228703.83.0.284077519236.issue44339@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 04:52:14 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 09 Jun 2021 08:52:14 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1623228734.94.0.82861778818.issue44344@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:02:28 2021 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 09 Jun 2021 09:02:28 +0000 Subject: [issue44362] improve documentation of SSL deprecations Message-ID: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> New submission from Thomas Grainger : > I can see in the 3.10 release notes, that ssl.PROTOCOL_TLS becomes deprecated. Is there any further context explaining why, and what the preferred usage is instead, so that I (and anyone else) can understand this a bit more thoroughly? https://github.com/encode/httpx/issues/1670#issuecomment-857509311 ---------- messages: 395398 nosy: alex, christian.heimes, dstufft, graingert, janssen priority: normal severity: normal status: open title: improve documentation of SSL deprecations versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:02:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 09:02:57 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623229377.99.0.97367824118.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: BTW, to forestall questions about adding cmath.cbrt: it's not obvious how to extend the real cube root function to a complex cube root, so it might make sense to wait for actual use-cases before doing so. The issue is that the most natural way to define a complex cube root would use a branch cut along the negative real axis (the same branch cut that cmath.sqrt and cmath.log use). But then the principal branch would *not* be an extension of math.cbrt: it would return non-real values on the negative real axis. (The *real* cube roots of negative numbers would fall on the two non-principal branches.) See for example https://math.stackexchange.com/questions/71775/extending-the-cube-root-function-to-mathbbc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:03:58 2021 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 09 Jun 2021 09:03:58 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623229438.43.0.687198348449.issue44362@roundup.psfhosted.org> Thomas Grainger added the comment: It's also confusing that other not deprecated flags are described in terms of this deprecated flag. These will need rewriting when the deprecated flag is removed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:03:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 09:03:41 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). In-Reply-To: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> Message-ID: <1623229421.82.0.993407137781.issue44358@roundup.psfhosted.org> STINNER Victor added the comment: I reported the compiler bug to RHEL: https://bugzilla.redhat.com/show_bug.cgi?id=1969775 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:10:03 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 09 Jun 2021 09:10:03 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623229803.14.0.206163581056.issue44362@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: -> docs at python components: +Documentation, SSL nosy: +docs at python type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:10:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 09 Jun 2021 09:10:33 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623229833.59.0.448236565368.issue44354@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: -> christian.heimes components: +SSL stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:10:39 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 09 Jun 2021 09:10:39 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623229839.01.0.0835664755644.issue44354@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:15:30 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Wed, 09 Jun 2021 09:15:30 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623230130.51.0.810434657876.issue44351@roundup.psfhosted.org> Miro Hron?ok added the comment: Yes, for the purposes of this bug, bringing TextFile-powered parse_makefile() back to distutils (and distutils only) is the right thing to do. Whether or not Python needs a public standard library function to parse makefiles and whether that function in sysconfig is imperfect and needs improvements, that is an entirely different discussion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:30:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 09:30:48 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork Message-ID: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> New submission from Mark Shannon : Running the buildbot for https://github.com/python/cpython/pull/26595 results in failures: https://buildbot.python.org/all/#/builders/581/builds/63 Which claim that the address calculation in `LOAD_ATTR_MODULE` is out of bounds. The tests pass with an added assert to verify that the address in question is in bounds. All failures seem to happen after a fork, which seems to be a longstanding weakness of the address sanitizer. I'd like to merge https://github.com/python/cpython/pull/26595. I'd also like to keep the buildbots working. Dichotomy. ---------- messages: 395403 nosy: Mark.Shannon, pablogsal priority: normal severity: normal status: open title: Likely false positive for address sanitizer after fork _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 05:34:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 09 Jun 2021 09:34:21 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623226473.96.0.0347623609544.issue44355@roundup.psfhosted.org> Message-ID: <20210609093400.GP19019@ando.pearwood.info> Steven D'Aprano added the comment: I agree that we cannot make the syntax of format string identifal to f-strings. F-strings support arbitrary expressions, while format strings support only a small subset of possible identifiers. My comment was not to make format strings identical to f-strings, which would be impossible, but to point out that whitespace around identifiers and indices is not significant in most contexts, including f-strings. * in code `1 + a [ key ]` is the same as `1+a[key]` * the name ` spam ` is the same as `spam` * in f-strings `f'{ spam }'` and `f'{spam}'` are the same etc. Places (apart from indentation and newlines) where whitespace has meaning is very rare. But inside format braces it is treated as significant. In a format string, we cannot make spaces part of the keyword parameter: '{ } { 1 } { x }'.format(' '=20, ' 1 '=30, ' x '=40) is not valid syntax. I think that, for the format method, any whitespace in the `{}` will prevent the method from working and will raise KeyError. Unless I have missed something, I think that it is *impossible* for anyone to use spaces in the format method without an exception, and so it is safe for us to change the behaviour. Right now, the only reason spaces will appear inside the braces of a format string will be by mistake, which will raise. So unless I have missed something, this would be a safe enhancement for the `format` method that would make format strings behave more like other parts of Python code. One less surprise. The format_map method is a little bit different: >>> '{ x }'.format_map({'x': 10, ' x ': 20}) '20' So it is *possible*, but unlikely, that people are using keys with spaces in format_map calls. So we have some alternatives: 1. Reject this enhancement and do nothing. 2. Have the format method alone strip spaces, and format_map preserve them. This would be backwards compatible, but a surprising difference between the two methods. 3. Give format_map a keyword-only parameter, "preserve_spaces". The format method will always strip spaces; format_map will only strip them if the preserve_spaces parameter is False. 4. Probably nobody is *actually* using spaces in format_map either. It would be a very unusual and rare thing to do. So maybe we break backwards compatibility and don't bother with the extra keyword parameter. I think that option 3, with a default of True, would be safe. Option 3 with a default of False would technically break backwards compatibility, but would allow people who wanted the old behaviour to get it. Since I doubt that there are many people, I think that option 3 with a default of False is acceptable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 06:02:27 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 10:02:27 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623232947.59.0.0515715641811.issue44357@roundup.psfhosted.org> Ajith Ramachandran added the comment: When I needed a function to find cube root, I couldn't find one in the math module. Also found the `cbrt()` function in C. I didn't account for the complex numbers. I didn't wanted to make it a complex function unnecessarily. So I used the `cbrt()` function directly and it was working well for my test cases. And it is supported by visual studio. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 06:11:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 09 Jun 2021 10:11:22 +0000 Subject: [issue41165] [Python 3.10] Remove APIs deprecated long enough In-Reply-To: <1593492796.52.0.194597415316.issue41165@roundup.psfhosted.org> Message-ID: <1623233482.82.0.0498717120192.issue41165@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 06:31:02 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 09 Jun 2021 10:31:02 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623234662.78.0.343601503102.issue44348@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:01:27 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 11:01:27 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623236487.15.0.802667745716.issue44348@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +Mark.Shannon nosy_count: 9.0 -> 10.0 pull_requests: +25208 pull_request: https://github.com/python/cpython/pull/26623 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:02:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:02:09 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623236529.74.0.551985556409.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Buildbots have the priority, please don't merge anything that breaks the buildbots. We should figure out how to silence the false positive if indeed is one, but I don't think it is. The address sanitizer is not speculative, it literally checks if someone has written out of bounds ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:05:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Jun 2021 11:05:17 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1623236717.98.0.56861600078.issue44355@roundup.psfhosted.org> Eric V. Smith added the comment: See msg395383 for how it's an incompatible change even to .format(). In the 15 years since I implemented .format(), this is the first I've ever heard of someone being confused by adding extra spaces. I don't think it's worth changing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:08:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:08:01 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623236881.12.0.340948098058.issue44360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't think that's a segfault. That seems that the process was killed no? Also, the buildbot is green so this is not happening in the latest builds ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:09:18 2021 From: report at bugs.python.org (Martin Panter) Date: Wed, 09 Jun 2021 11:09:18 +0000 Subject: [issue44146] Format string fill not handling brace char In-Reply-To: <1621157543.56.0.155922835812.issue44146@roundup.psfhosted.org> Message-ID: <1623236958.29.0.051246124178.issue44146@roundup.psfhosted.org> Martin Panter added the comment: Another workaround: >>> '{:{brace}>10d}'.format(5, brace='{') '{{{{{{{{{5' ---------- nosy: +martin.panter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:14:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:14:37 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623237277.46.0.229640416627.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I can reproduce that failure of address sanitizer with GCC and clang separately, so it doesn't seem like a false positive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:39:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 09 Jun 2021 11:39:17 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623238757.97.0.477856914743.issue44357@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am surprised that this was not proposed before. Perhaps because it is so easy to write x**(1/3), and if you want a real root of negative argument, it is -(-x)**(1/3). It can be slightly less accurate that the result of C library function cbrt(), but good enough for any practical applications. Ajith, was you aware of x**(1/3)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:40:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:40:52 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623238852.58.0.502709185678.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Also, I can reproduce locally without any fork whatsoever: ./python -m test test_lib2to3 SUMMARY: AddressSanitizer: heap-buffer-overflow Python/ceval.c:3549 in _PyEval_EvalFrameDefault Shadow bytes around the buggy address: 0x0c1c8003ec40: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c1c8003ec50: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 0x0c1c8003ec60: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 0x0c1c8003ec70: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa 0x0c1c8003ec80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c1c8003ec90: 00 00 00 00 fa[fa]fa fa fa fa fa fa fd fd fd fd 0x0c1c8003eca0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa 0x0c1c8003ecb0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c1c8003ecc0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 0x0c1c8003ecd0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 0x0c1c8003ece0: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==14183==ABORTING ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:44:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:44:04 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623239044.23.0.892030358594.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Even valgrind sees the problem: ? valgrind ./python -m test test_lib2to3 ==27010== Memcheck, a memory error detector ==27010== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==27010== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info ==27010== Command: ./python -m test test_lib2to3 ==27010== 0:00:00 load avg: 1.53 Run tests sequentially 0:00:00 load avg: 1.53 [1/1] test_lib2to3 ==27010== Invalid read of size 8 ==27010== at 0x2363E1: _PyEval_EvalFrameDefault (ceval.c:3549) ==27010== by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46) ==27010== by 0x23B270: _PyEval_Vector (ceval.c:5174) ==27010== by 0x172498: _PyFunction_Vectorcall (call.c:342) ==27010== by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114) ==27010== by 0x22C88F: PyObject_Vectorcall (abstract.h:123) ==27010== by 0x22C88F: call_function (ceval.c:6001) ==27010== by 0x239642: _PyEval_EvalFrameDefault (ceval.c:4200) ==27010== by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46) ==27010== by 0x23B270: _PyEval_Vector (ceval.c:5174) ==27010== by 0x172498: _PyFunction_Vectorcall (call.c:342) ==27010== by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114) ==27010== by 0x22C88F: PyObject_Vectorcall (abstract.h:123) ==27010== by 0x22C88F: call_function (ceval.c:6001) ==27010== by 0x239642: _PyEval_EvalFrameDefault (ceval.c:4200) ==27010== by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46) ==27010== by 0x23B270: _PyEval_Vector (ceval.c:5174) ==27010== Address 0x62c5e28 is 8 bytes after a block of size 160 alloc'd ==27010== at 0x483E7C5: malloc (vg_replace_malloc.c:380) ==27010== by 0x1B2911: _PyMem_RawMalloc (obmalloc.c:99) ==27010== by 0x1B4702: PyObject_Malloc (obmalloc.c:697) ==27010== by 0x1A1EF9: clone_combined_dict_keys (dictobject.c:678) ==27010== by 0x1A2216: dict_merge (dictobject.c:2453) ==27010== by 0x1A2A59: PyDict_Merge (dictobject.c:2603) ==27010== by 0x1A2AF1: dict_update_arg (dictobject.c:2273) ==27010== by 0x1A2D4E: dict_update_common (dictobject.c:2298) ==27010== by 0x1A2DD1: dict_update (dictobject.c:2316) ==27010== by 0x33FCBA: method_vectorcall_VARARGS_KEYWORDS (descrobject.c:346) ==27010== by 0x2278AF: _PyObject_VectorcallTstate (abstract.h:114) ==27010== by 0x22C88F: PyObject_Vectorcall (abstract.h:123) ==27010== by 0x22C88F: call_function (ceval.c:6001) ==27010== ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 07:45:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 11:45:08 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623239108.38.0.692298099541.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm closing this as 3 different tools complain about the same thing, with a very simple reproducer. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 08:01:03 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 12:01:03 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623240063.62.0.164508047948.issue44357@roundup.psfhosted.org> Ajith Ramachandran added the comment: Yes I was aware of x**(1/3) and used that. I just thought it would be useful if it was present in math module as it is also used in many situations like `sqrt()`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 08:02:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 12:02:18 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623240138.33.0.994566540826.issue44363@roundup.psfhosted.org> Mark Shannon added the comment: If I run the following on main ./configure --with-address-sanitizer make clean make -j12 test I get 22 failures. So something is broken. test_lib2to3 does fork; at least it does when I run it under gdb. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 08:28:08 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 12:28:08 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623241688.62.0.0589655577595.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: > Perhaps because it is so easy to write x**(1/3), and if you want a real root of negative argument, it is -(-x)**(1/3). I consider `x**(1/3)` to be a trap and a bug magnet: many people won't realise that the correct spelling for their situation is actually `def f(x): return -((-x)**(1/3)) if x < 0 else x**(1/3)` and the failure mode of `x**(1/3)` for negative `x` seems suboptimal, in that it happily returns a complex number rather than raising a `ValueError` with a clear message indicating what was wrong. I've seen a good number of Stack Overflow questions from users confused about this exact thing. And not only is that correct spelling unwieldy, but it _still_ doesn't do the right thing for `-0.0`, and if you care about getting that corner case right then the right spelling becomes even more unwieldy. Of course, even with `math.cbrt` in the standard library people will still fall into the `x**(1/3)` trap, but at least we then have a decent replacement to point them to. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 08:29:21 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 12:29:21 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623241761.9.0.40254684061.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: There's also a decent chance that a libm implementation of cbrt will be correctly rounded, while `x**(1/3)` is highly unlikely to be so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 09:15:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 13:15:17 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623244517.72.0.628514061615.issue44360@roundup.psfhosted.org> STINNER Victor added the comment: > I don't think that's a segfault. That seems that the process was killed no? Also, the buildbot is green so this is not happening in the latest builds * (1) 0:01:12, test_compile child process was killed by signal -9 * (2) 0:08:48, test_multiprocessing_forkserver child process was killed by signal -9 * (3) 0:27:56, test_compile main process was killed (unknown signal... I bet on signal -9, SIGSEGV) Maybe it was a manual action, but it sounds like a strange coincidence that 3 processes were killed in the same build, and it wasn't at the same time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 09:29:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 13:29:00 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1623245340.75.0.465905770018.issue44206@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 09:50:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 13:50:49 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623246649.68.0.456240669049.issue44357@roundup.psfhosted.org> STINNER Victor added the comment: I didn't know the "cbrt" function name. It seems like it exists in the libc, but also in numpy. So it's a good idea to reuse this name ;-) numpy.cbrt(): Return the cube-root of an array, element-wise. https://numpy.org/doc/stable/reference/generated/numpy.cbrt.html ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 09:57:58 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 13:57:58 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623247078.94.0.521239102078.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: @Victor: Yep, the name is pretty standard. Not just C, but JavaScript, Java, R, and likely a lot of other languages that I haven't checked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:16:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 14:16:35 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1623248195.89.0.584074064622.issue44187@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25209 pull_request: https://github.com/python/cpython/pull/26624 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:23:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 14:23:38 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623248618.56.0.116118815403.issue44360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: But SIGSEGV is signal 11, not -9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:28:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 14:28:26 +0000 Subject: [issue44363] Likely false positive for address sanitizer after fork In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623248906.72.0.88776310337.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As I mentioned in https://bugs.python.org/issue43693, the way to run it is the following: $ export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0 $ ./configure --with-address-sanitizer --without-pymalloc $ make -j -s $ ./python -m test test_lib2to3 There are known failures with things like ctypes and libcript so the following tests are ignored: test_ctypes test_capi test_crypt test_decimal test_faulthandler test_interpreters ----------------- test_lib2to3 does one fork for this call: https://github.com/python/cpython/blob/main/Lib/lib2to3/tests/test_parser.py#L64 but that doesn't matter. Comment that and keeps falining ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:39:01 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 09 Jun 2021 14:39:01 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623249541.73.0.495992648162.issue44345@roundup.psfhosted.org> Lysandros Nikolaou added the comment: New changeset aef1b58dc8889e1bebaddf1e30f67b63a1b20f90 by Akira Nonaka in branch 'main': bpo-44345: Fix 'generated by' comment in parser.c (GH-26615) https://github.com/python/cpython/commit/aef1b58dc8889e1bebaddf1e30f67b63a1b20f90 ---------- nosy: +lys.nikolaou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:39:50 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Wed, 09 Jun 2021 14:39:50 +0000 Subject: [issue44345] The first line (comment) of the parser.c is incorrect. In-Reply-To: <1623128010.09.0.450986539958.issue44345@roundup.psfhosted.org> Message-ID: <1623249590.13.0.91842469717.issue44345@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:42:39 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Jun 2021 14:42:39 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623249759.14.0.992010773914.issue44360@roundup.psfhosted.org> Erlend E. Aasland added the comment: Isn't this just an (explicit) SIGKILL? The _exit code_ seems to be -9, not the signal number. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:58:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 14:58:12 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623250692.32.0.809089975729.issue44360@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 10:59:49 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 14:59:49 +0000 Subject: [issue44361] test_smtpnet failed with SMTPServerDisconnected on x86 Gentoo Non-Debug with X 3.10 In-Reply-To: <1623226350.91.0.267462887988.issue44361@roundup.psfhosted.org> Message-ID: <1623250789.24.0.662453006835.issue44361@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:11:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 15:11:29 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623251489.92.0.918906113301.issue44363@roundup.psfhosted.org> Mark Shannon added the comment: I still get quite a few failures on the main branch. It seems like ceval.c:1600 upsets the sanitizer, at least for gcc. There isn't anything wrong with that line, but as I plan to change it anyway I guess it doesn't matter: https://github.com/python/cpython/pull/26595 I plan to get the main branch passing the tests with address sanitization (at least on my machine with my gcc :) Running the tests doesn't seem to take that long (at least not compared with refleak tests). Do you think it would be it feasible to run the address sanitizer on all PRs, so that we can keep it passing? ---------- title: Likely false positive for address sanitizer after fork -> Address sanitizer (gcc version) is generating false positives _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:14:51 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 15:14:51 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` Message-ID: <1623251691.77.0.68992058324.issue44364@roundup.psfhosted.org> Change by Ajith Ramachandran : ---------- components: Tests nosy: AjithRamachandran priority: normal severity: normal status: open title: Add non integral tests for `sqrt()` type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:31:44 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Wed, 09 Jun 2021 15:31:44 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` Message-ID: <1623252704.37.0.553421108193.issue44364@roundup.psfhosted.org> Change by Ajith Ramachandran : ---------- keywords: +patch pull_requests: +25210 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26625 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:33:08 2021 From: report at bugs.python.org (Micael Jarniac) Date: Wed, 09 Jun 2021 15:33:08 +0000 Subject: [issue44365] Bad dataclass post-init example Message-ID: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> New submission from Micael Jarniac : https://docs.python.org/3/library/dataclasses.html#post-init-processing https://github.com/python/cpython/blob/3.9/Doc/library/dataclasses.rst#post-init-processing In the example, a base class "Rectangle" is defined, and then a "Square" class inherits from it. On reading the example, it seems like the Square class is meant to be used like: >>> square = Square(5) Since the Square class seems to be supposed to be a "shortcut" to creating a Rectangle with equal sides. However, the Rectangle class has two required init arguments, and when Square inherits from it, those arguments are still required, so using Square like in the above example, with a single argument, results in an error: >>> square = Square(5) Traceback (most recent call last): File "", line 1, in TypeError: __init__() missing 2 required positional arguments: 'width' and 'side' To "properly" use the Square class, it'd need to be instantiated like so: >>> square = Square(0, 0, 5) >>> square Square(height=5, width=5, side=5) Which, in my opinion, is completely counter-intuitive, and basically invalidates this example. ---------- assignee: docs at python components: Documentation messages: 395427 nosy: MicaelJarniac, docs at python priority: normal severity: normal status: open title: Bad dataclass post-init example type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:35:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 15:35:27 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623252927.41.0.625432360195.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Do you think it would be it feasible to run the address sanitizer on all PRs, so that we can keep it passing? That's a good idea,let me see how easy doing that would be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:37:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 15:37:47 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623253067.98.0.858946834864.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > It seems like ceval.c:1600 upsets the sanitizer, at least for gcc. Even if you don't trust the sanitizer, you can also use valgrind, it shows the same error: ? valgrind ./python -m test test_lib2to3 ==27010== Memcheck, a memory error detector ==27010== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==27010== Using Valgrind-3.17.0 and LibVEX; rerun with -h for copyright info ==27010== Command: ./python -m test test_lib2to3 ==27010== 0:00:00 load avg: 1.53 Run tests sequentially 0:00:00 load avg: 1.53 [1/1] test_lib2to3 ==27010== Invalid read of size 8 ==27010== at 0x2363E1: _PyEval_EvalFrameDefault (ceval.c:3549) ==27010== by 0x23B270: _PyEval_EvalFrame (pycore_ceval.h:46) For running valgrind, make sure do disable pymalloc: export PYTHONMALLOC=malloc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:44:02 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 09 Jun 2021 15:44:02 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623253442.96.0.324519463731.issue44365@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:49:31 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 15:49:31 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623253771.07.0.973073085503.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: If we *really* wanted to bikeshed on the name, back in 1991 Kahan wrote: > Perhaps the last problem is the hardest: choosing the program's name. Ideally it should need no explanation, but a limitation upon its length may preclude that. Although "CBRT" has seen use, I prefer "QBRT" in order that the prefix "C" may be reserved for use with complex-valued functions. Source: https://csclub.uwaterloo.ca/~pbarfuss/qbrt.pdf But that was 30 years ago, and I think the "CBRT"-shaped ship has long since sailed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 11:51:52 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 09 Jun 2021 15:51:52 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` Message-ID: <1623253912.35.0.169758970715.issue44364@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:04:04 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 09 Jun 2021 16:04:04 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623254644.05.0.590942056772.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: New changeset eea8148b7dff5ffc7b84433859ac819b1d92a74d by Ethan Furman in branch 'main': bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586) https://github.com/python/cpython/commit/eea8148b7dff5ffc7b84433859ac819b1d92a74d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:37:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 16:37:38 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623256658.67.0.57664199315.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is not a false positive. I break into gdb at the moment the sanitizer makes the report and inspecting the values that apparently are wrong. I did that by breaking into __sanitizer::ColorizeReports which is called for making the report. THis is what I did: $export CFLAGS='-g3 -O0' $export ASAN_OPTIONS=detect_leaks=0:allocator_may_return_null=1:handle_segv=0 $./configure --with-address-sanitizer --without-pymalloc $make -j -s $gdb --args ./python -m test test_lib2to3 -v -m test_prefix_preservation [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". == CPython 3.11.0a0 (heads/specialize-load-attr-dirty:e858ea1571, Jun 9 2021, 17:34:14) [GCC 11.1.0] [Detaching after vfork from child process 18105] == Linux-5.12.9-arch1-1-x86_64-with-glibc2.33 little-endian == cwd: /home/pablogsal/github/python/master/build/test_python_18103? == CPU count: 36 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 1.64 Run tests sequentially 0:00:00 load avg: 1.64 [1/1] test_lib2to3 test_prefix_preservation (lib2to3.tests.test_fixers.Test_dict) ... ok test_prefix_preservation (lib2to3.tests.test_fixers.Test_except) ... ================================================================= Breakpoint 1, __sanitizer::ColorizeReports () at /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp:62 62 /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp: No such file or directory. (gdb) up #1 0x00007ffff75f6af1 in __sanitizer::SanitizerCommonDecorator::SanitizerCommonDecorator (this=) at /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h:26 26 /build/gcc/src/gcc/libsanitizer/sanitizer_common/sanitizer_report_decorator.h: No such file or directory. (gdb) #2 __asan::Decorator::Decorator (this=) at /build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h:45 45 /build/gcc/src/gcc/libsanitizer/asan/asan_descriptions.h: No such file or directory. (gdb) #3 __asan::ErrorGeneric::Print (this=this at entry=0x7ffff7710908 <__asan::ScopedInErrorReport::current_error_+8>) at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp:574 574 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.cpp: No such file or directory. (gdb) #4 0x00007ffff768531e in __asan::ErrorDescription::Print ( this=this at entry=0x7ffff7710900 <__asan::ScopedInErrorReport::current_error_>) at /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h:440 440 /build/gcc/src/gcc/libsanitizer/asan/asan_errors.h: No such file or directory. (gdb) #5 0x00007ffff7685528 in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7ffffffd12e6, __in_chrg=) at /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:141 141 /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp: No such file or directory. (gdb) #6 0x00007ffff7684d8d in __asan::ReportGenericError (pc=93824995352503, bp=bp at entry=140737488166752, sp=sp at entry=140737488166736, addr=106515189666344, is_write=is_write at entry=false, access_size=access_size at entry=8, exp=0, fatal=true) at /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp:478 478 in /build/gcc/src/gcc/libsanitizer/asan/asan_report.cpp (gdb) #7 0x00007ffff7685c1c in __asan::__asan_report_load8 (addr=) at /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp:121 121 /build/gcc/src/gcc/libsanitizer/asan/asan_rtl.cpp: No such file or directory. (gdb) #8 0x000055555584dfb7 in _PyEval_EvalFrameDefault (tstate=0x612000000040, f=0x6080000b08b0, throwflag=0) at Python/ceval.c:3549 3549 DEOPT_IF(ep->me_key != name, LOAD_ATTR); (gdb) p ep->me_key $3 = (PyObject *) 0x60e0000b1250 (gdb) p ep->me_key->ob_refcnt $4 = 652835033347 That ep->me_key is obviously corrupted. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:42:03 2021 From: report at bugs.python.org (Jordan Ephron) Date: Wed, 09 Jun 2021 16:42:03 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623219620.33.0.642463475167.issue44356@roundup.psfhosted.org> Message-ID: <3BEE02B6-3896-4456-8C26-9B0D64C47C8B@jephron.com> Jordan Ephron added the comment: > But what is an `UnexpectedString()` Sorry, that?s maybe less relevant to the example. It?s just a subclass of string with some marker to make it detectable later on, similar to schemes that taint user input to prevent sql injection or whatever > On Jun 8, 2021, at 23:20, Ethan Furman wrote: > > ? > Ethan Furman added the comment: > > Excellent bug report. > > But what is an `UnexpectedString()` ? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:49:16 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 16:49:16 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623257356.82.0.0164987088628.issue44363@roundup.psfhosted.org> Mark Shannon added the comment: What commit are you running that on? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:53:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 16:53:40 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623257620.75.0.943390383765.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: commit e858ea15718709bc8ec3c13bd8451ff7d62cbe80 (HEAD -> specialize-load-attr) Author: Mark Shannon Date: Wed Jun 9 09:33:13 2021 +0100 Assert that address is in bounds (ASAN thinks it might not be). diff --git a/Python/ceval.c b/Python/ceval.c index 06a02b40f9..784d0244e8 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3517,6 +3517,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) DEOPT_IF(!PyModule_CheckExact(owner), LOAD_ATTR); PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict; DEOPT_IF(dict->ma_keys->dk_version != cache1->dk_version_or_hint, LOAD_ATTR); + assert(cache0->index < dict->ma_keys->dk_nentries); PyDictKeyEntry *ep = DK_ENTRIES(dict->ma_keys) + cache0->index; res = ep->me_value; DEOPT_IF(res == NULL, LOAD_ATTR); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:54:16 2021 From: report at bugs.python.org (=?utf-8?q?Bo=C5=A1tjan_Mejak?=) Date: Wed, 09 Jun 2021 16:54:16 +0000 Subject: [issue44366] Define functions without parentheses (if no parameters given) Message-ID: <1623257656.83.0.503591632705.issue44366@roundup.psfhosted.org> New submission from Bo?tjan Mejak : The syntax to define a class looks like this: class MyClass: pass Nice and neat. *** And the syntax to define a function looks like this: def my_function(): pass Hmmm... *** What if we could define functions (that don't have any parameters) like this: def my_function: pass *** Is that a possible scenario at this point, or even desirable? ---------- components: Interpreter Core messages: 395436 nosy: PedanticHacker priority: normal severity: normal status: open title: Define functions without parentheses (if no parameters given) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:54:52 2021 From: report at bugs.python.org (Bhavna Sewani) Date: Wed, 09 Jun 2021 16:54:52 +0000 Subject: [issue44367] Python Code for WebView2 Exe Testing Message-ID: <1623257692.76.0.177889854171.issue44367@roundup.psfhosted.org> New submission from Bhavna Sewani : I have an application developed using webview2. It is a web application that would be driven by Microsoft Edge(Chromium). It would give a feel of Native/Desktop app instead of web app to the end user. I want to automate testing for this app using Python/Robot framework. I found an documentation which uses Dotnet, Selenium and Edge drivers for testing it. https://docs.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver Can someone help how can we write below code in Python and Robot to test the same using Selenium Library: static void Main(string[] args) { EdgeOptions edgeOptions = new EdgeOptions(false, "webview2"); edgeOptions.BinaryLocation = @"C:\path\to\your\webview2\project.exe"; string msedgedriverDir = @"C:\path\to\your\msededriver.exe's\directory"; string msedgedriverExe = @"msedgedriver.exe"; EdgeDriverService service = EdgeDriverService.CreateDefaultService(msedgedriverDir, msedgedriverExe, false); EdgeDriver e = new EdgeDriver(service, edgeOptions); e.Url = @"https://www.microsoft.com"; //myexe or webpage path e.Quit(); } ---------- components: Library (Lib) messages: 395437 nosy: bhavna.sewani, gvanrossum, ncoghlan priority: normal severity: normal status: open title: Python Code for WebView2 Exe Testing versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 12:57:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 16:57:38 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). In-Reply-To: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> Message-ID: <1623257858.51.0.591017972679.issue44358@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:07:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Jun 2021 17:07:07 +0000 Subject: [issue44366] Define functions without parentheses (if no parameters given) In-Reply-To: <1623257656.83.0.503591632705.issue44366@roundup.psfhosted.org> Message-ID: <1623258427.81.0.244760382164.issue44366@roundup.psfhosted.org> Irit Katriel added the comment: The python-ideas mailing list is a better place for such questions than the bug tracker. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:07:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 17:07:25 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623258445.26.0.10489314289.issue44283@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:13:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 17:13:32 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623258812.13.0.711576385667.issue44363@roundup.psfhosted.org> Mark Shannon added the comment: This line seems to be responsible for most of the failures: https://github.com/python/cpython/blob/main/Objects/frameobject.c#L985 Which does appear to be a true positive. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:15:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 17:15:18 +0000 Subject: [issue44366] Define functions without parentheses (if no parameters given) In-Reply-To: <1623257656.83.0.503591632705.issue44366@roundup.psfhosted.org> Message-ID: <1623258918.28.0.596667709189.issue44366@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Closing as this would obviously need a PEP, please open a discusion first on python-ideas ---------- nosy: +pablogsal resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:17:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 17:17:09 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623259029.06.0.19582382311.issue44360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am quite sure this is not a segmentation fault, Victor. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:18:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 17:18:19 +0000 Subject: [issue44360] test_compile segfault on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623259099.63.0.684143689231.issue44360@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We'll wait for more builds, but for now the buildbot is green so I think this should be closed and reopened if we see it again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:18:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 17:18:48 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1623259128.83.0.147849310682.issue44187@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is anything left in this issue? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:21:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 09 Jun 2021 17:21:18 +0000 Subject: [issue44187] Implement infrastructure for quickening and specializing In-Reply-To: <1621509319.67.0.0822328288042.issue44187@roundup.psfhosted.org> Message-ID: <1623259278.31.0.602475074028.issue44187@roundup.psfhosted.org> Mark Shannon added the comment: No, this is done ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:21:42 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 17:21:42 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623259302.97.0.834919189743.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- pull_requests: +25212 pull_request: https://github.com/python/cpython/pull/26626 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:25:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Jun 2021 17:25:42 +0000 Subject: [issue44367] Python Code for WebView2 Exe Testing In-Reply-To: <1623257692.76.0.177889854171.issue44367@roundup.psfhosted.org> Message-ID: <1623259542.56.0.847113345671.issue44367@roundup.psfhosted.org> Guido van Rossum added the comment: Sorry, this tracker is not for getting help, only for submitting changes to Python itself. Try https://discuss.python.org/c/users/7 instead. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:27:13 2021 From: report at bugs.python.org (Jordan Ephron) Date: Wed, 09 Jun 2021 17:27:13 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623259633.33.0.22947844739.issue44356@roundup.psfhosted.org> Jordan Ephron added the comment: Oh, on further investigation I see that the example wouldn't have worked on 3.8 anyway, due to issue34536 adding some checks to the type returned by _missing_, so maybe I'm pushing Enum too far in that case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:29:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 17:29:36 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623259776.97.0.15599670311.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: >From the gdb session looks to me that you are reading freed or invalid memory from the dictionary keys. Well, I'm quite sure you are doing that, but I don't know why they is happening. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:41:03 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 17:41:03 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623260463.89.0.399529690864.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset e6e34e45222b9c7a63ba92386612acf768082ba0 by Eric Snow in branch 'main': bpo-43693: Do not check co_cell2arg if a non-cell offset. (gh-26626) https://github.com/python/cpython/commit/e6e34e45222b9c7a63ba92386612acf768082ba0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 13:42:49 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 09 Jun 2021 17:42:49 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623260569.95.0.366793319625.issue44365@roundup.psfhosted.org> Eric V. Smith added the comment: Agreed that that's not a good (or even workable) example. Thanks for pointing it out. I'll come up with something better. ---------- assignee: docs at python -> eric.smith versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 14:06:59 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 09 Jun 2021 18:06:59 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623262019.68.0.572139361663.issue44348@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25213 pull_request: https://github.com/python/cpython/pull/26627 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 14:07:33 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 09 Jun 2021 18:07:33 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623262053.58.0.749923557789.issue44348@roundup.psfhosted.org> Ken Jin added the comment: @Steve thanks for the info, > This is already what we do, so if someone has increased stack usage, they should also decrease the value here. I see the recursion limit set in _PyEval_InitState but I don't see any special settings for windows. Is it somewhere else or am I missing something here :( ? BTW, I'm thinking about changing the CI checks for windows to test on debug builds. I find it strange that the macOS and ubuntu CIs test on debug builds while windows seemingly doesn't[1]. If we change it, similar errors may be caught earlier at the PR stage rather than when it's committed and causes the buildbots to fail. What do you think? [1] https://github.com/python/cpython/blob/main/.github/workflows/build.yml#L95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 14:07:33 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 18:07:33 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623262053.52.0.846709331281.issue44363@roundup.psfhosted.org> Eric Snow added the comment: This was my bad. I only partially fixed original problem when un-reverting 3fa63e in gh-26609. I've merged the rest of the fix in gh-26626. Sorry about that. ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 14:22:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Jun 2021 18:22:53 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623262973.13.0.844901401247.issue44347@roundup.psfhosted.org> Irit Katriel added the comment: >From the code, this arg is simply passed to os.mkdirs() here: https://github.com/python/cpython/blob/e6e34e45222b9c7a63ba92386612acf768082ba0/Lib/shutil.py#L450 os.mkdir is documented here: https://docs.python.org/3/library/os.html#os.makedirs and says just "If exist_ok is False (the default), an FileExistsError is raised if the target directory already exists." So I agree that the sentence you highlighted can be improved. Would you like to submit a patch? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 14:23:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 09 Jun 2021 18:23:19 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623262999.31.0.481091917572.issue44347@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 15:47:35 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 19:47:35 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors Message-ID: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> New submission from Brandt Bucher : Here are a few that I found. Not sure when they were introduced: match ...: case {**rest, "key": value}: pass match ...: case {"first": first, **rest, "last": last}: pass match ...: case {**_}: pass These all give the following error while parsing the second line: File "", line 1 match ...: ^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? ---------- components: Parser messages: 395453 nosy: brandtbucher, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Invalid mapping patterns give confusing SyntaxErrors type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 15:48:43 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 19:48:43 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623268123.96.0.933866990552.issue44368@roundup.psfhosted.org> Brandt Bucher added the comment: Perhaps we need something like invalid_mapping_pattern or invalid_mapping_pattern_double_star rules? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:02:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 20:02:24 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623268944.3.0.886844872998.issue44360@roundup.psfhosted.org> STINNER Victor added the comment: Oh right, exit code -9 means killed by SIGKILL, it doesn't not mean killed SIGSEGV. Sorry about the confusion. How can a signal be killed by SIGKILL? Can it be related to Linux OOM Killer? Senthil: Would you mind to have a look at the server logs to see if you see anything suspicious? ---------- nosy: +orsenthil title: test_compile segfault on AMD64 Ubuntu 3.x -> test_compile killed by SIGKILL on AMD64 Ubuntu 3.x _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:05:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 09 Jun 2021 20:05:36 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623269136.64.0.91406615876.issue44360@roundup.psfhosted.org> Erlend E. Aasland added the comment: Oh, right, there is of course a connection between the exit code and the signal number. Thanks for the reminder :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:06:48 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 09 Jun 2021 20:06:48 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x In-Reply-To: <1623268944.3.0.886844872998.issue44360@roundup.psfhosted.org> Message-ID: Senthil Kumaran added the comment: Yes, this was related to the Linux OOM Killer. The agent went down shortly after this. Either multiple parallel jobs might have led to OOM or something else. I will see if logs provide more information. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:17:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:17:31 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623269851.93.0.219696120286.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Probably, otherwise is going to hurt because the syntax errors that you describe trigger when two names are place together, which in general is a missing comma. The error message also doesn't say: "you are missing a comma" it says that the most typical reason is a missing comma, which is important to distinguish :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:18:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 20:18:16 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623269896.43.0.200928147057.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25214 pull_request: https://github.com/python/cpython/pull/26628 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:18:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 09 Jun 2021 20:18:20 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623269900.23.0.550486710825.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 275d5f7957dbb56a6d5e1248addff210ee2e7270 by Terry Jan Reedy in branch 'main': bpo-40468: Split IDLE settings General tab (GH-26621) https://github.com/python/cpython/commit/275d5f7957dbb56a6d5e1248addff210ee2e7270 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:18:21 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 20:18:21 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623269901.79.0.321059029161.issue40468@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25215 pull_request: https://github.com/python/cpython/pull/26629 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:18:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:18:37 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623269917.69.0.23803918306.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The backtracking with the soft keyword may make this very annoying, by the way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:20:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:20:04 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623270004.55.0.07439902586.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, wait, I think I misunderstood the problem. The problem is that the parser is backtracking and identifying match as a name. Indeed, the soft keyword is a pain :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:22:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:22:25 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623270145.86.0.539165517052.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think it actually will be very useful to explain that these cases are invalid in the Syntax error, which will also solve this problem. This on the other hand shows a bigger problem: any generic syntax error that happens inside "match" will probably end identifying the keyword as a name, even if we don't have specific errors, the parser will point to it and complain about "match". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:27:23 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Wed, 09 Jun 2021 20:27:23 +0000 Subject: [issue44221] ImportError: sys.meta_path is None, Python is likely shutting down In-Reply-To: <1621815537.06.0.915921602571.issue44221@roundup.psfhosted.org> Message-ID: <1623270443.82.0.460307423079.issue44221@roundup.psfhosted.org> Emmanuel Arias added the comment: Hello, Can you please provide a piece of code to reproduce the issue? ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:36:43 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 20:36:43 +0000 Subject: [issue42088] types.SimpleNamespace.__repr__ documentation inconsistency In-Reply-To: <1603139694.62.0.339590504513.issue42088@roundup.psfhosted.org> Message-ID: <1623271003.83.0.80673989047.issue42088@roundup.psfhosted.org> Eric Snow added the comment: I'm not sure what to think about this. The type is explicitly exposed to Python code "SimpleNamespace" via the types module. However, that's the same as how other builtin types are exposed in that module. For example, the builtin `PyCode_Type` (for `PyCodeObject`) is exposed as `types.CodeType`. I called it "SimpleNamespace" because "Namespace" (or "NamespaceType") was a little too unclear and I wanted it to say what it was. In retrospect, "SimpleNamespace" was probably a good choice. FYI, `tp_name` was originally set to "namespace", rather than "types.SimpleNamespace". I changed it to "types.SimpleNamespace" to add pickle support (in b5c8f927829a1679c6748df84a6289fb68343e51, for bpo-15022). IIRC, changing the name was the easiest was to allow pickle to find it. That said, it would be better to do it properly and set `tp_name` to the correct value. It would probably help to have a little more context on the name and my intentions. When I added it (for use in the PEP 421 implementation), I thought of the type as one that others would find very useful. So I imagined we would eventually expose it as one of the builtins. Basically all the other builtin types have lowercase names, hence I named it "namespace". I just didn't get around to proposing adding it to the builtins and it fell off my radar. Note that changing the name to "types.SimpleNamespace", while primarly to benefit pickling, also made the type more discoverable, which becomes less relevant if it is a builtin. FWIW, I still think it is a good candidate for the builtins, though I'd probably name it "simplenamespace" at this point. Cementing the name as "types.SimpleNamespace" would probably be a disappointment for me. Instead it would be better to fix the pickle support, so tp_name could go back to the correct name, and make it a builtin. This isn't a priority for me, though, and I don't have a huge sense of ownership here, so I don't feel like I am in much of a position to champion my preferences on this. (I'd be glad to mentor someone on this though.) Thus I'm not sure what to think about this. :) ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:38:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 20:38:04 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623271084.97.0.147938089729.issue40468@roundup.psfhosted.org> miss-islington added the comment: New changeset 664ae29e6f61988e74cb8753dd4ee71e9ea57227 by Miss Islington (bot) in branch '3.10': bpo-40468: Split IDLE settings General tab (GH-26621) https://github.com/python/cpython/commit/664ae29e6f61988e74cb8753dd4ee71e9ea57227 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:41:35 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 20:41:35 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623271295.1.0.214358869772.issue40468@roundup.psfhosted.org> miss-islington added the comment: New changeset d9f38d77c870cdb04273914c92fa4fe92b830d88 by Miss Islington (bot) in branch '3.9': bpo-40468: Split IDLE settings General tab (GH-26621) https://github.com/python/cpython/commit/d9f38d77c870cdb04273914c92fa4fe92b830d88 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:42:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:42:26 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623271346.4.0.567424872551.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, turns out I already added machinery to solved this but I was missing a piece! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:42:43 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 20:42:43 +0000 Subject: [issue42088] types.SimpleNamespace.__repr__ documentation inconsistency In-Reply-To: <1603139694.62.0.339590504513.issue42088@roundup.psfhosted.org> Message-ID: <1623271363.02.0.424135161394.issue42088@roundup.psfhosted.org> Eric Snow added the comment: > According to the documentation for types.SimpleNamespace, `repr(SimpleNamespace())` > should return `"SimpleNamespace()"`, but in actuality returns `"namespace()"`. Note that I purposefully wrote "roughly" in the docs ("The type is roughly equivalent to the following code:"). That code was meant to illustrate the functionality rather than be proscriptive of the implementation. That said, it certainly would be good for the documentation to match. :) > but also the (perhaps less interesting issue) of `eval(repr(SimpleNamespace))` resulting in a NameError. This is true of many of the types exposed by the types module (e.g. types.CodeType). > I propose that `_PyNamespaceObject`'s __repr__ method be changed to return `"SimpleNamespace()"`. My preference would be as outlined in my previous comment: make it a builtin. However, I'm not in a position to make that happen at the moment. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 16:42:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 20:42:55 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623271375.3.0.796253797187.issue44368@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25216 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26630 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:05:37 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 21:05:37 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623272737.82.0.412964534762.issue44368@roundup.psfhosted.org> Brandt Bucher added the comment: Wow, that was quite a roller-coaster ride. Thanks Pablo. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:08:51 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 21:08:51 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623272931.36.0.275796132855.issue44368@roundup.psfhosted.org> Brandt Bucher added the comment: I found a similar one, by the way (not related to mapping patterns): match ...: case 42 as _: pass File "", line 2 case 42 as _: ^ SyntaxError: expected ':' Is this covered by your fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:09:21 2021 From: report at bugs.python.org (Ethan Smith) Date: Wed, 09 Jun 2021 21:09:21 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1623272961.73.0.758512477.issue24234@roundup.psfhosted.org> Ethan Smith added the comment: While I don't think it is nonsense, I do think it would be quite useful to add these. I just submitted PRs to typeshed and numpy adding complex to unions that already had SupportsComplex, because of the lack of __complex__. I'd be happy to work on a PR for this if it would be accepted. ---------- nosy: +ethan smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:10:36 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 21:10:36 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1623273036.54.0.629291219806.issue21760@roundup.psfhosted.org> miss-islington added the comment: New changeset 878d7e4ee464913438fd59582bbb795e7e0fa387 by Furkan Onder in branch 'main': bpo-21760: fix __file__ description (GH-19097) https://github.com/python/cpython/commit/878d7e4ee464913438fd59582bbb795e7e0fa387 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:12:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:12:16 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623273136.11.0.554430163588.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is this covered by your fix? No, that is not a backtracking error (is not going all the way to the "match" expression). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:13:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 09 Jun 2021 21:13:52 +0000 Subject: [issue24234] Should we define complex.__complex__ and bytes.__bytes__? In-Reply-To: <1431985055.48.0.760233282847.issue24234@psf.upfronthosting.co.za> Message-ID: <1623273232.54.0.822283930507.issue24234@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, the more I think about it, the more it looks like we should add the special methods -- even if they won't necessarily be called *if the type is exactly 'complex' or 'bytes'*. Now, until we've written and released the code we won't know for sure whether this might break somebody's corner case, so we should play it safe and only do this for 3.11 and make sure it's mentioned in the What's New. ---------- versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:15:49 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 09 Jun 2021 21:15:49 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1623273349.11.0.70946762519.issue21760@roundup.psfhosted.org> Eric Snow added the comment: I've merged the changes for __file__. Thanks, furkanonder! The fixes in the types module remain to be done, though now I see 4 of the relevant attributes instead of 2. (missing: __path__, __file__, __cached__) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:15:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:15:52 +0000 Subject: [issue44369] Improve syntax error for wrongly closed strings Message-ID: <1623273352.85.0.523852871256.issue44369@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Let's asume this string: " x = "Cannot recover from "MemoryErrors" while something happnes while " The line is incorrect because the quotes arround MemoryErrors are the same as the string is used, resulting in STRING + expression + STRING. Currenly we say: >>> 'Cannot recover from 'MemoryErrors' while ' File "", line 1 'Cannot recover from 'MemoryErrors' while ' ^ SyntaxError: invalid syntax but I think it will be a great improvement if we say: >>> 'Cannot recover from 'MemoryErrors' while ' File "", line 1 'Cannot recover from 'MemoryErrors' while ' ^^^^^^^^^^^^ SyntaxError: invalid syntax. Did you use the same quotes here as the string? Probably the message should be better, but I think this is a good improvement. ---------- components: Parser messages: 395476 nosy: lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Improve syntax error for wrongly closed strings versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:16:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:16:52 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623273412.38.0.483979269963.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will fix that one in another PR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:20:11 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 21:20:11 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623273611.58.0.0189625187597.issue44368@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25217 pull_request: https://github.com/python/cpython/pull/26631 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:20:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:20:11 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623273611.03.0.189267396744.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 457ce60fc70f1c9290023f46fb82b6a490dff32e by Pablo Galindo in branch 'main': bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft keywords (GH-26630) https://github.com/python/cpython/commit/457ce60fc70f1c9290023f46fb82b6a490dff32e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:24:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:24:52 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623273892.36.0.872827106809.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Oh, this one is actually correct: match ...: case 42 as _: pass File "", line 2 case 42 as _: ^ SyntaxError: expected ':' That is literally expecting a ":" and that's the error. It has identified "case 42" correctly and it now expects a ":". Is just that the error marker is wrong because it has reached the "as and _" as part of the parsing so the error is there. That is going to be a bit tricky to "fix" ---------- nosy: -miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:25:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 21:25:27 +0000 Subject: [issue44112] [buildbot] test_asyncio hangs (killed after 3 hours) on Refleak buildbots In-Reply-To: <1620812434.16.0.332094043399.issue44112@roundup.psfhosted.org> Message-ID: <1623273927.86.0.903531906555.issue44112@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/python/buildmaster-config/commit/9e0c812694d6fa599b4c8890045ed006fe7c1f6b aarch64 Fedora Rawhide Refleaks 3.8: https://buildbot.python.org/all/#/builders/401/builds/47 This change worked as expected: buildbot now uses a timeout of 4 hours (14400 seconds). At the first run, test_asyncio was blocked in test_close_kill_running() of test_asyncio/test_subprocess.py. From the traceback, it's not possible to be sure that the test uses MultiLoopChildWatcher. But it smells a lot like bpo-38323. bpo-38323 was recently fixed in 3.9, 3.10 and main branches (by skipping MultiLoopChildWatcher tets, since this class has a known race condition). Sadly, the 3.8 branch no longer accepts bugfixes. Logs: 0:00:00 load avg: 2.85 Run tests in parallel using 10 child processes (timeout: 3 hour 15 min, worker timeout: 3 hour 20 min) (...) 3:21:15 load avg: 0.04 [423/423/1] test_asyncio crashed (Exit code 1) beginning 6 repetitions 123456 .....Timeout (3:15:00)! Thread 0x0000ffffaecbcd50 (most recent call first): File "/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/selectors.py", line 468 in select File "/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py", line 1823 in _run_once File "/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py", line 570 in run_forever File "/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/asyncio/base_events.py", line 603 in run_until_complete File "/home/buildbot/buildarea/3.8.cstratak-fedora-rawhide-aarch64.refleak/build/Lib/test/test_asyncio/test_subprocess.py", line 484 in test_close_kill_running (...) test_ensure_future_task (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_error_in_call_soon (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_exception_traceback (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_gather_shield (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_get_coro (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_get_stack (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok test_iscoroutinefunction (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ok command timed out: 14400 seconds elapsed running [b'make', b'buildbottest', b'TESTOPTS=-R 3:3 -u-cpu -j10 ${BUILDBOT_TESTOPTS}', b'TESTPYTHONOPTS=', b'TESTTIMEOUT=11700'], attempting to kill .....make: *** [Makefile:1173: buildbottest] Terminated process killed by signal 15 program finished with exit code -1 elapsedTime=14400.032773 test_log_destroyed_pending_task (test.test_asyncio.test_tasks.PyTask_CFuture_Tests) ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:31:14 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 21:31:14 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623274274.23.0.279459670015.issue44368@roundup.psfhosted.org> Brandt Bucher added the comment: Could we just try parsing "as _" and raise if so? That wouldn't conflict with any existing rules, and that way we could actually have a helpful error message. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:32:12 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 09 Jun 2021 21:32:12 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623274332.41.0.843278950495.issue44368@roundup.psfhosted.org> Brandt Bucher added the comment: Like "SyntaxError: can't capture into a wildcard (consider removing)". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:32:48 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 09 Jun 2021 21:32:48 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer) In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623274368.89.0.265041989135.issue44360@roundup.psfhosted.org> STINNER Victor added the comment: > Yes, this was related to the Linux OOM Killer. Oh ok. Maybe you should give more memory to your worker, or you should spawn less jobs in parallel (-j1 instead of -j2). Or you should disable other services which eat memory. How much memory does it have? ---------- title: test_compile killed by SIGKILL on AMD64 Ubuntu 3.x -> test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:43:28 2021 From: report at bugs.python.org (Arjun) Date: Wed, 09 Jun 2021 21:43:28 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1623275008.24.0.423356637016.issue14322@roundup.psfhosted.org> Arjun added the comment: The only things I think we should add to the current hmac tests are test_update_error_handling and test_with_invalid_msg. For test_withnoncallable_digestmod(), hmac itself seems it can no longer be used: >>> hmac.HMAC(b"gggg", None, "hmac") using new Traceback (most recent call last): File "", line 1, in File "/Users/arjun/Python/Sources/cpython/Lib/hmac.py", line 61, in __init__ self._init_hmac(key, msg, digestmod) File "/Users/arjun/Python/Sources/cpython/Lib/hmac.py", line 69, in _init_hmac self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod) ValueError: unsupported hash type hmac For tests test_small_block_size and test_no_block_size, a custom .blocksize cannot be set (changing .block_size has no difference on digest()): >>> hmac.HMAC(b"gggg", None, "md5").blocksize = 15 using new Traceback (most recent call last): File "", line 1, in AttributeError: 'HMAC' object attribute 'blocksize' is read-only ``` class myHMAC(hmac.HMAC): blocksize = 1 def __init__(self, key, msg, digestmod_): super().__init__(key, msg, digestmod=digestmod_) h = myHMAC(b"key", b"", digestmod_="md5") h.digest() # <- works perfectly fine. ``` Does this sound okay? I can go ahead an implement it if so. ---------- nosy: +CCLDArjun -Vijay.Majagaonkar, christian.heimes, eric.araujo, gregory.p.smith, packetslave, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:45:56 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 09 Jun 2021 21:45:56 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623275156.77.0.42058333351.issue44368@roundup.psfhosted.org> miss-islington added the comment: New changeset f807a4fad4da8f629ea7fe1f00719e817c77b63c by Miss Islington (bot) in branch '3.10': bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft keywords (GH-26630) https://github.com/python/cpython/commit/f807a4fad4da8f629ea7fe1f00719e817c77b63c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:57:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:57:52 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623275872.9.0.838170299324.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Could we just try parsing "as _" and raise if so? That wouldn't conflict with any existing rules, and that way we could actually have a helpful error message. No, the same happens with other targets such as: File "/home/pablogsal/github/python/master/lel.py", line 2 case 42 as 1+1: ^ SyntaxError: expected ':' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:58:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:58:49 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623275929.21.0.089461878704.issue44368@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25218 pull_request: https://github.com/python/cpython/pull/26632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 17:59:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 21:59:14 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623275954.34.0.403005505342.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Checkout PR 26632, and see if this works for you ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 18:05:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 09 Jun 2021 22:05:13 +0000 Subject: [issue44369] Improve syntax error for wrongly closed strings In-Reply-To: <1623273352.85.0.523852871256.issue44369@roundup.psfhosted.org> Message-ID: <1623276313.75.0.383840007649.issue44369@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25219 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26633 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 18:20:06 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Wed, 09 Jun 2021 22:20:06 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer) In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623277206.38.0.393167438302.issue44360@roundup.psfhosted.org> Senthil Kumaran added the comment: > Maybe you should give more memory to your worker, or you should spawn less jobs in parallel It was related to high number of jobs in that particular agent and result in OOM Kill from the Linux kernel - https://pastebin.com/559H4ksa The machine has 1GB Ram, but I realize that it has only one 1 CPU (This seems not optimal, minimal of 2 CPU seems to be recommendation - https://devguide.python.org/buildworker/) I will change it to run few jobs in parallel, and disable some services which are not used) and we could see again. For this, I would rather side with an agent resource issue than a compiler issue. Sorry for that. --- I also notice number unsuccessful SSH attempts on the server (today) - https://pastebin.com/ab0EKDuF The agent got unreachable probably due this, and I did reboot of the agent from the cloud console, so that I could login and see what might have happened. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 18:33:17 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 09 Jun 2021 22:33:17 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623277997.81.0.638019010893.issue44347@roundup.psfhosted.org> Jack DeVries added the comment: I would like to submit a patch for this. This would be my first contribution :) I am starting on a patch now. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 18:38:05 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 09 Jun 2021 22:38:05 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623278285.25.0.243237591834.issue44328@roundup.psfhosted.org> Eryk Sun added the comment: You resolved bpo-41299 using QueryPerformanceCounter(), so we're already a step toward making it the default monotonic clock. Personally, I've only relied on QPC for short intervals, but, as you've highlighted above, other language runtimes use it for their monotonic clock. Since Vista, it's apparently more reliable in terms of calibration and ensuring that a processor TSC is only used if it's known to be invariant and constant. That said, Windows 10 also provides QueryInterruptTimePrecise(), which is a hybrid solution. It uses the performance counter to interpolate a timestamp between interrupts. I'd prefer to use this for time.monotonic() instead of QPC, if it's available via GetProcAddress(). QueryInterruptTimePrecise() is about 1.38 times the cost of QPC (on average across 100 million calls). Both functions are significantly more expensive than QueryInterruptTime() and GetTickCount64(), which simply return a value that's read from shared memory (i.e. the KUSER_SHARED_DATA structure). > QueryUnbiasedInterruptTime() is available on Windows 8 while > QueryInterruptTime() is new as of Windows 10. The "Unbiased" > just refers to whether it advances during sleep. QueryInterruptTime() and QueryUnbiasedInterruptTime() don't provide high-resolution timestamps. They're updated by the system timer interrupt service routine, which defaults to 64 interrupts/second. The time increment depends on when the counter is read by the ISR, but it averages out to approximately the interrupt period (e.g. 15.625 ms). > I'm not actually sure whether time.monotonic() in Python counts > time spent asleep, or whether that's desirable. POSIX doesn't specify whether CLOCK_MONOTONIC [1] should include the time that elapses while the system is in standby mode. In Linux, CLOCK_BOOTTIME includes this time, and CLOCK_MONOTONIC excludes it. Windows QueryUnbiasedInterruptTime[Precise]() excludes it. > Perhaps the long term answer would be to introduce separate > "asleep" and "awake" monotonic clocks in Python Both may not be supportable on all platforms, but they're supported in Linux, Windows 10, and macOS. The latter has mach_continuous_time(), which includes the time in standby mode, and mach_absolute_time(), which excludes it. --- [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:02:14 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 09 Jun 2021 23:02:14 +0000 Subject: [issue44369] Improve syntax error for wrongly closed strings In-Reply-To: <1623273352.85.0.523852871256.issue44369@roundup.psfhosted.org> Message-ID: <1623279734.15.0.318343622591.issue44369@roundup.psfhosted.org> Andre Roberge added the comment: I like this. While it would be a bit longer, I'm wondering if the message should not read instead as follows: ... Did you use the same quotes here as those enclosing the string? === I suspect that errors coming from the use of a single quote, as in: 'Don't do this' might be just as prevalent if not more so; however, they might be more difficult to properly diagnose. ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:12:50 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 23:12:50 +0000 Subject: [issue35800] remove smtpd.MailmanProxy In-Reply-To: <1548091630.84.0.140233087609.issue35800@roundup.psfhosted.org> Message-ID: <1623280370.56.0.139906747453.issue35800@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 309ab616020f8504ced8ca64f7d7abc2df25a37f by Dong-hee Na in branch 'main': bpo-35800: Remove smtpd.MailmanProxy since 3.11 (GH-26617) https://github.com/python/cpython/commit/309ab616020f8504ced8ca64f7d7abc2df25a37f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:13:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 23:13:14 +0000 Subject: [issue35800] remove smtpd.MailmanProxy In-Reply-To: <1548091630.84.0.140233087609.issue35800@roundup.psfhosted.org> Message-ID: <1623280394.81.0.458563968772.issue35800@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:13:59 2021 From: report at bugs.python.org (Ryan Hileman) Date: Wed, 09 Jun 2021 23:13:59 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623280439.95.0.402122813697.issue44328@roundup.psfhosted.org> Ryan Hileman added the comment: Great information, thanks! > Windows 10 also provides QueryInterruptTimePrecise(), which is a hybrid solution. It uses the performance counter to interpolate a timestamp between interrupts. I'd prefer to use this for time.monotonic() instead of QPC, if it's available via GetProcAddress() My personal vote is to use the currently most common clock source (QPC) for now for monotonic(), because it's the same across Windows versions and the most likely to produce portable monotonic timestamps between apps/languages on the same system. It's also the easiest patch, as there's already a code path for QPC. (As someone building multi-app experiences around Python, I don't want to check the Windows version to see which time base Python is using. I'd feel better about switching to QITP() if/when Python drops Windows 8 support.) A later extension of this idea (maybe behind a PEP) could be to survey the existing timers available on each platform and consider whether it's worth extending `time` to expose them all, and unify cross-platform the ones that are exposed (e.g. better formalize/document which clocks will advance while the machine is asleep on each platform). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:54:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 09 Jun 2021 23:54:26 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623282866.59.0.244217610514.issue44347@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25220 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26634 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:56:47 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 09 Jun 2021 23:56:47 +0000 Subject: [issue42801] Exception catching function crashes on recursive list In-Reply-To: <1609478187.83.0.886724654093.issue42801@roundup.psfhosted.org> Message-ID: <1623283007.35.0.449427811353.issue42801@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.10, Python 3.8 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 19:58:19 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 09 Jun 2021 23:58:19 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623283099.38.0.316414436843.issue44347@roundup.psfhosted.org> Jack DeVries added the comment: I've created a PR: https://github.com/python/cpython/pull/26634 I forgot to put a news entry, but hopefully that's ok since this is a very small change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 20:00:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 10 Jun 2021 00:00:14 +0000 Subject: [issue44340] Add support for building cpython with clang thin lto In-Reply-To: <1623105491.02.0.949113840673.issue44340@roundup.psfhosted.org> Message-ID: <1623283214.16.0.759917446543.issue44340@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 20:00:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 10 Jun 2021 00:00:46 +0000 Subject: [issue35800] remove smtpd.MailmanProxy In-Reply-To: <1548091630.84.0.140233087609.issue35800@roundup.psfhosted.org> Message-ID: <1623283246.88.0.00448796491401.issue35800@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 20:13:54 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 10 Jun 2021 00:13:54 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623284034.26.0.342313769758.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: In [this Dockerfile](https://github.com/jaraco/jaraco.windows/blob/feature/vs-2/Dockerfile), I've attempted to install Visual Studio, but without success. Docker fails to build on [line 6](https://github.com/jaraco/jaraco.windows/blob/4de80c897cb92362bd1084a9851f3f08b6ed697e/Dockerfile#L6). The install fails with this error: ``` ERROR: Running ["C:\Users\ContainerAdministrator\AppData\Local\Temp\chocolatey\visualstudio2019buildtools\16.10.0.0\vs_BuildTools.exe" --quiet --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools --add Microsoft.VisualStudio.Workload.NetCoreBuildTools --norestart --wait] was not successful. Exit code was '-2147024770'. See log for possible error messages. ``` Any tips on creating a Windows environment with build support would be appreciated. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 21:34:56 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Thu, 10 Jun 2021 01:34:56 +0000 Subject: [issue44336] Windows buildbots hang after fatal exit In-Reply-To: <1623085672.48.0.908810860846.issue44336@roundup.psfhosted.org> Message-ID: <1623288896.29.0.912764854202.issue44336@roundup.psfhosted.org> Jeremy Kloth added the comment: While now not as immediately beneficial, I believe that the linked PR would be good for the long run. The ramifications of bpo-11105 meant that the Windows buildbots were basically unusable for 5 days. Realistically, any commit that triggers aborts in the Windows test runs will exhibit this problematic behavior. I'm confident that the PR is in ready-to-go form. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 21:54:15 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Larose?=) Date: Thu, 10 Jun 2021 01:54:15 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument Message-ID: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> New submission from Jo?l Larose : If `math.nan` is the first argument for either max() or min(), the result is always `nan`, regardless of the other values in the results. However, if `nan` is in any other position in the arguments list, the result is always what you would expect if `nan` was not in the arguments list. E.g. from math import nan, inf >>> max(nan, 5, 3, 0) nan >>> min(nan, 5, 3, 0) nan >>> min(nan, 5, 3, 0, inf, -inf) nan >>> max(nan, 5, 3, 0, inf, -inf) nan >>> max(inf, 5, 3, 0, nan, -inf) inf >>> max(8, inf, 5, 3, 0, nan, -inf) inf >>> min(8, inf, 5, 3, 0, nan, -inf) -inf >>> min(8, nan, inf, 5, 3, 0, nan, -inf) -inf >>> max(8, nan, inf, 5, 3, 0, nan, -inf) inf >>> max(8, 5, 3, 0, nan) 8 As you can see, the results for min() and max() are inconsistent for `nan` depending on whether it's the first argument or not. I would prefer for min() and max() to ignore `nan` unless all arguments are `nan`. However, the other path for consistent behaviour is to return `nan` if any of the arguments are `nan`. ---------- components: Interpreter Core messages: 395497 nosy: joel.larose priority: normal severity: normal status: open title: Inconsistent results for min() and max() with math.nan as argument type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 21:57:35 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Larose?=) Date: Thu, 10 Jun 2021 01:57:35 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623290255.89.0.956794699517.issue44370@roundup.psfhosted.org> Jo?l Larose added the comment: Forgot to mention the environment: Python version: 3.9.0 OS: Windows 10 I have not tested this on any other version of python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 22:01:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 10 Jun 2021 02:01:26 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623290486.0.0.6171568873.issue44362@roundup.psfhosted.org> Jack DeVries added the comment: These changes are part of PEP 644; support for OpenSSL v1.1.1. The benefits are detailed in `the PEP `_. Later, the deprecation process began in `bpo-43880 `_. It seems like `PROTOCOL_TLS` is the only thing with a deprecation warning that does not have a suggested alternative. I'm confused as to how this can be deprecated; what will be the new mechanism for selecting a protocol? If someone can provide some brief clarification, I'd be more than happy to update the docs! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 22:05:16 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 10 Jun 2021 02:05:16 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow In-Reply-To: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> Message-ID: <1623290716.77.0.35405812062.issue44352@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +belopolsky, p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 22:10:08 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 10 Jun 2021 02:10:08 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623291008.14.0.547867094539.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: I managed to put together a Dockerfile that seemingly has the build tools installed (https://github.com/jaraco/jaraco.windows/blob/d2edad2e2af9d469189d7ac6a14a4ba6f6270348/Dockerfile). When I attempt to build CPython, however, it fails with this error: ``` PS C:\code\public\cpython> PCBuild\build.bat Using py -3.9 (found 3.9 with py.exe) Fetching external libraries... bzip2-1.0.6 already exists, skipping. sqlite-3.35.5.0 already exists, skipping. xz-5.2.2 already exists, skipping. zlib-1.2.11 already exists, skipping. Fetching external binaries... libffi already exists, skipping. openssl-bin-1.1.1k-1 already exists, skipping. tcltk-8.6.11.0 already exists, skipping. Finished. Using "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" (found in the PATH) Using py -3.9 (found 3.9 with py.exe) C:\code\public\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" "C:\code\public\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /clp:summary /p:Configuration=Release /p:Platform=x64 /p:IncludeExternals=true /p:IncludeCTypes=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" C:\code\public\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot be evaluated. Version string portion was too short or too long. [C:\code\public\cpython\PCbuild\pythoncore.vcxproj] Build FAILED. C:\code\public\cpython\PCbuild\python.props(111,31): error MSB4184: The expression "[System.Version]::Parse('')" cannot be evaluated. Version string portion was too short or too long. [C:\code\public\cpython\PCbuild\pythoncore.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.15 ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 9 22:13:24 2021 From: report at bugs.python.org (=?utf-8?q?Jo=C3=ABl_Larose?=) Date: Thu, 10 Jun 2021 02:13:24 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623291204.03.0.627451843558.issue44370@roundup.psfhosted.org> Jo?l Larose added the comment: The same problem occurs if the argument is a `list`. The same inconsistency happens depending on the position in the list that `nan` happens to be. >>> max([5, nan, 3, 0, 8, -10]) 8 >>> min([5, nan, 3, 0, 8, -10]) -10 >>> min([nan, 5, 3, 0, 8, -10]) nan >>> max([nan, 5, 3, 0, 8, -10]) nan Passing a `tuple` with the same values produces the same inconsistency. For the examples above, replacing the lists with sets with the same values (i.e. replace [] with {}) always results in `nan`. This may have to do with the hash value of `nan` always making the first value in iteration be `nan` given the sample space. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 00:26:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 10 Jun 2021 04:26:41 +0000 Subject: [issue42088] types.SimpleNamespace.__repr__ documentation inconsistency In-Reply-To: <1603139694.62.0.339590504513.issue42088@roundup.psfhosted.org> Message-ID: <1623299201.58.0.520430490521.issue42088@roundup.psfhosted.org> Raymond Hettinger added the comment: Given how long this object has been its current state, the OP's request seems reasonable to me and it is an easy change to make. I don't think there is any downside. Also, if this ever becomes a builtin, I think we would leave the current implementation in place and deprecate it over the course of a couple of releases. So making any improvements now probably wouldn't get in the way of a proposal to have a builtin namespace object. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 00:31:36 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 10 Jun 2021 04:31:36 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow In-Reply-To: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> Message-ID: <1623299496.35.0.75151698046.issue44352@roundup.psfhosted.org> Eryk Sun added the comment: > 2. Execute 'set TZ=Europe/Moscow' The Windows C runtime supports a simple format for the TZ environment variable, which is detailed in the documentation of _tzset() [1]. For example, it's "MSK-3" for Moscow Standard Time. It's -3 because the offset is from local time to UTC. The CRT does not verify that the TZ value is valid. "Europe/Moscow" is invalid, but it's blindly parsed anyway. There's no UTC offset, so it defaults to UTC (0 offset). It's parsed as supporting daylight saving time, according to U.S. rules. Currently this corresponds to UTC + 1. That's why there's a -2 hour delta from Moscow Standard Time, which does not observe daylight saving time. I recommend that you unset the TZ environment variable before running Windows Python. Use the system timezone. --- [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/tzset?view=msvc-160 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 01:35:55 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 05:35:55 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623303355.75.0.0311730606098.issue44242@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25221 pull_request: https://github.com/python/cpython/pull/26635 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 01:41:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 05:41:08 +0000 Subject: [issue33051] IDLE: Create new tab for editor options in configdialog In-Reply-To: <1520796379.91.0.467229070634.issue33051@psf.upfronthosting.co.za> Message-ID: <1623303668.06.0.268093959049.issue33051@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> IDLE: configdialog tab rearrange _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 01:44:24 2021 From: report at bugs.python.org (Arjun) Date: Thu, 10 Jun 2021 05:44:24 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1623303864.61.0.797052249086.issue14322@roundup.psfhosted.org> Change by Arjun : ---------- pull_requests: +25222 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26636 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 01:44:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 05:44:40 +0000 Subject: [issue40468] IDLE: configdialog tab rearrange In-Reply-To: <1588342210.52.0.776872841323.issue40468@roundup.psfhosted.org> Message-ID: <1623303880.71.0.297157427197.issue40468@roundup.psfhosted.org> Terry J. Reedy added the comment: Along with the spinbox PR for #33962, I believe everything discussed here is done. There are still issues to improve specific pages. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 01:55:58 2021 From: report at bugs.python.org (Ofek Kirzner) Date: Thu, 10 Jun 2021 05:55:58 +0000 Subject: [issue44371] asyncio.wait_for does not cancel running tasks in the correct fashion Message-ID: <1623304558.86.0.995602779591.issue44371@roundup.psfhosted.org> New submission from Ofek Kirzner : Following https://bugs.python.org/issue32751 I think wait_for should also wait for running coroutine in case it has been cancelled. Example code: import asyncio async def inner(): try: print(1) await asyncio.sleep(3600) print(2) except asyncio.CancelledError: print('inner - canc') raise async def outer(f): try: print('a') # Version 1 - This creates the expected behaviour # await f # Version 2 - This creates the reversed behaviour await asyncio.wait_for(f, timeout=500) print('b') except asyncio.CancelledError: print('outer - canc') @pytest.mark.asyncio async def test_t1(): t = asyncio.create_task(outer(inner())) done, pending = await asyncio.wait([t], timeout=1) t.cancel() await t ------ I expect inner to be cancelled and awaited before outer is finished. i.e., exepcted output: 1 inner - canc outer - canc While I get: 1 outer - canc inner - canc ---------- components: asyncio messages: 395505 nosy: asvetlov, ofekkir, yselivanov priority: normal severity: normal status: open title: asyncio.wait_for does not cancel running tasks in the correct fashion type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 02:07:00 2021 From: report at bugs.python.org (=?utf-8?q?Lum=C3=ADr_Balhar?=) Date: Thu, 10 Jun 2021 06:07:00 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623305220.96.0.421777957196.issue44351@roundup.psfhosted.org> Change by Lum?r Balhar : ---------- keywords: +patch pull_requests: +25223 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26637 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 02:33:24 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 10 Jun 2021 06:33:24 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623306804.08.0.775658430237.issue44370@roundup.psfhosted.org> Dennis Sweeney added the comment: This is essentially the same issue, but with sorted(): https://bugs.python.org/issue36095 The trouble is that the implementation of min() is roughly equivalent to: iterable = iter(iterable) current_min = next(iterable) for x in iterable: if x < current_min: current_min = x return current_min NaN < number and number < NaN both return false. Thus including NaNs make floats not totally ordered, so there's no perfect way to sort them or take a max/min. This leads to some unexpected result, as you've identified. So you could say that the real "bug" is in floats more broadly. This behavior was originally implemented to comply with IEEE 754. Even if that was a mistake, it would be very difficult to change this behavior in case someone's code relies on exactly using this implantation. I also don't like the idea of special-casing the behavior of min/max for floats, since right now the behavior is completely agnostic of the types of the items. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 02:35:09 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 10 Jun 2021 06:35:09 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623306909.38.0.948811936638.issue44370@roundup.psfhosted.org> Dennis Sweeney added the comment: implantation --> implementation ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 02:36:59 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Jun 2021 06:36:59 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623307019.06.0.334968556905.issue44362@roundup.psfhosted.org> Christian Heimes added the comment: You either use TLS_PROTOCOL_CLIENT for a client-side socket or TLS_PROTOCOL_SERVER for a server-side socket. TLS_PROTOCOL_CLIENT gives you a secure context for client connections with cert and hostname verification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 02:54:59 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 06:54:59 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623308099.75.0.146006724924.issue44370@roundup.psfhosted.org> Mark Dickinson added the comment: See also #11986, which this report is essentially a duplicate of. I think it may be time to implement `math.ieee754_total_order` (after suitable bikeshedding about the name), so that one can do sorted(my_list_of_floats, key=math.ieee754_total_order) and max(my_list_of_floats, key=math.ieee754_total_order) ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 03:28:50 2021 From: report at bugs.python.org (Thomas Schweikle) Date: Thu, 10 Jun 2021 07:28:50 +0000 Subject: [issue44372] Can't install Python3.8, 3.9, 3.10 various errors including 0x80070643 Message-ID: <1623310130.37.0.4237956149.issue44372@roundup.psfhosted.org> New submission from Thomas Schweikle : Python Setup for python-3.8.10-amd64.exe, python-3.9.5-amd64.exe, python10.0b2-amd64.exe fails after exausting "No Python 3.8 installation was detected.", then again "No Python 3.8 installation was detected." next it tells about "Error 0x80070643 while installing". Non of the workarounds you'll able to find will work. Looking into the registry you'll find various entries like: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0255A3B1CB3E0445EBD928E5D9ABECFD] "8400E080C358BF9469DE03ED7FBAE643"="C:\\Program Files\\Python\\38\\Lib\\lib2to3\\fixes\\fix_funcattrs.py" I could find ~300 entries for Python 3.8, ~400 entries for Python 3.9 and ~1000 entries for Python 3.10. I've installed into a new windows 10, then removed Python 3.8 looked into the registry and found -- nothing. Tried the same, but this time installed Python 3.8 and Python 3.9 in parallel before removing Python 3.8 and then Python 3.9. Again nothing. Next try: installed Python 3.8.9, then Python 3.9.0. Next upgraded Python 3.8.9 to 3.8.10. Then upgraded Python 3.9.0 to 3.9.5. Then removed Python 3.8.10 and Python 3.9.5. Voila! Lots of entries! Conclusion: the installer does what it is expected to do, as long as you install and then remove the same version. As soon, as you upgraded in between, then remove it will leave various entries in the registry behind and reinstalling will fail with error 0x80070643. Your installer has to do its work different: do not upgrade an existing installation "in line", but backup necessary parts, then remove the existing installation, clean up registry, then install the new version, restore what you backed up before. Seems the installer looses track of these registry entries if upgrades are done inline and later on these existing entries make reinstalling/upgrading impossible. ---------- components: Installation messages: 395510 nosy: tps800 priority: normal severity: normal status: open title: Can't install Python3.8, 3.9, 3.10 various errors including 0x80070643 type: crash versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 03:34:22 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Thu, 10 Jun 2021 07:34:22 +0000 Subject: [issue44373] make Event and Awaitable Message-ID: <1623310462.97.0.487595968193.issue44373@roundup.psfhosted.org> New submission from Kaleb Barrett : Following on from https://bugs.python.org/issue33544. I don't agree with the original suggestion to deprecate the wait() method on Events, but I do agree that Event should be made Awaitable. Doing so would make code more expressive, but more importantly improve the ability to use Events with generic code that can already handles the other Awaitable types in asyncio. There were generally neutral takes on providing both __await__ and wait, besides Yury Selivanov who implied it was complex (???). I just tried the below, but maybe I'm missing something? class AwaitableEvent(Awaitable[None], Event): def __await__(self) -> None: yield from self.wait().__await__() __iter__ = __await__ ---------- components: asyncio messages: 395511 nosy: asvetlov, ktbarrett, yselivanov priority: normal severity: normal status: open title: make Event and Awaitable versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 03:36:45 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Thu, 10 Jun 2021 07:36:45 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1623310605.7.0.884855622093.issue44353@roundup.psfhosted.org> Dominic Davis-Foster added the comment: It is possible to implement NewType to return a class rather than a function as it does currently. However, the class version uses substantially more memory (1072 bytes vs 144 bytes with sys.getsizeof) and NewType is supposed to have almost no runtime overhead. ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 03:46:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 07:46:15 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623311175.46.0.740545414921.issue44337@roundup.psfhosted.org> Mark Shannon added the comment: New changeset e117c0283705943189e6b1aef668a1f68f3f00a4 by Mark Shannon in branch 'main': bpo-44337: Port LOAD_ATTR to PEP 659 adaptive interpreter (GH-26595) https://github.com/python/cpython/commit/e117c0283705943189e6b1aef668a1f68f3f00a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 03:47:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 07:47:08 +0000 Subject: [issue44348] test_exceptions.ExceptionTests.test_recursion_in_except_handler stack overflow on Windows debug builds In-Reply-To: <1623145677.55.0.159722944157.issue44348@roundup.psfhosted.org> Message-ID: <1623311228.26.0.753011624337.issue44348@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374 by Mark Shannon in branch 'main': bpo-44348: Move trace-info to thread-state (GH-26623) https://github.com/python/cpython/commit/54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 04:02:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 08:02:49 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623312169.38.0.343417562388.issue44363@roundup.psfhosted.org> Mark Shannon added the comment: It looks like I've been a bit unfair to the address sanitizer. It does appear to produce incorrect locations sometimes, but that's not really a false positive and the reports are generally useful. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 04:14:30 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 10 Jun 2021 08:14:30 +0000 Subject: [issue44372] Can't install Python3.8, 3.9, 3.10 various errors including 0x80070643 In-Reply-To: <1623310130.37.0.4237956149.issue44372@roundup.psfhosted.org> Message-ID: <1623312870.49.0.228727963488.issue44372@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 04:37:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 08:37:15 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports In-Reply-To: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> Message-ID: <1623314235.2.0.369886107357.issue44313@roundup.psfhosted.org> Mark Shannon added the comment: Yes. Simpler is good. I think it will also be better for performance: In general, we don't know what X is in `from Y import X`. It could be a module or anything else. However, if we are accessing an attribute it is quite likely to be a module or class. For `X` defined by `from Y import X`, `X` is likely to be a module, class, function, or some sort of constant like a string, int or Enum. If it is a string, int or function then it is rare to call a method on it, so we can ignore that case. Calling methods on an Enum constant is probably not very common either (I'm guessing here) For a module, `LOAD_ATTR; CALL_FUNCTION` is clearly better than `LOAD_METHOD; CALL_METHOD`. For a class, specializing `LOAD_ATTR` is no more complex than `LOAD_METHOD`, probably simpler. So, for a class `LOAD_ATTR; CALL_FUNCTION` is no worse than `LOAD_METHOD; CALL_METHOD`, and might be better. Overall, it looks like `X.foo()` when `X` is defiend by `from Y import X` is best as `LOAD_ATTR; CALL_FUNCTION` not `LOAD_METHOD; CALL_METHOD`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 04:38:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 08:38:00 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623314280.61.0.301043752304.issue44337@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 Jun 10 05:03:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 09:03:36 +0000 Subject: [issue44338] Port LOAD_GLOBAL to adaptive interpreter In-Reply-To: <1623089094.6.0.928459069961.issue44338@roundup.psfhosted.org> Message-ID: <1623315816.65.0.0720082829987.issue44338@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25225 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26638 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 05:31:51 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 10 Jun 2021 09:31:51 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports In-Reply-To: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> Message-ID: <1623317511.39.0.0505294517629.issue44313@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 05:35:16 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 10 Jun 2021 09:35:16 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623317716.97.0.990826787114.issue44370@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 06:08:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 10 Jun 2021 10:08:10 +0000 Subject: [issue44360] test_compile killed by SIGKILL on AMD64 Ubuntu 3.x (Linux OOM Killer) In-Reply-To: <1623225982.87.0.660015113857.issue44360@roundup.psfhosted.org> Message-ID: <1623319690.05.0.366402322972.issue44360@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 06:14:52 2021 From: report at bugs.python.org (junyixie) Date: Thu, 10 Jun 2021 10:14:52 +0000 Subject: [issue44374] PyThreadState_IsCurrent bug under building Python with --with-experimental-isolated-subinterpreters Message-ID: <1623320092.73.0.0769901058138.issue44374@roundup.psfhosted.org> New submission from junyixie : under building Python with --with-experimental-isolated-subinterpreters PyThreadState_IsCurrent use _PyRuntime.gilstate. is shared by multi sub interpreters. Use interpreter `gil->last_holder == state` can fix it? ``` static int PyThreadState_IsCurrent(PyThreadState *tstate) { /* Must be the tstate for this thread */ struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; assert(_PyGILState_GetThisThreadState(gilstate) == tstate); return tstate == _PyRuntimeGILState_GetThreadState(gilstate); } ``` ``` static int PyThreadState_IsCurrent(PyThreadState *tstate) { #ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS PyInterpreterState *interp = tstate->interp; struct _ceval_state *ceval2 = &interp->ceval; struct _gil_runtime_state *gil = &ceval2->gil; return tstate == (PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder); #else /* Must be the tstate for this thread */ struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; assert(_PyGILState_GetThisThreadState(gilstate) == tstate); return tstate == _PyRuntimeGILState_GetThreadState(gilstate); #endif } ``` ---------- components: Subinterpreters messages: 395517 nosy: JunyiXie, vstinner priority: normal severity: normal status: open title: PyThreadState_IsCurrent bug under building Python with --with-experimental-isolated-subinterpreters versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 06:22:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 10 Jun 2021 10:22:37 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623320557.38.0.748191966667.issue44363@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25226 pull_request: https://github.com/python/cpython/pull/26639 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:29:34 2021 From: report at bugs.python.org (Neethu) Date: Thu, 10 Jun 2021 11:29:34 +0000 Subject: [issue44375] urllib.parse.urlparse is not parsing the url properly Message-ID: <1623324574.38.0.821681616785.issue44375@roundup.psfhosted.org> New submission from Neethu : urllib.parse.urlparse is not parsing urls without scheme and with port number properly. from urllib.parse import urlparse print(urlparse("www.cwi.nl:80")) ParseResult(scheme='www.cwi.nl', netloc='', path='80', params='', query='', fragment='') Python version : 3.9.5 ---------- messages: 395518 nosy: neethun priority: normal severity: normal status: open title: urllib.parse.urlparse is not parsing the url properly versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:29:35 2021 From: report at bugs.python.org (Yurii Karabas) Date: Thu, 10 Jun 2021 11:29:35 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1623324575.14.0.971496853521.issue44353@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: What about to return callable object instead of function from a `typing.NewType`? It will look something like this: ``` class _NewType: __slots__ = ('__name__', '__supertype__') def __init__(self, name, supertype): self.__name__ = name self.__supertype__ = supertype def __call__(self, val): return val def __or__(self, other): return Union[self, other] def __ror__(self, other): return Union[other, self] def NewType(name, tp): """NewType creates simple unique types with almost zero runtime overhead. NewType(name, tp) is considered a subtype of tp by static type checkers. At runtime, NewType(name, tp) returns a dummy callable object that simply returns its argument. Usage:: UserId = NewType('UserId', int) def name_by_id(user_id: UserId) -> str: ... UserId('user') # Fails type check name_by_id(42) # Fails type check name_by_id(UserId(42)) # OK num = UserId(5) + 1 # type: int """ return _NewType(name, tp) ``` With such implementation `__or__` will be available for a NewType and actually because of __slots__ size of object will be 48 bytes (with sys.getsizeof) which is less than current 144 bytes (if memory is important). ---------- nosy: +uriyyo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:37:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 10 Jun 2021 11:37:25 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623325045.67.0.948629946129.issue44363@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b by Mark Shannon in branch 'main': bpo-44363: Get test_capi passing with address sanitizer (GH-26639) https://github.com/python/cpython/commit/31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:40:10 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 11:40:10 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623325210.77.0.326028990416.issue44363@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25227 pull_request: https://github.com/python/cpython/pull/26641 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:40:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 11:40:15 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623325215.78.0.252123687944.issue44363@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25228 pull_request: https://github.com/python/cpython/pull/26642 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:45:15 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 10 Jun 2021 11:45:15 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623325515.54.0.824578029932.issue44370@roundup.psfhosted.org> Steven D'Aprano added the comment: math.ieee754_total_order sounds good to me, but how would you get the minimum? Wikipedia doesn't have much on the 2019 revision to IEEE-754 except to say that the min/max rules have been overhauled again, but without giving much detail. https://en.wikipedia.org/wiki/IEEE_754 Also relevant: https://grouper.ieee.org/groups/msc/ANSI_IEEE-Std-754-2019/background/minNum_maxNum_Removal_Demotion_v3.pdf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 07:52:24 2021 From: report at bugs.python.org (Gnanesh) Date: Thu, 10 Jun 2021 11:52:24 +0000 Subject: [issue44375] urllib.parse.urlparse is not parsing the url properly In-Reply-To: <1623324574.38.0.821681616785.issue44375@roundup.psfhosted.org> Message-ID: <1623325944.24.0.933085857135.issue44375@roundup.psfhosted.org> Gnanesh added the comment: Hey neethu, For empty schemes, it should have a prefix of "//" in the URL to parse it correctly. Try: > urlparse('//www.cwi.nl:80') ParseResult(scheme='', netloc='www.cwi.nl:80', path='', params='', query='', fragment='') Here's a comment from the docs (https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse): > Following the syntax specifications in RFC 1808, urlparse recognizes a netloc only if it is properly introduced by ?//?. Otherwise the input is presumed to be a relative URL and thus to start with a path component. ---------- nosy: +Gnanesh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:01:29 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 12:01:29 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623326489.64.0.0849481700414.issue44363@roundup.psfhosted.org> miss-islington added the comment: New changeset 865269458fde83f58f056d02a777e4328c763880 by Miss Islington (bot) in branch '3.9': bpo-44363: Get test_capi passing with address sanitizer (GH-26639) https://github.com/python/cpython/commit/865269458fde83f58f056d02a777e4328c763880 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:01:55 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 10 Jun 2021 12:01:55 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623326515.82.0.1986004455.issue44354@roundup.psfhosted.org> Thomas Grainger added the comment: it looks like OP_NO_SSLv2 and OP_NO_SSLv3 are not raising a DeprecationWarning ``` python310 -W error Python 3.10.0b2 (default, Jun 2 2021, 00:22:18) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> ssl.SSLContext(ssl.PROTOCOL_TLS) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.10/ssl.py", line 501, in __new__ self = _SSLContext.__new__(cls, protocol) DeprecationWarning: ssl module: PROTOCOL_TLS is deprecated >>> ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) >>> c = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) >>> c.options |= ssl.OP_NO_SSLv2 # no deprecation warning!? >>> c.options |= ssl.OP_NO_SSLv3 # no deprecation warning!? >>> c.options |= ssl.OP_NO_TLSv1 Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.10/ssl.py", line 621, in options super(SSLContext, SSLContext).options.__set__(self, value) DeprecationWarning: ssl module: Setting OP_NO_SSL* or SSL_NO_TLS* options is deprecated is deprecated ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:02:25 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 12:02:25 +0000 Subject: [issue44363] Address sanitizer (gcc version) is generating false positives In-Reply-To: <1623231048.1.0.253699094355.issue44363@roundup.psfhosted.org> Message-ID: <1623326545.94.0.71648255133.issue44363@roundup.psfhosted.org> miss-islington added the comment: New changeset 0895e62c9b4f03b83120d44cb32587804084e0e2 by Miss Islington (bot) in branch '3.10': bpo-44363: Get test_capi passing with address sanitizer (GH-26639) https://github.com/python/cpython/commit/0895e62c9b4f03b83120d44cb32587804084e0e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:10:46 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Jun 2021 12:10:46 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623327046.3.0.543962275479.issue44354@roundup.psfhosted.org> Christian Heimes added the comment: ctx.options |= ssl.OP_NO_SSLv2 and ctx.options |= ssl.OP_NO_SSLv3 are no-ops and don't modify the value of ctx.options. OP_NO_SSLv2 == 0 and OP_NO_SSLv3 is set by default: >>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) >>> ctx.options ssl.OP_NO_COMPRESSION|ssl.OP_ENABLE_MIDDLEBOX_COMPAT|ssl.OP_CIPHER_SERVER_PREFERENCE|ssl.OP_NO_SSLv3|0x80000054 >>> int(ssl.OP_NO_SSLv2) 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:12:15 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 10 Jun 2021 12:12:15 +0000 Subject: [issue44376] Improve performance of integer exponentiation Message-ID: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> New submission from Steven D'Aprano : Naively, I assumed that `x**2` would be faster than `x*x` as there is only one name lookup in the first, and two in the second. But it is slower. The performance of `x**2` relative to `x*x` has gradually deteriorated compared to `x*x` over many versions. I have found the ratio of `x**2` to `x*x` using timeit: pythonX.Y -m timeit -s "x=115" "x**2" pythonX.Y -m timeit -s "x=115" "x*x" for various X.Y: 2.4: 1.1 # ratio of time for x**2 / time for x*x 2.5: 1.5 2.6: 1.0 2.7: 1.6 3.2: 4.2 3.3: 4.2 3.5: 3.8 3.7: 5.9 3.9: 7.3 In the 2.x series, performance was quite close. In 3.x, the ratio has increased significantly. Either integer multiplication has gotten much faster, or exponentiation much slower, or both. Shockingly (to me at least), an exponent of 1 is an order of magnitude slower than an multiplicand of 1: 2.7: 1.3 # ratio of time for x**1 / time for x*1 3.9: 10.2 Even an exponent of 10 is a little slower than repeated multiplication in 3.9: `x*x*x*x*x*x*x*x*x*x` is slightly faster than `x**10`. It would be nice if we could improve the performance of exponentiation. (OS: Linux) ---------- components: Interpreter Core messages: 395527 nosy: steven.daprano priority: normal severity: normal status: open title: Improve performance of integer exponentiation type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:17:02 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 10 Jun 2021 12:17:02 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623327422.39.0.270896618513.issue44354@roundup.psfhosted.org> Thomas Grainger added the comment: there should still be a deprecation warning so that 3.12 can raise AttributeError ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:27:15 2021 From: report at bugs.python.org (Prasanth Rajendran) Date: Thu, 10 Jun 2021 12:27:15 +0000 Subject: [issue44377] Truncated error message of original function while multiprocessing or multithreading Message-ID: <1623328035.9.0.197827548789.issue44377@roundup.psfhosted.org> New submission from Prasanth Rajendran : Under multiprocessing package, in pool.py, when an error occurs on line 122: result = (True, func(*args, **kwds)) The exception "e" has the error message due to execution of the function that is executed in parallel. However, the error message is lost when another error is occurred due to the execution of following line 128: put((job, i, result)) The MaybeEncodingError masks or truncates the original error message, due to the following line at 130: MaybeEncodingError(e, result[1]) where the repr function in the class truncates the message. The final error message has pickling error and the masked error of the actual execution. ---------- components: Library (Lib) messages: 395529 nosy: mrshanth priority: normal severity: normal status: open title: Truncated error message of original function while multiprocessing or multithreading versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:29:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 10 Jun 2021 12:29:33 +0000 Subject: [issue44347] Unclear documentation for shutil.copytree() In-Reply-To: <1623143832.18.0.435867988934.issue44347@roundup.psfhosted.org> Message-ID: <1623328173.31.0.803392376226.issue44347@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25229 pull_request: https://github.com/python/cpython/pull/26643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:37:52 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 10 Jun 2021 12:37:52 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1623328672.36.0.165625820817.issue43298@roundup.psfhosted.org> Jason R. Coombs added the comment: In issue44246, I've encountered this error while attempting to build CPython in a Docker image (built from https://github.com/jaraco/jaraco.windows/blob/d2edad2e2af9d469189d7ac6a14a4ba6f6270348/Dockerfile). Any suggestions on how to install the SDK to a viable version in a headless environment? ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 08:38:35 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 10 Jun 2021 12:38:35 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1623328715.13.0.438389437275.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: The build error is tracked in issue43298. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:13:21 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 10 Jun 2021 13:13:21 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623330801.28.0.861176653316.issue44362@roundup.psfhosted.org> Jack DeVries added the comment: Would you like me to submit a PR for this simple patch? https://github.com/jdevries3133/cpython/commit/42d9bd7f97f03b49d4fc89780616704998492ac1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:16:41 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 10 Jun 2021 13:16:41 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623331001.54.0.37135937492.issue44362@roundup.psfhosted.org> Thomas Grainger added the comment: > Would you like me to submit a PR for this simple patch? > > https://github.com/jdevries3133/cpython/commit/42d9bd7f97f03b49d4fc89780616704998492ac1 TLS_PROTOCOL_CLIENT and TLS_PROTOCOL_SERVER are defined in terms of the deprecated TLS_PROTOCOL, so now this makes the definition circular ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:18:02 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Jun 2021 13:18:02 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623331082.12.0.0487425305682.issue44362@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:18:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Jun 2021 13:18:20 +0000 Subject: [issue44354] ssl deprecation warnings erganomics In-Reply-To: <1623184569.91.0.0837869945939.issue44354@roundup.psfhosted.org> Message-ID: <1623331100.16.0.280593483329.issue44354@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:19:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Jun 2021 13:19:54 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= Message-ID: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> New submission from STINNER Victor : The following change introduced a compiler warning: commit c5cb077ab3c88394b7ac8ed4e746bd31b53e39f1 Author: Victor Stinner Date: Tue Sep 22 12:42:28 2020 +0200 Py_IS_TYPE() macro uses Py_TYPE() (GH-22341) Steps to Reproduce: 1. dnf install -y python3-devel pkgconf-pkg-config gcc 2. printf '#include ' > test.c 3. gcc -Wcast-qual -Werror -c test.c `pkg-config --cflags --libs python-3.10` Actual results: sh-5.1# gcc -Wcast-qual -Werror -c test.c `pkg-config --cflags --libs python-3.10` In file included from /usr/include/python3.10/Python.h:78, from test.c:1: /usr/include/python3.10/object.h: In function ?_Py_IS_TYPE?: /usr/include/python3.10/object.h:112:29: error: cast discards ?const? qualifier from pointer target type [-Werror=cast-qual] 112 | #define _PyObject_CAST(op) ((PyObject*)(op)) | ^ /usr/include/python3.10/object.h:137:34: note: in expansion of macro ?_PyObject_CAST? 137 | #define Py_TYPE(ob) (_PyObject_CAST(ob)->ob_type) | ^~~~~~~~~~~~~~ /usr/include/python3.10/object.h:144:12: note: in expansion of macro ?Py_TYPE? 144 | return Py_TYPE(ob) == type; | ^~~~~~~ cc1: all warnings being treated as errors Attached PR fix the compiler warning. Issue reported on Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1969663 ---------- components: C API messages: 395534 nosy: vstinner priority: normal severity: normal status: open title: Py_IS_TYPE(): cast discards ?const? qualifier from pointer target type versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:23:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Jun 2021 13:23:18 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623331398.71.0.332590173609.issue44378@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25230 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26644 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:26:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Jun 2021 13:26:30 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623331590.17.0.704234504695.issue44378@roundup.psfhosted.org> STINNER Victor added the comment: Comment from my PR: // bpo-44378: Don't use Py_TYPE() since Py_TYPE() requires a non-const // object. By the way, I wrote a change in Python 3.11 to convert Py_TYPE() macro into a static inline function which accepts a *const* PyObject pointer ("const PyObject*"): https://github.com/python/cpython/commit/f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 But this change had to be reverted since it caused a buildbot regression (bpo-44348). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:27:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 10 Jun 2021 13:27:28 +0000 Subject: [issue39573] [C API] Make PyObject an opaque structure in the limited C API In-Reply-To: <1581030432.16.0.48160379721.issue39573@roundup.psfhosted.org> Message-ID: <1623331648.32.0.184139931956.issue39573@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44378: "Py_IS_TYPE(): cast discards ?const? qualifier from pointer target type". If Py_TYPE() is converted again to a static inline function which takes a "const PyObject*" type, Py_IS_TYPE() can be modified again at the same time to use Py_TYPE(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:31:36 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Jun 2021 13:31:36 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623331896.33.0.580921216052.issue44365@roundup.psfhosted.org> Eric V. Smith added the comment: The example was added in https://github.com/python/cpython/pull/25967 When reviewing it, I think I missed the fact that the base class is a dataclass. The example and text make more sense if Rectangle isn't a dataclass. Still, I don't like the example at all. I think deleting it might be the best thing to do. Or maybe come up with a case where the base class is some existing class in the stdlib that isn't a dataclass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:35:30 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 10 Jun 2021 13:35:30 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1623332130.34.0.727027159002.issue44353@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +Jelle Zijlstra, gvanrossum, kj, levkivskyi versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 09:55:37 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Thu, 10 Jun 2021 13:55:37 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1623333337.59.0.779732733312.issue44353@roundup.psfhosted.org> Jelle Zijlstra added the comment: https://github.com/python/typing/issues/746 has some previous discussion of implementing NewType as a class (motivated by __repr__), including benchmarks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 10:24:26 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 14:24:26 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623335066.13.0.640371332084.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 749648609de89f14581190ea34b9c0968787a701 by Ethan Furman in branch '3.10': [3.10] bpo-44242: [Enum] remove missing bits test from Flag creation (GH-26586) (GH-26635) https://github.com/python/cpython/commit/749648609de89f14581190ea34b9c0968787a701 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 10:50:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 14:50:03 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623336603.11.0.20501976691.issue43318@roundup.psfhosted.org> Irit Katriel added the comment: Your fix looks correct - the problem is that the list of breakpoints gets emptied by the clear_break call, and you copy the list so that it can be echoed later if clear_break does not err. I made some polishing comments on the PR, and it also need to be rebased because there is not a merge conflict on test_pdb. ---------- title: pdb can't output the prompt message when successfully clear breakpoints by "filename:lineno" -> pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:11:05 2021 From: report at bugs.python.org (Micael Jarniac) Date: Thu, 10 Jun 2021 15:11:05 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623337865.78.0.504082678731.issue44365@roundup.psfhosted.org> Micael Jarniac added the comment: I'm trying to think of an example, and what I've thought of so far is having a base dataclass that has a `__post_init__` method, and another dataclass that inherits from it and also has a `__post_init__` method. In that case, the subclass might need to call `super().__post_init__()` inside its own `__post_init__` method, because otherwise, that wouldn't get called automatically. Something along those lines: >>> from dataclasses import dataclass, field >>> >>> @dataclass ... class A: ... x: int ... y: int ... xy: int = field(init=False) ... ... def __post_init__(self) -> None: ... self.xy = self.x * self.y ... >>> @dataclass ... class B(A): ... m: int ... n: int ... mn: int = field(init=False) ... ... def __post_init__(self) -> None: ... super().__post_init__() ... self.mn = self.m * self.n ... >>> b = B(x=2, y=4, m=3, n=6) >>> b B(x=2, y=4, xy=8, m=3, n=6, mn=18) In this example, if not for the `super().__post_init__()` call inside B's `__post_init__`, we'd get an error `AttributeError: 'B' object has no attribute 'xy'`. I believe this could be an actual pattern that could be used when dealing with dataclasses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:12:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 15:12:53 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623337973.65.0.470351016066.issue37022@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:20:19 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 10 Jun 2021 15:20:19 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623338419.94.0.264067609134.issue44376@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:31:07 2021 From: report at bugs.python.org (Violet Godfrey) Date: Thu, 10 Jun 2021 15:31:07 +0000 Subject: [issue44379] Pickling recursion error, did not import pickle Message-ID: <1623339067.02.0.0636537811776.issue44379@roundup.psfhosted.org> New submission from Violet Godfrey : I accidentally created an infinite recursion. The error referenced pickling but I did not import pickle. To reproduce: def permute(inputList): '''permute(inputList) -> list returns list of all permutations of inputList CURRENTLY DOESN'T ACTUALLLY WORK PROPERLY''' for i in range(len(inputList)-1): tempList = inputList[:-i-2] tempList.append(inputList[-1]) for num in inputList[-i-2:-1]: tempList.append(num) print(tempList) permute(tempList) # runs infinitely (whoops) print() permute([1,2,3,4]) Error thrown: Traceback (most recent call last): File "C:\Users\Violet\Documents\Python Files\test.py", line 14, in permute([1,2,3,4]) File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute permute(tempList) # runs infinitely (whoops) File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute permute(tempList) # runs infinitely (whoops) File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute permute(tempList) # runs infinitely (whoops) [Previous line repeated 1009 more times] File "C:\Users\Violet\Documents\Python Files\test.py", line 10, in permute print(tempList) RecursionError: maximum recursion depth exceeded while pickling an object ---------- assignee: terry.reedy components: IDLE messages: 395542 nosy: Octopi, terry.reedy priority: normal severity: normal status: open title: Pickling recursion error, did not import pickle type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:33:58 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 15:33:58 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623339238.36.0.483930413508.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: Since I like puzzles, here is a working LenientStrEnum: class LenientStrEnum(str, Enum): # def __init__(self, *args): self._valid = True # @classmethod def _missing_(cls, value): logger.warning( f"[{cls.__name__}] encountered an unknown value!\n" f"Luckily I'm a LenientStrEnum, so I won't crash just yet.\n" f"You might want to add a new case though.\n" f"Value was: '{value}'" ) unknown = cls._member_type_.__new__(cls, value) unknown._valid = False unknown._name_ = value.upper() unknown._value_ = value cls._member_map_[value] = unknown return unknown # @property def valid(self): return self._valid `_member_map_` is not guaranteed, but is unlikely to change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:48:23 2021 From: report at bugs.python.org (Matt Whitlock) Date: Thu, 10 Jun 2021 15:48:23 +0000 Subject: [issue43498] "dictionary changed size during iteration" error in _ExecutorManagerThread In-Reply-To: <1615796616.26.0.51182574064.issue43498@roundup.psfhosted.org> Message-ID: <1623340103.79.0.515905588352.issue43498@roundup.psfhosted.org> Matt Whitlock added the comment: Observed this same failure mode on a Raspberry Pi 1 while running 'make install' on Python 3.9.5 with 9 concurrent workers. Exception in thread Thread-1: Traceback (most recent call last): File "/var/tmp/portage/dev-lang/python-3.9.5_p2/image/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/var/tmp/portage/dev-lang/python-3.9.5_p2/image/usr/lib/python3.9/concurrent/futures/process.py", line 317, in run result_item, is_broken, cause = self.wait_result_broken_or_wakeup() File "/var/tmp/portage/dev-lang/python-3.9.5_p2/image/usr/lib/python3.9/concurrent/futures/process.py", line 376, in wait_result_broken_or_wakeup worker_sentinels = [p.sentinel for p in self.processes.values()] File "/var/tmp/portage/dev-lang/python-3.9.5_p2/image/usr/lib/python3.9/concurrent/futures/process.py", line 376, in worker_sentinels = [p.sentinel for p in self.processes.values()] RuntimeError: dictionary changed size during iteration ---------- nosy: +whitslack _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 11:53:43 2021 From: report at bugs.python.org (Maxim Egorushkin) Date: Thu, 10 Jun 2021 15:53:43 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken Message-ID: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> New submission from Maxim Egorushkin : Problem: `glob.glob` documentation states that "pathname ... can contain shell-style wildcards." However, it stops short of saying that shell-style wildcards are handled the same way as in a POSIX-compliant/friendly shell. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_02 POSIX requires that "`*` (asterisk) is a pattern that shall match any string, including the null string." However, `glob.glob` pattern `*` (asterisk) doesn't match an empty/null string. Reproduction: $ ls *.bash_profile .bash_profile $ python3 -c 'import glob; print(glob.glob("*.bash_profile"))' [] $ python3 -c 'import glob; print(glob.glob(".bash_profile"))' ['.bash_profile'] ---------- components: Library (Lib) messages: 395545 nosy: max0x7ba priority: normal severity: normal status: open title: glob.glob handling of * (asterisk) wildcard is broken versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:00:25 2021 From: report at bugs.python.org (Maxim Egorushkin) Date: Thu, 10 Jun 2021 16:00:25 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623340825.19.0.0430808415999.issue44380@roundup.psfhosted.org> Change by Maxim Egorushkin : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:01:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 16:01:36 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623340896.44.0.0583020923181.issue44376@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is it because exponentiation becomes slower or because multiplication becomes faster? What are absolute numbers? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:17:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 16:17:18 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623341838.03.0.0503796127961.issue44380@roundup.psfhosted.org> Serhiy Storchaka added the comment: Only pattern beginning with a dot can match filename beginning with a dot. >From https://docs.python.org/3/library/glob.html Note that unlike fnmatch.fnmatch(), glob treats filenames beginning with a dot (.) as special cases. This phrase was added in issue16695 in attempt to improve documentation, but it is still not clear. ---------- assignee: -> docs at python components: +Documentation -Library (Lib) nosy: +docs at python, serhiy.storchaka type: behavior -> enhancement versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:18:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 16:18:21 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623341901.89.0.0781501380198.issue44380@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +nailor, petri.lehtinen _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:22:49 2021 From: report at bugs.python.org (Maxim Egorushkin) Date: Thu, 10 Jun 2021 16:22:49 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623342169.22.0.18617146977.issue44380@roundup.psfhosted.org> Maxim Egorushkin added the comment: I may be naive, but why then: $ python3 -c 'from pathlib import Path; print(list(Path(".").glob("*.bash_profile")))' Outputs: [PosixPath('.bash_profile')] ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:27:34 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 16:27:34 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` Message-ID: <1623342454.09.0.119648705367.issue44364@roundup.psfhosted.org> New submission from Mark Dickinson : New changeset 90cd4330329a99e52f7141db5e0a469d30088e66 by Ajith Ramachandran in branch 'main': bpo-44364:Add non integral tests for `sqrt()` (#26625) https://github.com/python/cpython/commit/90cd4330329a99e52f7141db5e0a469d30088e66 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:29:32 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 16:29:32 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` In-Reply-To: <1623342454.09.0.119648705367.issue44364@roundup.psfhosted.org> Message-ID: <1623342572.5.0.255767949053.issue44364@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:31:12 2021 From: report at bugs.python.org (Isaac Muse) Date: Thu, 10 Jun 2021 16:31:12 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623342672.69.0.614096076913.issue44380@roundup.psfhosted.org> Isaac Muse added the comment: Sadly, this because pathlib glob and glob.glob use different implementations. And glob.glob does not provide something equivalent to a DOTALL flag allowing a user to glob hidden files without explicitly defining the leading dot in the pattern. ---------- nosy: +Isaac Muse _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:33:19 2021 From: report at bugs.python.org (Maxim Egorushkin) Date: Thu, 10 Jun 2021 16:33:19 +0000 Subject: [issue44380] glob.glob handling of * (asterisk) wildcard is broken In-Reply-To: <1623340423.37.0.118155398047.issue44380@roundup.psfhosted.org> Message-ID: <1623342799.95.0.133866929125.issue44380@roundup.psfhosted.org> Maxim Egorushkin added the comment: > glob.glob does not provide something equivalent to a DOTALL flag I see now, said a blind man. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:34:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 16:34:52 +0000 Subject: [issue44379] Pickling recursion error, did not import pickle In-Reply-To: <1623339067.02.0.0636537811776.issue44379@roundup.psfhosted.org> Message-ID: <1623342892.51.0.199789187265.issue44379@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is because you run the code in IDLE. print(tempList) converts argument to string and write it to sys.stdout. In IDLE sys.stdout is a proxy object which uses RPC to communicate with the IDLE process which should insert the written text in the console text widget. Pickle is used for encoding command and arguments. Here you get a recursion error in pickle because when print(tempList) is executed the recursion depth almost reached the limit. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:42:17 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 16:42:17 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623343337.68.0.094005702565.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset ac867f10b49322e25f34d2d8abd8e63c86834750 by Ajith Ramachandran in branch 'main': bpo-44357:Add `math.cbrt()` function: Cube Root (GH-26622) https://github.com/python/cpython/commit/ac867f10b49322e25f34d2d8abd8e63c86834750 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:43:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 16:43:16 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623343396.25.0.317029381062.issue44357@roundup.psfhosted.org> Mark Dickinson added the comment: All done; closing. Thank you for the contribution! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 12:51:54 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 16:51:54 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623343914.14.0.493650384277.issue44376@roundup.psfhosted.org> Mark Dickinson added the comment: I can't reproduce this on my Mac laptop (using Python builds from MacPorts). Numbers for both x**2 and x*x are fairly stable across Python 3.2 to Python 3.10. There's some variation, but nothing close to the same extent that Steven is seeing. Here are my raw numbers: lovelace:cpython mdickinson$ /opt/local/bin/python3.2 -m timeit -s "x=115" "x*x" 10000000 loops, best of 3: 0.031 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.3 -m timeit -s "x=115" "x*x" 10000000 loops, best of 3: 0.0297 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.4 -m timeit -s "x=115" "x*x" 10000000 loops, best of 3: 0.0286 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.5 -m timeit -s "x=115" "x*x" 10000000 loops, best of 3: 0.03 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.6 -m timeit -s "x=115" "x*x" 10000000 loops, best of 3: 0.0312 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.7 -m timeit -s "x=115" "x*x" 10000000 loops, best of 5: 28.7 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.8 -m timeit -s "x=115" "x*x" 10000000 loops, best of 5: 32 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.9 -m timeit -s "x=115" "x*x" 10000000 loops, best of 5: 33.5 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.10 -m timeit -s "x=115" "x*x" 10000000 loops, best of 5: 32.3 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.2 -m timeit -s "x=115" "x**2" 1000000 loops, best of 3: 0.249 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.3 -m timeit -s "x=115" "x**2" 1000000 loops, best of 3: 0.224 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.4 -m timeit -s "x=115" "x**2" 1000000 loops, best of 3: 0.221 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.5 -m timeit -s "x=115" "x**2" 1000000 loops, best of 3: 0.213 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.6 -m timeit -s "x=115" "x**2" 1000000 loops, best of 3: 0.235 usec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.7 -m timeit -s "x=115" "x**2" 1000000 loops, best of 5: 204 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.8 -m timeit -s "x=115" "x**2" 1000000 loops, best of 5: 217 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.9 -m timeit -s "x=115" "x**2" 1000000 loops, best of 5: 245 nsec per loop lovelace:cpython mdickinson$ /opt/local/bin/python3.10 -m timeit -s "x=115" "x**2" 1000000 loops, best of 5: 230 nsec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 13:07:15 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 10 Jun 2021 17:07:15 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build Message-ID: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> New submission from Steve Dower : Currently we don't enable CFG (which is runtime protection against code injection into tables), because it likely has a performance impact and the kind of attack is outside our scope. However, we should make it easier to build CPython with CFG enabled, so that third-parties who do want to include it in their scope can do so. ---------- assignee: steve.dower components: Build, Windows messages: 395556 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Allow enabling control flow guard in Windows build type: security versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 13:10:58 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 10 Jun 2021 17:10:58 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623345058.1.0.138799857511.issue44381@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +25231 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26645 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 13:12:44 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 10 Jun 2021 17:12:44 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623345164.94.0.52287012499.issue44381@roundup.psfhosted.org> Steve Dower added the comment: FWIW, I don't actually know what the performance impact is. I'm not set up for running the perf benchmarks, and I don't know if anyone else is (on Windows), but if someone would like to then it'll be easier once the environment option to enable it is in there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 13:53:53 2021 From: report at bugs.python.org (Hypo Turtle) Date: Thu, 10 Jun 2021 17:53:53 +0000 Subject: [issue44382] Python 3.9+ on Windows 8.0 Message-ID: <1623347633.5.0.426865894131.issue44382@roundup.psfhosted.org> New submission from Hypo Turtle : As per https://docs.python.org/3/using/windows.html: "This means that Python 3.9 supports Windows 8.1 and newer." Isn't reflected on python.org main page which has: "Note that Python 3.9+ cannot be used on Windows 7 or earlier." Leaving 8.0 unaddressed. ---------- assignee: docs at python components: Documentation messages: 395558 nosy: docs at python, hypoturtle priority: normal severity: normal status: open title: Python 3.9+ on Windows 8.0 type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 14:07:47 2021 From: report at bugs.python.org (Julian Gilbey) Date: Thu, 10 Jun 2021 18:07:47 +0000 Subject: [issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter Message-ID: <1623348467.33.0.718434111549.issue44383@roundup.psfhosted.org> New submission from Julian Gilbey : With code like the following: ~~~~ import argparse parser = argparse.ArgumentParser( description="Test program", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser.add_argument( "--foo", help="Use the foo component.", action=argparse.BooleanOptionalAction, default=True, ) args = parser.parse_args() ~~~~ a call "python prog.py --help" then gives: ~~~~ usage: prog.py [-h] [--foo | --no-foo] Test program optional arguments: -h, --help show this help message and exit --foo, --no-foo Use the foo component. (default: True) (default: True) ~~~~ Note the repeated "(default: True)", one produced by the BooleanOptionalAction class and the other by the ArgumentDefaultsHelpFormatter. It would be good if they didn't both add this helpful information. My suggestion would be that BooleanOptionalAction should not include this information; it is unique in doing so. ---------- components: Library (Lib) messages: 395559 nosy: juliangilbey priority: normal severity: normal status: open title: argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 14:18:00 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 10 Jun 2021 18:18:00 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623349080.84.0.880369968162.issue44376@roundup.psfhosted.org> Tim Peters added the comment: Under the released 3.9.5 for 64-bit Win10, raising to the power 2 is clearly much slower than multiplying directly: C:\Windows\System32>py -3 -m timeit -s "x=151" "x*x" 10000000 loops, best of 5: 30 nsec per loop C:\Windows\System32>py -3 -m timeit -s "x=151" "x**2" 1000000 loops, best of 5: 194 nsec per loop Since the multiplication itself is cheap, overheads must account for it. Offhand, looks to me like the `x**2` spelling is actually doing 31 multiplications under the covers, although most of them are as cheap as Python-int multiplies get. for (i = Py_SIZE(b) - 1; i >= 0; --i) { digit bi = b->ob_digit[i]; for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { MULT(z, z, z); if (bi & j) MULT(z, a, z); } } Python ints on a 64-bit box are stored internally in base 2**30 (PyLong_SHIFT is 30). z starts life at 1. The first 28 trips through the loop are chewing up the 28 leading zero bits in exponent 2, so MULT(z, z, z) multiplies 1 by 1 to get 1, 28 times. Then again on the 29th iteration, but now "bi & j" is finally true (we finally found the leading one bit in exponent 2), so z is replaced by 1 times the base = the base. On the final, 30th, iteration, MULT(z, z, z) replaces z with its square, and we're done. It would probably be worthwhile to add code special-casing the leading Python "digit" of the exponent, fast-forwarding without any multiplies to the leading one bit, and setting z directly to the base then. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 14:29:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 18:29:46 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623349786.57.0.282829849738.issue44370@roundup.psfhosted.org> Serhiy Storchaka added the comment: The idea of math.ieee754_total_order looks interesting, but how would it work with min/max? In https://grouper.ieee.org/groups/msc/ANSI_IEEE-Std-754-2019/background/minNum_maxNum_Removal_Demotion_v3.pdf there is a comparison of several standards and implementations of symmetric and associative min/max. There are two options: propagate NaN and ignore it (treat it as missing data). It differs between different standards and implementations but in particular standard or implementation the same rule is used for min and max. * If ieee754_total_order(NAN) < ieee754_total_order(1), then min(1, NAN) -> NAN ("propagate") and max(1, NAN) -> 1 ("missing data"). * If ieee754_total_order(NAN) > ieee754_total_order(1), then min(1, NAN) -> 1 ("missing data") and max(1, NAN) -> NAN ("propagate"). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 14:32:52 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 10 Jun 2021 18:32:52 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623349972.82.0.776716287181.issue44362@roundup.psfhosted.org> Change by Christian Heimes : ---------- keywords: +patch nosy: +christian.heimes nosy_count: 6.0 -> 7.0 pull_requests: +25232 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26646 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:14:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 19:14:15 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623352455.39.0.135027527666.issue33962@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25233 pull_request: https://github.com/python/cpython/pull/26647 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:14:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 19:14:18 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623352458.88.0.469382394766.issue33962@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 42d5a4fc3b35e45cdd237d56a04e98894d0a31f5 by Mark Roseman in branch 'main': bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954) https://github.com/python/cpython/commit/42d5a4fc3b35e45cdd237d56a04e98894d0a31f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:14:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 19:14:19 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623352459.96.0.0834934305847.issue33962@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25234 pull_request: https://github.com/python/cpython/pull/26648 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:18:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 19:18:08 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` In-Reply-To: <1623342454.09.0.119648705367.issue44364@roundup.psfhosted.org> Message-ID: <1623352688.97.0.556051295899.issue44364@roundup.psfhosted.org> Serhiy Storchaka added the comment: >>> math.sqrt(2.5) == 2.5**0.5 True >>> math.sqrt(25.25) == 25.25**0.5 True If we test the precision of math.sqrt(), would not be better to test it with data for which naive way of calculating the root returns different result? For example 2921 is the smallest integers for which math.sqrt(x) > x**0.5, and 3541 is the smallest integers for which math.sqrt(x) < x**0.5. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:24:13 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 19:24:13 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623353053.99.0.53051076587.issue44356@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +25235 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26649 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:23:57 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 19:23:57 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623353037.22.0.549906272057.issue44356@roundup.psfhosted.org> Change by Ethan Furman : ---------- title: Abstract enum mixins not allowed -> Multiple enum mixins not allowed even when they have the same datatype _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:33:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 10 Jun 2021 19:33:06 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` In-Reply-To: <1623342454.09.0.119648705367.issue44364@roundup.psfhosted.org> Message-ID: <1623353586.89.0.546886860651.issue44364@roundup.psfhosted.org> Serhiy Storchaka added the comment: 65733 and 262694 are integers in range 1..1000000 with largest relative errors of naive square root (with different signs). 33031 and 524557 are integers in range 1..1000000 with largest relative errors of naive cube root (with different signs). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:36:27 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 19:36:27 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623353787.7.0.316219048377.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- priority: normal -> high versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:40:55 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 19:40:55 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623354055.06.0.679338758607.issue33962@roundup.psfhosted.org> miss-islington added the comment: New changeset 9b889433c7bb3ed7e2b4655f024b49d97fe412fb by Miss Islington (bot) in branch '3.9': bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954) https://github.com/python/cpython/commit/9b889433c7bb3ed7e2b4655f024b49d97fe412fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 15:41:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 10 Jun 2021 19:41:09 +0000 Subject: [issue44364] Add non integral tests for `sqrt()` In-Reply-To: <1623342454.09.0.119648705367.issue44364@roundup.psfhosted.org> Message-ID: <1623354069.6.0.696656778107.issue44364@roundup.psfhosted.org> Mark Dickinson added the comment: > 2921 is the smallest integers for which math.sqrt(x) > x**0.5 This is platform-dependent. On my machine, for example, `math.sqrt(2921) == 2921**0.5` returns `True`. I don't see a lot of value in additional tests here; we're only wrapping the libm sqrt, so we only really need enough testing to catch possible implementation errors in that wrapping. But testing only integers with an exact square root doesn't seem enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:15:13 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 20:15:13 +0000 Subject: [issue44384] test_ttk_guionly: 2 tests fail once each on Pipelines Ubuntu Message-ID: <1623356113.96.0.920783829552.issue44384@roundup.psfhosted.org> New submission from Terry J. Reedy : 3.10 Pipelines Ubuntu CI (like #42370) Each passed on 3.11 and 3.9 and all other CI tests and my machine. FIRST RUN - FAIL: test_heading_callback (tkinter.test.test_ttk.test_widgets.TreeviewTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vsts/work/1/s/Lib/tkinter/test/test_ttk/test_widgets.py", line 1548, in test_heading_callback simulate_heading_click(5, 5) File "/home/vsts/work/1/s/Lib/tkinter/test/test_ttk/test_widgets.py", line 1536, in simulate_heading_click self.assertEqual(self.tv.identify_region(x, y), 'heading') AssertionError: 'nothing' != 'heading' - nothing + heading RETEST RUN - FAIL: test_variable_change (tkinter.test.test_ttk.test_extensions.LabeledScaleTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vsts/work/1/s/Lib/tkinter/test/test_ttk/test_extensions.py", line 144, in test_variable_change self.assertGreater(x.scale.coords()[0], curr_xcoord) AssertionError: 1 not greater than 1 ---------- components: Tests, Tkinter messages: 395567 nosy: serhiy.storchaka, terry.reedy, vstinner priority: normal severity: normal stage: needs patch status: open title: test_ttk_guionly: 2 tests fail once each on Pipelines Ubuntu type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:16:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 20:16:46 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623356206.58.0.014749727835.issue33962@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 540ebc4a8874f94152980be7778f3f793b65f111 by Miss Islington (bot) in branch '3.10': bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954) https://github.com/python/cpython/commit/540ebc4a8874f94152980be7778f3f793b65f111 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:20:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 20:20:10 +0000 Subject: [issue33962] IDLE: use ttk.spinbox with configdialog In-Reply-To: <1529983748.27.0.56676864532.issue33962@psf.upfronthosting.co.za> Message-ID: <1623356410.16.0.610268208092.issue33962@roundup.psfhosted.org> Terry J. Reedy added the comment: Mark, I am not sure what last comment meant, but we generally only test IDLE with 3.x with the 8.6.y that comes with 3.x. Ned Deily sometimes runs gui tests with various tcl/tk versions and builds to select one for the installer, but he knows about whatever you said ;-). Thank you for the patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:30:56 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 20:30:56 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623357056.08.0.188708130175.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 8a4f0850d75747af8c96ca0e7eef1f5c1abfba25 by Ethan Furman in branch 'main': bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) https://github.com/python/cpython/commit/8a4f0850d75747af8c96ca0e7eef1f5c1abfba25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 20:32:15 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623357135.51.0.182958011412.issue37022@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25236 pull_request: https://github.com/python/cpython/pull/26650 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:20 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 20:32:20 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623357140.88.0.270642272974.issue37022@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25237 pull_request: https://github.com/python/cpython/pull/26651 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 20:32:12 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623357132.77.0.261544586915.issue37022@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 6544b2532df82d137b71323445a07a6e29bcdec0 by Daniel Hahler in branch 'main': bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) https://github.com/python/cpython/commit/6544b2532df82d137b71323445a07a6e29bcdec0 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:28 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 20:32:28 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623357148.59.0.233728651448.issue44356@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25238 pull_request: https://github.com/python/cpython/pull/26652 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 20:32:40 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623357160.15.0.062217761699.issue44356@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25240 pull_request: https://github.com/python/cpython/pull/26654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:32:33 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 20:32:33 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623357153.83.0.0451961039356.issue44356@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25239 pull_request: https://github.com/python/cpython/pull/26653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:36:30 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 20:36:30 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623357390.2.0.898231455941.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Thank you everyone for your help. ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:54:18 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 10 Jun 2021 20:54:18 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623358458.22.0.520175159914.issue44365@roundup.psfhosted.org> Eric V. Smith added the comment: I'm not sure directly calling __post_init__ is a good pattern. Why would not calling __init__, like you would with any other class, not be the preferred thing to do? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 16:57:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 20:57:00 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623358620.35.0.890788906943.issue37022@roundup.psfhosted.org> Irit Katriel added the comment: New changeset e3bc32fc1ad5537b476b34062b07a040533c913a by Miss Islington (bot) in branch '3.10': bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) (GH-26650) https://github.com/python/cpython/commit/e3bc32fc1ad5537b476b34062b07a040533c913a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:24:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 21:24:16 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623360256.87.0.274393213803.issue37022@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 175ebc60d52f2e88cf5cba5224c15074d2623c10 by Miss Islington (bot) in branch '3.9': bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) (GH-26651) https://github.com/python/cpython/commit/175ebc60d52f2e88cf5cba5224c15074d2623c10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:24:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 21:24:31 +0000 Subject: [issue37022] pdb: do_p and do_pp swallow exceptions from __repr__ In-Reply-To: <1558627334.31.0.41290624509.issue37022@roundup.psfhosted.org> Message-ID: <1623360271.94.0.343061518691.issue37022@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 Jun 10 17:37:21 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 10 Jun 2021 21:37:21 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623361041.24.0.353339145021.issue44370@roundup.psfhosted.org> Raymond Hettinger added the comment: We should consider biting the bullet and revising the default NaN sort order. It has been a perpetual irritant. 1) Have NaNs always compare to less than any other float value. 2) When comparing two distinct NaNs, use the NaN payload and fall back to object id if necessary. 3) When comparing two identical NaNs, always return False. That preserves the IEEE-754 guarantee that NaNs never compare equal to one another -- which is one of the few properties that people rely on. IEEE-754 doesn't concern itself at all with the notion of object identity, so giving two NaNs a deterministic but unequal ordering isn't at odds with the standard. IMHO, making min(), max(), and sorted() both deterministic and commutative is a big enough win to warrant foregoing one of the less important properties of NaN. User care about determinism and commutativity more than they care that float('NaN') > 10 and float('NaN') < 10 both return False. ?Logic clearly dictates that the needs of the many outweigh the needs of the few.? -- Spock, The Wrath of Khan ;-) Python is practical language, so we should consider making a choice based on pragmatism rather than strict standard compliance. Bug reports like this are the tip of the iceberg. Given the prevalence of NaNs being used as a placeholder for missing data, it is likely that people struggle with this every day. The original design of NaNs was to let invalid intermediate results flow through a calculation and not require error testing at every step. But in practice, NaNs are not commonly used this way. Mainly, they are used as the float equivalent of None in an array of floats. We should support this reality. IMO it is a small disaster that NaNs completely wreck sorting and do so silently. From user POV, an arcane property of NaNs is an inadequate justification for the misbehavior. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:42:26 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 10 Jun 2021 21:42:26 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar Message-ID: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> New submission from Lysandros Nikolaou : Three rules (targets, target and t_atom) in the grammar are unreachable. We were using them at some point in the past, but we never removed them when we replaced them with other rules. ---------- assignee: lys.nikolaou components: Parser messages: 395577 nosy: gvanrossum, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Some target-related rules are unreachable in the grammar type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:44:20 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 10 Jun 2021 21:44:20 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623361460.01.0.305660561752.issue44385@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- keywords: +patch pull_requests: +25241 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:50:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 10 Jun 2021 21:50:37 +0000 Subject: [issue34266] Bad behavior with "restart \" or "restart "" in pdb In-Reply-To: <1532820265.2.0.56676864532.issue34266@psf.upfronthosting.co.za> Message-ID: <1623361837.89.0.770993662029.issue34266@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 2.0 -> 3.0 pull_requests: +25242 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26656 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 17:55:43 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 21:55:43 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623362143.73.0.896526487542.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: Looking into this I think the root of the problem is the way `reduce` is handled -- currently, Enum's `__reduce_ex__` works by returning the class, and the value to use to lookup the member. Because that lookup can fail with complex enums, EnumType will sabotage `reduce` if it can't find support in the new enum class. However, if `__reduce_ex__` working by returning `getattr, (self.__class, self._name_)` then we should be fine, as that should never fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:01:12 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 22:01:12 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623362472.25.0.409735646254.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 01286017c3345e2b8a0af2bd48f6eb2087693a82 by Miss Islington (bot) in branch '3.10': bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) (GH-26653) https://github.com/python/cpython/commit/01286017c3345e2b8a0af2bd48f6eb2087693a82 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:03:36 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 22:03:36 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623362616.68.0.79218494461.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 304ec53b53021ceddf62a38e66a06aed37e2ac41 by Miss Islington (bot) in branch '3.9': bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) (GH-26652) https://github.com/python/cpython/commit/304ec53b53021ceddf62a38e66a06aed37e2ac41 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:05:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 22:05:13 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623362713.33.0.305287019021.issue44385@roundup.psfhosted.org> miss-islington added the comment: New changeset e7b4644607789848f9752a3bd20ff216e25b4156 by Lysandros Nikolaou in branch 'main': bpo-44385: Remove unused grammar rules (GH-26655) https://github.com/python/cpython/commit/e7b4644607789848f9752a3bd20ff216e25b4156 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:05:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 22:05:15 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623362715.43.0.602893896958.issue44385@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25243 pull_request: https://github.com/python/cpython/pull/26657 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:19:04 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 22:19:04 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623363544.49.0.630877056484.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +25244 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26658 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:26:44 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 10 Jun 2021 22:26:44 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623364004.48.0.443376804016.issue44385@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- pull_requests: +25245 pull_request: https://github.com/python/cpython/pull/26659 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:31:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 22:31:18 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623364278.64.0.264526682634.issue44385@roundup.psfhosted.org> miss-islington added the comment: New changeset 3e137426de3e6a37622b2ca61207b1323fdea11f by Miss Islington (bot) in branch '3.10': bpo-44385: Remove unused grammar rules (GH-26655) https://github.com/python/cpython/commit/3e137426de3e6a37622b2ca61207b1323fdea11f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:38:54 2021 From: report at bugs.python.org (Lysandros Nikolaou) Date: Thu, 10 Jun 2021 22:38:54 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623364734.01.0.927762370416.issue44385@roundup.psfhosted.org> Change by Lysandros Nikolaou : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:45:59 2021 From: report at bugs.python.org (Paul Prescod) Date: Thu, 10 Jun 2021 22:45:59 +0000 Subject: [issue44386] importlib and math.pi interact strangely Message-ID: <1623365159.13.0.132987664597.issue44386@roundup.psfhosted.org> New submission from Paul Prescod : from importlib import util mathmodule = util.find_spec("math") math1 = util.module_from_spec(mathmodule) print(math1.pi) ===== $ python3.8 /tmp/foo.py 3.141592653589793 $ python3.9 /tmp/foo.py Traceback (most recent call last): File "/tmp/foo.py", line 5, in print(math1.pi) AttributeError: module 'math' has no attribute 'pi' ---------- components: Extension Modules files: foo.py messages: 395583 nosy: prescod2 priority: normal severity: normal status: open title: importlib and math.pi interact strangely versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50101/foo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:50:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 10 Jun 2021 22:50:39 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1623365439.84.0.871238845681.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 05073036dcecefc00b0c3e7397601809da41e2f1 by Pablo Galindo in branch 'main': bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632) https://github.com/python/cpython/commit/05073036dcecefc00b0c3e7397601809da41e2f1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:52:17 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 22:52:17 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623365537.46.0.61539952463.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 62f1d2b3d7dda99598d053e10b785c463fdcf591 by Ethan Furman in branch 'main': bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658) https://github.com/python/cpython/commit/62f1d2b3d7dda99598d053e10b785c463fdcf591 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:52:26 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 22:52:26 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623365546.55.0.862150386713.issue44342@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25246 pull_request: https://github.com/python/cpython/pull/26660 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:52:56 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 10 Jun 2021 22:52:56 +0000 Subject: [issue44385] Some target-related rules are unreachable in the grammar In-Reply-To: <1623361346.78.0.306429671294.issue44385@roundup.psfhosted.org> Message-ID: <1623365576.38.0.586277070744.issue44385@roundup.psfhosted.org> miss-islington added the comment: New changeset 3ce35bfbbe29664942f9a8c50c177a4575a31934 by Lysandros Nikolaou in branch '3.9': [3.9] bpo-44385: Remove unused grammar rules (GH-26655) (GH-26659) https://github.com/python/cpython/commit/3ce35bfbbe29664942f9a8c50c177a4575a31934 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 18:59:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 10 Jun 2021 22:59:11 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623365951.12.0.845592454837.issue38323@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25247 pull_request: https://github.com/python/cpython/pull/26632 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 19:11:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 10 Jun 2021 23:11:29 +0000 Subject: [issue44379] Pickling recursion error, did not import pickle In-Reply-To: <1623339067.02.0.0636537811776.issue44379@roundup.psfhosted.org> Message-ID: <1623366689.76.0.623839765874.issue44379@roundup.psfhosted.org> Terry J. Reedy added the comment: The 'while pickling' part of the message is specific to running in IDLE, as Serhiy explained, but the recursion error itself is due to writing a program with infinite recursion. The program switches the last two items back and forth indefinitely. When run directly in Python, it gives the same error, with a different 'while' part. Violet, this tracker is for patching Python docs and the CPython interpreter. Please ask questions about program behavior elsewhere, such as python-list. ---------- assignee: terry.reedy -> resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 19:27:24 2021 From: report at bugs.python.org (Richard Mines) Date: Thu, 10 Jun 2021 23:27:24 +0000 Subject: [issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) Message-ID: <1623367644.12.0.511636948809.issue44387@roundup.psfhosted.org> New submission from Richard Mines : Documentation page: https://docs.python.org/3/library/locale.html#locale.LC_MESSAGES Code comment saying that locale.LC_MESSAGES doesn't exist sometimes: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L25-L26 Code fragment showing that locale.LC_MESSAGES can be non-existent: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L1747-L1752 Reading documentation it's not obvious that locale.LC_MESSAGES may not exist (e.g. Windows - Microsoft Store - Python 3.8) ---------- assignee: docs at python components: Documentation messages: 395588 nosy: docs at python, richardmines91 priority: normal severity: normal status: open title: Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 19:37:37 2021 From: report at bugs.python.org (Ethan Furman) Date: Thu, 10 Jun 2021 23:37:37 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623368257.99.0.605793900754.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset b613132861839b6d05b67138842b579e1af29f9c by Miss Islington (bot) in branch '3.10': bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658) (GH-26660) https://github.com/python/cpython/commit/b613132861839b6d05b67138842b579e1af29f9c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 19:59:51 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 10 Jun 2021 23:59:51 +0000 Subject: [issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) In-Reply-To: <1623367644.12.0.511636948809.issue44387@roundup.psfhosted.org> Message-ID: <1623369591.45.0.678876831356.issue44387@roundup.psfhosted.org> Jack DeVries added the comment: Could it be that _locale throws an ImportError whenever LC_MESSAGES doesn't exist? Then, there are fall-backs defined here: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L45-L85 ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 20:04:49 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 11 Jun 2021 00:04:49 +0000 Subject: [issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) In-Reply-To: <1623367644.12.0.511636948809.issue44387@roundup.psfhosted.org> Message-ID: <1623369889.83.0.0689695990189.issue44387@roundup.psfhosted.org> Jack DeVries added the comment: Follow-up: nope! My hypothesis was incorrect. This is all that _localemodule.c has to say about LC_MESSAGES: #ifdef LC_MESSAGES ADD_INT(module, LC_MESSAGES); #endif /* LC_MESSAGES */ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 20:12:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 11 Jun 2021 00:12:06 +0000 Subject: [issue44382] Python 3.9+ on Windows 8.0 In-Reply-To: <1623347633.5.0.426865894131.issue44382@roundup.psfhosted.org> Message-ID: <1623370326.38.0.146994076883.issue44382@roundup.psfhosted.org> Jack DeVries added the comment: https://buildbot.python.org/all/#/waterfall?tags=win64 Buildbot is only running against 8.1, not 8.0. I'm guessing that means that the docs are correct and python.org main page is wrong. I'd open an issue over there: https://github.com/python/pythondotorg/issues ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 20:49:53 2021 From: report at bugs.python.org (Arjun) Date: Fri, 11 Jun 2021 00:49:53 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1623372593.39.0.13727515796.issue14322@roundup.psfhosted.org> Arjun added the comment: would the update invalid test belong in the TestVectorsTestCase class or should I make a new one? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 20:59:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 11 Jun 2021 00:59:07 +0000 Subject: [issue44386] importlib and math.pi interact strangely In-Reply-To: <1623365159.13.0.132987664597.issue44386@roundup.psfhosted.org> Message-ID: <1623373147.28.0.729395600982.issue44386@roundup.psfhosted.org> Jack DeVries added the comment: That is because pi, along with other constants in the math module are defined during module execution, not module creation: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Modules/cmathmodule.c#L1257-L1262 Taking the example right here (https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported) from the docs, you can see how they call exec_module() after module_from_spec. If you change your code to do that as well, you will find that pi is now defined: ======== from importlib import util mathmodule = util.find_spec("math") math1 = util.module_from_spec(mathmodule) mathmodule.loader.exec_module(math1) print(math1.pi) ======== ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 21:54:20 2021 From: report at bugs.python.org (Hypo Turtle) Date: Fri, 11 Jun 2021 01:54:20 +0000 Subject: [issue44382] Python 3.9+ on Windows 8.0 In-Reply-To: <1623347633.5.0.426865894131.issue44382@roundup.psfhosted.org> Message-ID: <1623376460.43.0.794095687606.issue44382@roundup.psfhosted.org> Hypo Turtle added the comment: Will do; that is where I presumed the issue was/comment needed added, just hadn't located that repo. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 22:17:40 2021 From: report at bugs.python.org (Micael Jarniac) Date: Fri, 11 Jun 2021 02:17:40 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623377860.89.0.382005265925.issue44365@roundup.psfhosted.org> Micael Jarniac added the comment: Well, at least for this example, to call `super().__init__()`, I'd need to provide it the two arguments it expects, `x` and `y`, otherwise it'd give an error: > TypeError: __init__() missing 2 required positional arguments: 'x' and 'y' If I try calling it as `super().__init__(self.x, self.y)`, I get an infinite recursion error: > RecursionError: maximum recursion depth exceeded while calling a Python object That's mostly why I've chosen to call `__post_init__` instead. And if we're dealing with `InitVar`s, they can nicely be chained like so: >>> from dataclasses import dataclass, field, InitVar >>> >>> @dataclass ... class A: ... x: int ... y: InitVar[int] ... xy: int = field(init=False) ... ... def __post_init__(self, y: int) -> None: ... self.xy = self.x * y ... >>> @dataclass ... class B(A): ... m: int ... n: InitVar[int] ... mn: int = field(init=False) ... ... def __post_init__(self, y: int, n: int) -> None: ... super().__post_init__(y) ... self.mn = self.m * n ... >>> b = B(x=2, y=4, m=3, n=6) >>> b B(x=2, xy=8, m=3, mn=18) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 22:36:44 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 11 Jun 2021 02:36:44 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623379004.42.0.237513195957.issue44376@roundup.psfhosted.org> Change by Tim Peters : ---------- keywords: +patch pull_requests: +25248 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26662 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 22:52:00 2021 From: report at bugs.python.org (Tim Peters) Date: Fri, 11 Jun 2021 02:52:00 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623379920.1.0.970572766907.issue44376@roundup.psfhosted.org> Tim Peters added the comment: This is a stab at reducing overhead for small exponents, along the lines I sketched: https://github.com/python/cpython/pull/26662 Unfortunately, I've been unable to convince BPO and GitHub to recognize that the PR is related to this report. Did something basic change? Incidentally, at first this change triggered rare shutdown deaths due to negative refcounts, in the collection of small integer objects. That was a head-scratcher! Turns that was, I believe, due to a "temp = NULL" line missing from earlier code introduced to implement powers of modular inverses. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 23:57:18 2021 From: report at bugs.python.org (Jacob Walls) Date: Fri, 11 Jun 2021 03:57:18 +0000 Subject: [issue19094] urljoin should raise a TypeError if URL is not a string In-Reply-To: <1380142541.83.0.560775690833.issue19094@psf.upfronthosting.co.za> Message-ID: <1623383838.16.0.570985450419.issue19094@roundup.psfhosted.org> Jacob Walls added the comment: Hi vajrasky, do you have any interest in converting your patch to a GitHub PR? If not I can see about doing so myself. Cheers. ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 10 23:58:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 03:58:56 +0000 Subject: [issue32761] Create IDLE Modern Mac keyset In-Reply-To: <1517696660.49.0.467229070634.issue32761@psf.upfronthosting.co.za> Message-ID: <1623383936.68.0.47326309973.issue32761@roundup.psfhosted.org> Terry J. Reedy added the comment: #18444 is about revising macOS keysets and/or making a new one. This is about the latter. So closing as duplicate. ---------- resolution: -> duplicate stage: -> needs patch status: open -> closed superseder: -> IDLE: Revise Mac OS X key bindings. versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 00:02:38 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 04:02:38 +0000 Subject: [issue18444] IDLE: Revise macOS key bindings, make new one. In-Reply-To: <1373777050.16.0.963661085579.issue18444@psf.upfronthosting.co.za> Message-ID: <1623384158.78.0.714818641966.issue18444@roundup.psfhosted.org> Terry J. Reedy added the comment: I closed #32761 about new macOS keyset, in favor of this one. There is a bit more discussion there to consider. I agree that a chart of <> down side and keyset across top would be a good start. ---------- nosy: -Todd.Rovito title: IDLE: Revise Mac OS X key bindings. -> IDLE: Revise macOS key bindings, make new one. versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 00:02:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 04:02:57 +0000 Subject: [issue18444] IDLE: Revise macOS key bindings, make new one. In-Reply-To: <1373777050.16.0.963661085579.issue18444@psf.upfronthosting.co.za> Message-ID: <1623384177.1.0.433903757992.issue18444@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +macOS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 00:05:42 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 04:05:42 +0000 Subject: [issue21359] IDLE macOS: Some Command shortcuts do not work correctly In-Reply-To: <1398549164.45.0.802525173407.issue21359@psf.upfronthosting.co.za> Message-ID: <1623384342.43.0.364129766349.issue21359@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> IDLE: Revise macOS key bindings, make new one. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 00:06:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 04:06:36 +0000 Subject: [issue18444] IDLE: Revise macOS key bindings, make new one. In-Reply-To: <1373777050.16.0.963661085579.issue18444@psf.upfronthosting.co.za> Message-ID: <1623384396.12.0.900462411772.issue18444@roundup.psfhosted.org> Terry J. Reedy added the comment: I also closed #21359, which has more comment from Ned about bindings not working. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 00:10:05 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 04:10:05 +0000 Subject: [issue31930] IDLE: Pressing "Home" on Windows places cursor before ">>>" In-Reply-To: <1509660581.35.0.213398074469.issue31930@psf.upfronthosting.co.za> Message-ID: <1623384605.58.0.627980184515.issue31930@roundup.psfhosted.org> Terry J. Reedy added the comment: IDLE Classic Windows currently works correctly. A custom keyset with <> badly rebound does not. So maybe I was using the latter when I open this. Anyway, this is moot in 3.10 with prompt removed, and I intend to backpart the change. ---------- resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 01:00:48 2021 From: report at bugs.python.org (Matthew Clapp) Date: Fri, 11 Jun 2021 05:00:48 +0000 Subject: [issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior Message-ID: <1623387648.1.0.29600166507.issue44388@roundup.psfhosted.org> New submission from Matthew Clapp : The docs for the venv module, EnvBuilder class, ensure_directories method, describe behavior that doesn't match what its actual behavior is, (and what the code is). I propose to update the documentation of the API to match the actual behavior. https://docs.python.org/3.9/library/venv.html#venv.EnvBuilder.ensure_directories The last sentence for ensure_directories(env_dir) reads: The directories are allowed to exist already, as long as either clear or upgrade were specified to allow operating on an existing environment directory. After testing and looking at the code (including past commits back over 6 years), this is not true. ensure_directories completely disregards the `upgrade` attribute. Also it allows directories to exist already unconditionally (always operating without error), whether the `clear` attribute is set or not. In addition, if `clear` is not set, it doesn't make any changes to the directories, but helpfully still returns the context of venv paths. Ref: https://github.com/python/cpython/blob/3ce35bfbbe29664942f9a8c50c177a4575a31934/Lib/venv/__init__.py#L95 ---------- assignee: docs at python components: Documentation messages: 395603 nosy: docs at python, itsayellow priority: normal severity: normal status: open title: venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 01:01:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 05:01:24 +0000 Subject: [issue24781] Improve UX of IDLE Highlighting configuration tab In-Reply-To: <1438549335.27.0.888518387308.issue24781@psf.upfronthosting.co.za> Message-ID: <1623387684.0.0.432222141249.issue24781@roundup.psfhosted.org> Terry J. Reedy added the comment: Since uipreferences.py was written, in 2015, configdialog uses ttk widgets, including Notebook. We have factored out a class for each notebook pane plus one for help sources and one for traced variables. I have in mind something like highlight3.png and will look at the Listbox and Combobox code while experimenting with a couple of things. ---------- nosy: -kbk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 01:08:18 2021 From: report at bugs.python.org (Matthew Clapp) Date: Fri, 11 Jun 2021 05:08:18 +0000 Subject: [issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior In-Reply-To: <1623387648.1.0.29600166507.issue44388@roundup.psfhosted.org> Message-ID: <1623388098.4.0.756775116886.issue44388@roundup.psfhosted.org> Change by Matthew Clapp : ---------- keywords: +patch pull_requests: +25250 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26663 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 01:44:58 2021 From: report at bugs.python.org (Mike Kaganski) Date: Fri, 11 Jun 2021 05:44:58 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow In-Reply-To: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> Message-ID: <1623390298.5.0.0564914814645.issue44352@roundup.psfhosted.org> Mike Kaganski added the comment: Thank you Eryk! This is a good workaround for me. I have implemented it: https://git.libreoffice.org/core/+/3bcaa4ba79477a21251ddaa06e0ea159196a7ffb It looks like it's not a Python's problem; I suppose this may be closed. Thanks again! ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 02:41:42 2021 From: report at bugs.python.org (Mark Gordon) Date: Fri, 11 Jun 2021 06:41:42 +0000 Subject: [issue40320] Add ability to specify instance of contextvars context to Task() & asyncio.create_task() In-Reply-To: <1587223687.72.0.427454005421.issue40320@roundup.psfhosted.org> Message-ID: <1623393702.41.0.686742359683.issue40320@roundup.psfhosted.org> Change by Mark Gordon : ---------- keywords: +patch nosy: +msg555 nosy_count: 3.0 -> 4.0 pull_requests: +25251 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26664 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:16:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 07:16:03 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623395763.63.0.823305602655.issue44362@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25252 pull_request: https://github.com/python/cpython/pull/26665 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:15:58 2021 From: report at bugs.python.org (Christian Heimes) Date: Fri, 11 Jun 2021 07:15:58 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623395758.68.0.805958205033.issue44362@roundup.psfhosted.org> Christian Heimes added the comment: New changeset e26014f1c47d26d6097ff7a0f25384bfbde714a9 by Christian Heimes in branch 'main': bpo-44362: ssl: improve deprecation warnings and docs (GH-26646) https://github.com/python/cpython/commit/e26014f1c47d26d6097ff7a0f25384bfbde714a9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:21:26 2021 From: report at bugs.python.org (Richard Mines) Date: Fri, 11 Jun 2021 07:21:26 +0000 Subject: [issue44387] Not obvious that locale.LC_MESSAGES may not exist sometimes (e.g. on Windows) In-Reply-To: <1623367644.12.0.511636948809.issue44387@roundup.psfhosted.org> Message-ID: <1623396086.15.0.0381514948267.issue44387@roundup.psfhosted.org> Richard Mines added the comment: If you need a proof that it is possible that locale.LC_MESSAGES doesn't exist, I've attached a screenshot. Even more I'm showing that locale.LC_TIME may be equal to 5 which is a placeholder for locale.LC_MESSAGES if there is an ImportError: https://github.com/python/cpython/blob/62f1d2b3d7dda99598d053e10b785c463fdcf591/Lib/locale.py#L57 OS: Windows 10 20H2 Python: 3.8.10 Exact link to get python: https://www.microsoft.com/ru-ru/p/python-38/9mssztt1n39l?activetab=pivot:overviewtab ---------- Added file: https://bugs.python.org/file50102/lc_messages_not_exist.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:36:26 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 07:36:26 +0000 Subject: [issue44362] improve documentation of SSL deprecations In-Reply-To: <1623229348.31.0.791251182567.issue44362@roundup.psfhosted.org> Message-ID: <1623396986.2.0.0544885270572.issue44362@roundup.psfhosted.org> miss-islington added the comment: New changeset d7930fb720b5e9db2076b116dffcd52b6ca71438 by Miss Islington (bot) in branch '3.10': bpo-44362: ssl: improve deprecation warnings and docs (GH-26646) https://github.com/python/cpython/commit/d7930fb720b5e9db2076b116dffcd52b6ca71438 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:49:28 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 07:49:28 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623397768.88.0.979483969749.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25253 pull_request: https://github.com/python/cpython/pull/26666 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 03:52:25 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 07:52:25 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623397945.48.0.580320214065.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: Changing `__reduce_ex__` is too big a change for 3.9, so making the search for pickle support more robust there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:04:31 2021 From: report at bugs.python.org (Jordan Ephron) Date: Fri, 11 Jun 2021 08:04:31 +0000 Subject: [issue44356] Abstract enum mixins not allowed In-Reply-To: <1623339238.36.0.483930413508.issue44356@roundup.psfhosted.org> Message-ID: <20210611080210.4yhrg7nfkhych3nw@acrimony> Jordan Ephron added the comment: On 10.06.2021 15:33, Ethan Furman wrote: >Since I like puzzles, here is a working LenientStrEnum: >... Oh indeed, that's really cool! ---------- title: Multiple enum mixins not allowed even when they have the same datatype -> Abstract enum mixins not allowed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:05:22 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 08:05:22 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623398722.03.0.626611167665.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25254 pull_request: https://github.com/python/cpython/pull/26667 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:19:34 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 08:19:34 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623212429.94.0.967649002759.issue44356@roundup.psfhosted.org> Message-ID: <1623399574.55.0.828203087666.issue44356@roundup.psfhosted.org> Ethan Furman added the comment: Glad you like it! Please don't change the title back. :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: Abstract enum mixins not allowed -> Multiple enum mixins not allowed even when they have the same datatype versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:23:59 2021 From: report at bugs.python.org (Brother Beer) Date: Fri, 11 Jun 2021 08:23:59 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' Message-ID: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> New submission from Brother Beer : cpython-3.10.0b2/Modules/_ssl.c line 3576 3570 static int 3571 set_options(PySSLContext *self, PyObject *arg, void *c) 3572 { 3573 long new_opts, opts, set, clear; 3574 long opt_no = ( 3575 SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | 3576 SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_2 3577 ); 'SSL_OP_NO_TLSv1_2' is repeated, are any other items missing? ---------- files: _ssl_c_line_3576.png messages: 395612 nosy: brotherbeer priority: normal severity: normal status: open title: Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50103/_ssl_c_line_3576.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:25:30 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 08:25:30 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623399930.12.0.906326443114.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa by Ethan Furman in branch 'main': bpo-44342: [Enum] fix data type search (GH-26667) https://github.com/python/cpython/commit/3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:27:36 2021 From: report at bugs.python.org (Jordan Ephron) Date: Fri, 11 Jun 2021 08:27:36 +0000 Subject: [issue44356] Multiple enum mixins not allowed even when they have the same datatype In-Reply-To: <1623399574.55.0.828203087666.issue44356@roundup.psfhosted.org> Message-ID: <20210611082517.2pxuhmaoyliw5gvl@acrimony> Jordan Ephron added the comment: Oops, still getting used to the Python mailing list format. Learned something new! Thanks for all your awesome work on Python. On 11.06.2021 08:19, Ethan Furman wrote: > >Ethan Furman added the comment: > >Glad you like it! > >Please don't change the title back. :-) > >---------- >resolution: -> fixed >stage: patch review -> resolved >status: open -> closed >title: Abstract enum mixins not allowed -> Multiple enum mixins not allowed even when they have the same datatype >versions: -Python 3.8 > >_______________________________________ >Python tracker > >_______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:30:34 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 08:30:34 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623400234.66.0.10651490823.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: Also fixing the search for the data type so that in A -> B -> C the data type is C and not B. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:33:21 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 08:33:21 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623400401.54.0.677159811303.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Also changing error reporting to be less susceptible to DOS attacks. ---------- resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:35:44 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Jun 2021 08:35:44 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623400544.33.0.236101780487.issue44378@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 304dfec8d3c0763734ea8b5fa2af1d9e1ce69ffa by Victor Stinner in branch 'main': bpo-44378: Fix a compiler warning in Py_IS_TYPE() (GH-26644) https://github.com/python/cpython/commit/304dfec8d3c0763734ea8b5fa2af1d9e1ce69ffa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:35:47 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 08:35:47 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623400547.7.0.65847470018.issue44378@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25255 pull_request: https://github.com/python/cpython/pull/26668 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:36:18 2021 From: report at bugs.python.org (John Belmonte) Date: Fri, 11 Jun 2021 08:36:18 +0000 Subject: [issue40213] contextlib.aclosing() In-Reply-To: <1586225612.65.0.881233882976.issue40213@roundup.psfhosted.org> Message-ID: <1623400578.26.0.385942823873.issue40213@roundup.psfhosted.org> John Belmonte added the comment: merged for Python 3.10 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:43:42 2021 From: report at bugs.python.org (Brother Beer) Date: Fri, 11 Jun 2021 08:43:42 +0000 Subject: [issue44390] PC/frozen_dllmain.c, some expressions have no side effects Message-ID: <1623401022.53.0.60129097271.issue44390@roundup.psfhosted.org> New submission from Brother Beer : cpython-3.10.0b2/PC/frozen_dllmain.c, line 66 63 void PyWinFreeze_ExeInit(void) 64 { 65 char **modName; 66 for (modName = possibleModules;*modName;*modName++) { 67 /* printf("Initialising '%s'\n", *modName); */ 68 CallModuleDllMain(*modName, DLL_PROCESS_ATTACH); 69 } 70 } '*' in '*modName++' is redundant? Line 82 has the same problem 76 void PyWinFreeze_ExeTerm(void) 77 { 78 // Must go backwards 79 char **modName; 80 for (modName = possibleModules+Py_ARRAY_LENGTH(possibleModules)-2; 81 modName >= possibleModules; 82 *modName--) { 83 /* printf("Terminating '%s'\n", *modName);*/ 84 CallModuleDllMain(*modName, DLL_PROCESS_DETACH); 85 } 86 } ---------- messages: 395619 nosy: brotherbeer priority: normal severity: normal status: open title: PC/frozen_dllmain.c, some expressions have no side effects type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:49:15 2021 From: report at bugs.python.org (Brother Beer) Date: Fri, 11 Jun 2021 08:49:15 +0000 Subject: =?utf-8?q?=5Bissue44391=5D_PC/launcher=2Ec=EF=BC=8Cone_more_argument_than?= =?utf-8?q?_required?= Message-ID: <1623401355.22.0.20418176372.issue44391@roundup.psfhosted.org> New submission from Brother Beer : cpython-3.10.0b2/PC/launcher.c, line 347 One more argument than required? 345 else if (attrs & FILE_ATTRIBUTE_DIRECTORY) { 346 debug(L"locate_pythons_for_key: '%ls' is a directory\n", 347 ip->executable, attrs); 348 } ---------- messages: 395620 nosy: brotherbeer priority: normal severity: normal status: open title: PC/launcher.c?one more argument than required type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:50:11 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 11 Jun 2021 08:50:11 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623401411.47.0.376701666768.issue44370@roundup.psfhosted.org> Mark Dickinson added the comment: > We should consider biting the bullet and revising the default NaN sort order. If we went that route, I think we wouldn't need to consider payload or identity. We could just do: NaN < NaN -> False NaN < non-NaN -> True non-NaN < NaN -> False non-NaN < non-NaN -> usual numeric comparison That then satisfies the axioms for a total ordering, albeit that the implied equality isn't Python's == (and it can't be, if we're going to keep the property that NaN != NaN): all NaNs compare equal for the equality determined by the above order, and the stability of the sort means that those NaNs will retain their order relative to each other in the sorted output. Making `NaN < non-NaN` return `True` (which happens under both the proposal above and Raymond's more elaborate proposal) _would_ be a break with IEEE 754, though. There's also a somewhat arbitrary choice to be made here: do we consider NaNs to be negative or positive? That is, do we want NaNs to sort to the beginning of the list, or the end? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 04:57:37 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 08:57:37 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623401857.3.0.936128213708.issue44378@roundup.psfhosted.org> miss-islington added the comment: New changeset e6d28a1a6ad22125fc3a6df2d611d79aa8d6f67e by Miss Islington (bot) in branch '3.10': bpo-44378: Fix a compiler warning in Py_IS_TYPE() (GH-26644) https://github.com/python/cpython/commit/e6d28a1a6ad22125fc3a6df2d611d79aa8d6f67e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:01:35 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 11 Jun 2021 09:01:35 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623402095.26.0.692562901838.issue44370@roundup.psfhosted.org> Mark Dickinson added the comment: > That is, do we want NaNs to sort to the beginning of the list, or the end? FWIW, NumPy chooses to sort NaNs to the end of the list: https://numpy.org/doc/stable/reference/generated/numpy.sort.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:09:51 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 09:09:51 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623402591.6.0.449643092278.issue44242@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25256 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26669 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:10:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Jun 2021 09:10:18 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623402618.59.0.0579353124009.issue44370@roundup.psfhosted.org> Serhiy Storchaka added the comment: Maybe add two key functions for making NaN either the smallest or the largest number? min(1, NAN, key=nan_is_smallest) -> NAN max(1, NAN, key=nan_is_smallest) -> 1 sorted([1, NAN, 2], key=nan_is_smallest) -> [NAN, 1, 2] min(1, NAN, key=nan_is_largest) -> 1 max(1, NAN, key=nan_is_largest) -> NAN sorted([1, NAN, 2], key=nan_is_largest) -> [1, 2, NAN] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:18:35 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 11 Jun 2021 09:18:35 +0000 Subject: [issue44392] Py_GenericAlias is not documented Message-ID: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> New submission from Ronald Oussoren : Py_GenericAlias seems to be a public API given its name and is mention in the stable ABI list for 3.10 (https://docs.python.org/3.10/c-api/stable.html?highlight=py_genericalias), but the API is not documented. Likewise for Py_GenericAliasType. ---------- assignee: docs at python components: Documentation messages: 395625 nosy: docs at python, ronaldoussoren priority: normal severity: normal status: open title: Py_GenericAlias is not documented type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:27:01 2021 From: report at bugs.python.org (Alex Hall) Date: Fri, 11 Jun 2021 09:27:01 +0000 Subject: [issue44393] segfault with sys.setrecursionlimit Message-ID: <1623403621.34.0.625867974474.issue44393@roundup.psfhosted.org> New submission from Alex Hall : Found on: Python 3.9.5 GCC 11.1 on Linux (x86_64) Reproduced on: Python 3.9.5 Clang 9.0.8 Linux (arm) When setting the recursion limit to a high enough amount, trying to reach that recursion limit ends in a segmentation fault (stack overflow?) code: ```py import sys def recurse(n: int) -> int: recurse(n) sys.setrecursionlimit(2**16-1) recurse(1000000) ``` ---------- components: Library (Lib) files: segpy.png messages: 395626 nosy: ultrabear priority: normal severity: normal status: open title: segfault with sys.setrecursionlimit type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50104/segpy.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:32:01 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 09:32:01 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623403921.37.0.919092461637.issue38323@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25257 pull_request: https://github.com/python/cpython/pull/26670 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:44:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Jun 2021 09:44:09 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1623404649.54.0.486427903384.issue44359@roundup.psfhosted.org> STINNER Victor added the comment: Another example on PPC64LE Fedora Stable LTO 3.10: https://buildbot.python.org/all/#/builders/644/builds/98 0:00:38 load avg: 7.51 [ 78/427/1] test_ftplib failed (env changed) -- running: test_signal (39.0 sec), test_nntplib (35.2 sec) Warning -- Uncaught thread exception: Exception Exception in thread Thread-34: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asyncore.py", line 83, in read obj.handle_read_event() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asyncore.py", line 420, in handle_read_event self.handle_read() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asynchat.py", line 171, in handle_read self.found_terminator() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/test/test_ftplib.py", line 129, in found_terminator method(arg) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/test/test_ftplib.py", line 154, in cmd_pasv conn, addr = sock.accept() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/socket.py", line 293, in accept fd, addr = self._accept() TimeoutError: timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/threading.py", line 1006, in _bootstrap_inner self.run() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/test/test_ftplib.py", line 292, in run asyncore.loop(timeout=0.1, count=1) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asyncore.py", line 207, in loop poll_fun(timeout, map) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asyncore.py", line 150, in poll read(obj) File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/asyncore.py", line 87, in read obj.handle_error() File "/home/buildbot/buildarea/3.10.cstratak-fedora-stable-ppc64le.lto/build/Lib/test/test_ftplib.py", line 134, in handle_error raise Exception Exception ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:44:53 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 09:44:53 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623404693.21.0.235822924455.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: New changeset c956734d7af83ad31f847d31d0d26df087add9a4 by Ethan Furman in branch 'main': bpo-44242: [Enum] improve error messages (GH-26669) https://github.com/python/cpython/commit/c956734d7af83ad31f847d31d0d26df087add9a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:44:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Jun 2021 09:44:59 +0000 Subject: =?utf-8?b?W2lzc3VlNDQzNzhdIFB5X0lTX1RZUEUoKTogY2FzdCBkaXNjYXJkcyDigJhj?= =?utf-8?q?onst=E2=80=99_qualifier_from_pointer_target_type?= In-Reply-To: <1623331194.1.0.529436211827.issue44378@roundup.psfhosted.org> Message-ID: <1623404699.76.0.377841563073.issue44378@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:45:02 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 09:45:02 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623404702.81.0.119813174543.issue44242@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25258 pull_request: https://github.com/python/cpython/pull/26671 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 05:59:07 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 11 Jun 2021 09:59:07 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623405547.57.0.350063652808.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 0a186b1ec1fd094d825f08a4eb39fa83ef57067a by Miss Islington (bot) in branch '3.10': bpo-44242: [Enum] improve error messages (GH-26669) https://github.com/python/cpython/commit/0a186b1ec1fd094d825f08a4eb39fa83ef57067a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 06:30:05 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 11 Jun 2021 10:30:05 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623407405.92.0.237068873507.issue44392@roundup.psfhosted.org> Ken Jin added the comment: Ronald, may I take this please? Or are you working on something already? ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 06:47:33 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 11 Jun 2021 10:47:33 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1623408453.78.0.999230285466.issue44359@roundup.psfhosted.org> Change by Senthil Kumaran : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 06:49:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Jun 2021 10:49:11 +0000 Subject: [issue19094] urljoin should raise a TypeError if URL is not a string In-Reply-To: <1380142541.83.0.560775690833.issue19094@psf.upfronthosting.co.za> Message-ID: <1623408551.12.0.837606708767.issue19094@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 07:10:39 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 11 Jun 2021 11:10:39 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow In-Reply-To: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> Message-ID: <1623409839.91.0.903624715927.issue44352@roundup.psfhosted.org> Eryk Sun added the comment: Note that this explanation in your commit is wrong and unhelpful: "likely because datetime.datetime.now in the native Windows Python takes into account both system timezone data and the TZ environment variable". When TZ is set, localtime() is based only on the TZ value, and daylight saving time uses only U.S. rules (e.g. beginning 2021-03-14 and ending 2021-11-07). The value must be of the form "tzn [+|-]hh[:mm[:ss] ][dzn]", but there is no validation. So "Europe/Moscow" is invalid and gets parsed as UTC with U.S. DST. I recommend clearing the TZ variable because the value format is non-standard, and its DST support is U.S.-centric nonsense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 09:16:35 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 11 Jun 2021 13:16:35 +0000 Subject: [issue44393] segfault with sys.setrecursionlimit In-Reply-To: <1623403621.34.0.625867974474.issue44393@roundup.psfhosted.org> Message-ID: <1623417395.83.0.240694142276.issue44393@roundup.psfhosted.org> Eric V. Smith added the comment: That's the documented behavior: "A user may need to set the limit higher when they have a program that requires deep recursion and a platform that supports a higher limit. This should be done with care, because a too-high limit can lead to a crash." https://docs.python.org/3.8/library/sys.html#sys.setrecursionlimit Also, please don't post images. Copy and paste the text instead. Images aren't friendly to visually impaired people, and they can't be copy and pasted. ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 09:19:47 2021 From: report at bugs.python.org (Mike Kaganski) Date: Fri, 11 Jun 2021 13:19:47 +0000 Subject: [issue44352] Native Windows Python builds running on Europe/Moscow TZ report wrong time from datetime.datetime.now when there is TZ environment variable also set to Europe/Moscow In-Reply-To: <1623179121.82.0.0104763138056.issue44352@roundup.psfhosted.org> Message-ID: <1623417587.04.0.118788242768.issue44352@roundup.psfhosted.org> Mike Kaganski added the comment: @Eryk Sun: yes, of course you are right - but please see the date of the commit; I didn't know what you kindly explained me in your reply yesterday :-) Thank you again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 09:48:18 2021 From: report at bugs.python.org (Kyle Altendorf) Date: Fri, 11 Jun 2021 13:48:18 +0000 Subject: [issue32219] SSLWantWriteError being raised by blocking SSL socket In-Reply-To: <1512446468.03.0.213398074469.issue32219@psf.upfronthosting.co.za> Message-ID: <1623419298.15.0.307626355852.issue32219@roundup.psfhosted.org> Change by Kyle Altendorf : ---------- nosy: +altendky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 10:14:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Jun 2021 14:14:07 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Updated to vendoed copy to expat 2.4.1 Message-ID: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> New submission from STINNER Victor : Our vendored copy of Modules/expat/ should be updated to Expat 2.4.1 to retrieve the fix for the security vulnerabily CVE-2013-0340 "Billion Laughs": https://blog.hartwork.org/posts/cve-2013-0340-billion-laughs-fixed-in-expat-2-4-0/ The table of vulnerabilities in Python XML parsers should be updated as well: https://docs.python.org/dev/library/xml.html#xml-vulnerabilities My outdated notes on Modules/expat/: copy of libexpat * ./configure --with-system-expat * Rationale: https://mail.python.org/pipermail/python-dev/2017-June/148287.html * Used on Windows and macOS, Linux distributions use system libexpat * Version: search for XML_MAJOR_VERSION in Modules/expat/expat.h * Script to update it: see attached script to https://bugs.python.org/issue30947 * Recent update: https://bugs.python.org/issue30947 * Python 2.7, 3.3-3.6 use libexpat 2.2.1 https://pythondev.readthedocs.io/files.html ---------- components: Extension Modules messages: 395634 nosy: vstinner priority: normal severity: normal status: open title: [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Updated to vendoed copy to expat 2.4.1 type: security 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 Jun 11 10:15:26 2021 From: report at bugs.python.org (Konstantin Ryabitsev) Date: Fri, 11 Jun 2021 14:15:26 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom Message-ID: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> New submission from Konstantin Ryabitsev : When using as_string(unixfrom=True), the "From " line is not always printed. The behaviour is correct for as_bytes(). Test case: ---- import email.message msg = email.message.EmailMessage() msg.set_payload('Hello World\n') msg.set_unixfrom('From foo at bar Thu Jan 1 00:00:00 1970') msg['Subject'] = 'Hello' msg['From'] = 'Me ' print('as_string:') print(msg.as_string(unixfrom=True)) print('as_bytes:') print(msg.as_bytes(unixfrom=True).decode()) ---- Results (3.5 and 3.9): as_string: Subject: Hello From: Me Hello World as_bytes: >From foo at bar Thu Jan 1 00:00:00 1970 Subject: Hello From: Me Hello World ---------- components: email messages: 395635 nosy: barry, konstantin2, r.david.murray priority: normal severity: normal status: open title: email.message as_string() not writing unixfrom versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 10:26:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 11 Jun 2021 14:26:46 +0000 Subject: [issue18767] csv documentation does not note default quote constant In-Reply-To: <1376706253.43.0.482794872786.issue18767@psf.upfronthosting.co.za> Message-ID: <1623421606.0.0.181171445244.issue18767@roundup.psfhosted.org> Andrei Kulakov added the comment: The docs do say that now: .. attribute:: Dialect.quoting Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the :const:`QUOTE_\*` constants (see section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`. .. so this issue can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 10:39:45 2021 From: report at bugs.python.org (alessandro mantovani) Date: Fri, 11 Jun 2021 14:39:45 +0000 Subject: [issue44396] Use-After-Free Message-ID: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> New submission from alessandro mantovani : Use After Free in python3.11 (commit 2ab27c4af4ddf752) Steps to reproduce: 1) ./configure --with-address-sanitizer 2) make 3) ./python I attach some of the input that lead to the undefined behavior For the complete description you can find the asan report here: ==1082579==ERROR: AddressSanitizer: heap-use-after-free on address 0x626000045a40 at pc 0x000000735155 bp 0x7fffffffbed0 sp 0x7fffffffbec8 READ of size 8 at 0x626000045a40 thread T0 #0 0x735154 in ascii_decode /home/elmanto/ddg/other_targets/cpython/Objects/unicodeobject.c:5091:28 #1 0x735154 in unicode_decode_utf8 /home/elmanto/ddg/other_targets/cpython/Objects/unicodeobject.c:5158:10 #2 0xc98381 in syntaxerror /home/elmanto/ddg/other_targets/cpython/Parser/tokenizer.c:1087:15 #3 0xc8d616 in tok_get /home/elmanto/ddg/other_targets/cpython/Parser/tokenizer.c #4 0xc8696b in PyTokenizer_Get /home/elmanto/ddg/other_targets/cpython/Parser/tokenizer.c:1884:18 #5 0xead74c in _PyPegen_check_tokenizer_errors /home/elmanto/ddg/other_targets/cpython/Parser/pegen.c:1260:17 #6 0xead74c in _PyPegen_run_parser /home/elmanto/ddg/other_targets/cpython/Parser/pegen.c:1292:17 #7 0xeaebca in _PyPegen_run_parser_from_file_pointer /home/elmanto/ddg/other_targets/cpython/Parser/pegen.c:1377:14 #8 0xc83a91 in _PyParser_ASTFromFile /home/elmanto/ddg/other_targets/cpython/Parser/peg_api.c:26:12 #9 0xa0abf1 in pyrun_file /home/elmanto/ddg/other_targets/cpython/Python/pythonrun.c:1197:11 #10 0xa0abf1 in _PyRun_SimpleFileObject /home/elmanto/ddg/other_targets/cpython/Python/pythonrun.c:455:13 #11 0xa09b19 in _PyRun_AnyFileObject /home/elmanto/ddg/other_targets/cpython/Python/pythonrun.c:89:15 #12 0x4dfe94 in pymain_run_file_obj /home/elmanto/ddg/other_targets/cpython/Modules/main.c:353:15 #13 0x4dfe94 in pymain_run_file /home/elmanto/ddg/other_targets/cpython/Modules/main.c:372:15 #14 0x4dfe94 in pymain_run_python /home/elmanto/ddg/other_targets/cpython/Modules/main.c:587:21 #15 0x4dfe94 in Py_RunMain /home/elmanto/ddg/other_targets/cpython/Modules/main.c:666:5 #16 0x4e154c in pymain_main /home/elmanto/ddg/other_targets/cpython/Modules/main.c:696:12 #17 0x4e1874 in Py_BytesMain /home/elmanto/ddg/other_targets/cpython/Modules/main.c:720:12 #18 0x7ffff7a2e0b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #19 0x43501d in _start (/home/elmanto/ddg/other_targets/cpython/python+0x43501d) 0x626000045a40 is located 2368 bytes inside of 10560-byte region [0x626000045100,0x626000047a40) freed by thread T0 here: #0 0x4ada79 in realloc (/home/elmanto/ddg/other_targets/cpython/python+0x4ada79) #1 0x638e61 in PyMem_RawRealloc /home/elmanto/ddg/other_targets/cpython/Objects/obmalloc.c:602:12 #2 0x638e61 in _PyObject_Realloc /home/elmanto/ddg/other_targets/cpython/Objects/obmalloc.c:2339:12 previously allocated by thread T0 here: #0 0x4ada79 in realloc (/home/elmanto/ddg/other_targets/cpython/python+0x4ada79) #1 0x638e61 in PyMem_RawRealloc /home/elmanto/ddg/other_targets/cpython/Objects/obmalloc.c:602:12 #2 0x638e61 in _PyObject_Realloc /home/elmanto/ddg/other_targets/cpython/Objects/obmalloc.c:2339:12 SUMMARY: AddressSanitizer: heap-use-after-free /home/elmanto/ddg/other_targets/cpython/Objects/unicodeobject.c:5091:28 in ascii_decode Shadow bytes around the buggy address: 0x0c4c80000af0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c4c80000b40: fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd 0x0c4c80000b50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c4c80000b90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==1082579==ABORTING ---------- components: C API files: crashes.tgz messages: 395637 nosy: elmanto priority: normal severity: normal status: open title: Use-After-Free type: security versions: Python 3.11 Added file: https://bugs.python.org/file50105/crashes.tgz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:08:13 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 15:08:13 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623424093.15.0.764550734888.issue44351@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25259 pull_request: https://github.com/python/cpython/pull/26673 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:08:20 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 11 Jun 2021 15:08:20 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623424100.07.0.342860383196.issue44351@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset fc98266ff627ba0f56f8ae241245b66bc983baa3 by Lum?r 'Frenzy' Balhar in branch 'main': bpo-44351: Restore back parse_makefile in distutils.sysconfig (GH-26637) https://github.com/python/cpython/commit/fc98266ff627ba0f56f8ae241245b66bc983baa3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:10:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 11 Jun 2021 15:10:17 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623424217.28.0.672572728057.issue44396@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +gvanrossum, lys.nikolaou, pablogsal title: Use-After-Free -> pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:18:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Jun 2021 15:18:04 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623424684.45.0.361081880381.issue43318@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 4cb6ba14325cff98589c2660d1d2c65f4aacfee4 by huzhaojie in branch 'main': bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) https://github.com/python/cpython/commit/4cb6ba14325cff98589c2660d1d2c65f4aacfee4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:18:06 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 15:18:06 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623424686.35.0.172013632404.issue43318@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25260 pull_request: https://github.com/python/cpython/pull/26674 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:18:11 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 15:18:11 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623424691.73.0.511612621071.issue43318@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25261 pull_request: https://github.com/python/cpython/pull/26675 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:18:53 2021 From: report at bugs.python.org (Ajith Ramachandran) Date: Fri, 11 Jun 2021 15:18:53 +0000 Subject: [issue44397] Add Linked Linked module Message-ID: <1623424733.17.0.137913731614.issue44397@roundup.psfhosted.org> New submission from Ajith Ramachandran : There is a module present for queue which can also be used for a stack like LIFO structure. But there is none for linked list. ---------- components: Library (Lib) messages: 395640 nosy: AjithRamachandran priority: normal severity: normal status: open title: Add Linked Linked module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:44:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 11 Jun 2021 15:44:02 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623426242.85.0.455550359451.issue44396@roundup.psfhosted.org> Guido van Rossum added the comment: Lysandros and Pablo, this *only* occurs when the lexer is reading directly from a file, not when it's reading the same source code from a (bytes) string. All examples are syntax errors (some raise ValueError in the parser). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:46:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 11 Jun 2021 15:46:25 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Updated to vendoed copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1623426385.14.0.406624000681.issue44394@roundup.psfhosted.org> Guido van Rossum added the comment: (From PSRT list, Sebastian:) Please note that the vulnerability fix also added two new functions to the API that would be great to have xml.parsers.expat expose to the users for full control. These are: - XML_SetBillionLaughsAttackProtectionMaximumAmplification and - XML_SetBillionLaughsAttackProtectionActivationThreshold Module xml.parsers.expat.errors and its docs also needs 6 new error code entries to be complete: /* Added in 2.0. */ 38 XML_ERROR_RESERVED_PREFIX_XML 39 XML_ERROR_RESERVED_PREFIX_XMLNS 40 XML_ERROR_RESERVED_NAMESPACE_URI /* Added in 2.2.1. */ 41 XML_ERROR_INVALID_ARGUMENT /* Added in 2.3.0. */ 42 XML_ERROR_NO_BUFFER /* Added in 2.4.0. */ 43 XML_ERROR_AMPLIFICATION_LIMIT_BREACH With regard to the table of vulnerabilities mentioned in the ticket, please note that vulnerability "quadratic blowup" is also fixed by >=2.4.0. Personally, I consider it a flavor of Billion Laughs and all know variations are covered, including that one. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 11:51:46 2021 From: report at bugs.python.org (realead) Date: Fri, 11 Jun 2021 15:51:46 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623426706.27.0.21663907392.issue43475@roundup.psfhosted.org> realead added the comment: This change makes life harder for people trying to get sane behavior with sets for float-, complex- and tuple-objects containing NaNs. With "sane" meaning, that set([nan, nan, nan]) => {nan} Until now, one has only to override the equal-comparison for these types but now also hash-function needs to be overriden (which is more complicated e.g. for tuple). ---------------------------------------------------------------- On a more abstract level: there are multiple possible equivalence relations. The one used right now for floats is Py_EQ and results in float("nan)!=float("nan") due to IEEE 754. In hash-set/dict we would like to use an equivalence relation for which all NaNs would be in the same equivalence class. Maybe a new comparator is called for (like PY_EQ_FOR_HASH_COLLECTION), which would yield float("nan") equivalent to float("nan") and which should be used in hash-set/dict? ---------- nosy: +realead _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:17:34 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 11 Jun 2021 16:17:34 +0000 Subject: [issue42516] Add function to get caller's name In-Reply-To: <1606773286.82.0.837636543351.issue42516@roundup.psfhosted.org> Message-ID: <1623428254.55.0.516712967321.issue42516@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:18:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Jun 2021 16:18:27 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623428307.19.0.632404396485.issue43318@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 9c0180ae7761b352116a2528aae61eea10e31045 by Miss Islington (bot) in branch '3.10': bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) (GH-26674) https://github.com/python/cpython/commit/9c0180ae7761b352116a2528aae61eea10e31045 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:18:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Jun 2021 16:18:52 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623428332.83.0.887730602314.issue43318@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 6df926f1c46eb6db7b5dcd0227c6b532c78525c9 by Miss Islington (bot) in branch '3.9': bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) (GH-26675) https://github.com/python/cpython/commit/6df926f1c46eb6db7b5dcd0227c6b532c78525c9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:19:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 11 Jun 2021 16:19:12 +0000 Subject: [issue43318] pdb does not output the prompt message when successfully clear breakpoints by "filename:lineno" In-Reply-To: <1614240670.83.0.613464478845.issue43318@roundup.psfhosted.org> Message-ID: <1623428352.17.0.723455612143.issue43318@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 Jun 11 12:46:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 16:46:26 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623429986.77.0.583158883613.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Here is a smaller reproducer: x = "ijosdfsd\ def blech(): pass This seems to be an error with: commit a698d52c3975c80b45b139b2f08402ec514dce75 Author: Batuhan Taskaya Date: Thu Jan 21 00:38:47 2021 +0300 bpo-40176: Improve error messages for unclosed string literals (GH-19346) Automerge-Triggered-By: GH:isidentical Batuhan, can you take a look? ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:54:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 16:54:50 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623430490.39.0.149382539908.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I think this should fix the issue, but someone should validate this: diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 6002f3e05a..1c28737183 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1084,17 +1084,16 @@ syntaxerror(struct tok_state *tok, const char *format, ...) goto error; } - errtext = PyUnicode_DecodeUTF8(tok->line_start, tok->cur - tok->line_start, + errtext = PyUnicode_DecodeUTF8(tok->buf, tok->inp - tok->buf, "replace"); if (!errtext) { goto error; } int offset = (int)PyUnicode_GET_LENGTH(errtext); - Py_ssize_t line_len = strcspn(tok->line_start, "\n"); - if (line_len != tok->cur - tok->line_start) { + Py_ssize_t line_len = strcspn(tok->buf, "\n"); + if (line_len != tok->buf - tok->inp) { Py_DECREF(errtext); - errtext = PyUnicode_DecodeUTF8(tok->line_start, line_len, - "replace"); + errtext = PyUnicode_DecodeUTF8(tok->buf, line_len, "replace"); } if (!errtext) { goto error; ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:58:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 16:58:32 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623430712.03.0.924508699017.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This affects 3.10 as well ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 12:58:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 16:58:59 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623430739.87.0.170175691774.issue44396@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:03:52 2021 From: report at bugs.python.org (sping) Date: Fri, 11 Jun 2021 17:03:52 +0000 Subject: [issue44394] [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Updated to vendoed copy to expat 2.4.1 In-Reply-To: <1623420847.27.0.469352206791.issue44394@roundup.psfhosted.org> Message-ID: <1623431032.55.0.985481156208.issue44394@roundup.psfhosted.org> sping added the comment: FTR that^^ Sebastian is me :) ---------- nosy: +sping _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:14:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 11 Jun 2021 17:14:41 +0000 Subject: [issue44397] Add Linked Linked module In-Reply-To: <1623424733.17.0.137913731614.issue44397@roundup.psfhosted.org> Message-ID: <1623431681.49.0.831935817205.issue44397@roundup.psfhosted.org> Dennis Sweeney added the comment: This issue is probably a duplicate of https://bugs.python.org/issue42575 . In almost all use cases, a linked list can be replaced by a collections.deque, which already uses a double linked list of blocks internally. Is there something you need a linked list to do that you can't do already with a deque? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:15:01 2021 From: report at bugs.python.org (sping) Date: Fri, 11 Jun 2021 17:15:01 +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: <1623431701.26.0.13041912257.issue44394@roundup.psfhosted.org> Change by sping : ---------- title: [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Updated to vendoed copy to expat 2.4.1 -> [security] CVE-2013-0340 "Billion Laughs" fixed in Expat >=2.4.0: Update vendored copy to expat 2.4.1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:18:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 17:18:12 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623431892.96.0.567468028385.issue44396@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25262 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26676 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:18:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 11 Jun 2021 17:18:30 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623431910.08.0.530408511905.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ok, found the problem, we are not resetting the multi-line-start pointer when we are reallocating the tokenizer buffers. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:23:43 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 11 Jun 2021 17:23:43 +0000 Subject: [issue44397] Add Linked Linked module In-Reply-To: <1623424733.17.0.137913731614.issue44397@roundup.psfhosted.org> Message-ID: <1623432223.96.0.750617766655.issue44397@roundup.psfhosted.org> Jelle Zijlstra added the comment: Closing as a duplicate of issue42575. Adding a linked list data structure to Python is in any case probably better discussed on the python-ideas mailing list and then in a PEP. ---------- nosy: +Jelle Zijlstra resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 13:43:04 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 11 Jun 2021 17:43:04 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports In-Reply-To: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> Message-ID: <1623433384.8.0.794483737525.issue44313@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +25263 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26677 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:17:40 2021 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 11 Jun 2021 18:17:40 +0000 Subject: [issue42044] Running Python in unbuffered mode may not write all contents to the console In-Reply-To: <1602768124.79.0.2669254941.issue42044@roundup.psfhosted.org> Message-ID: <1623435460.97.0.455678226808.issue42044@roundup.psfhosted.org> Change by Fabio Zadrozny : ---------- keywords: +patch pull_requests: +25264 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26678 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:21:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Jun 2021 18:21:29 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623435689.74.0.258731493559.issue43475@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is an error in the Python implementation of Decimal.__hash__. It calls super().__hash__(), but the C implementation calls object.__hash__(). Also, the documentation for floating point hash has the same error. ---------- stage: resolved -> status: closed -> open versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:22:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 11 Jun 2021 18:22:19 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623435739.43.0.942656177591.issue43475@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25265 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26679 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:26:14 2021 From: report at bugs.python.org (Fabio Zadrozny) Date: Fri, 11 Jun 2021 18:26:14 +0000 Subject: [issue42044] Running Python in unbuffered mode may not write all contents to the console In-Reply-To: <1602768124.79.0.2669254941.issue42044@roundup.psfhosted.org> Message-ID: <1623435974.87.0.953628166951.issue42044@roundup.psfhosted.org> Fabio Zadrozny added the comment: Seems fair. I just did a pull request to remove those limits. Please let me know if you think something else is needed there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:26:50 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Jun 2021 18:26:50 +0000 Subject: [issue44372] Can't install Python3.8, 3.9, 3.10 various errors including 0x80070643 In-Reply-To: <1623310130.37.0.4237956149.issue44372@roundup.psfhosted.org> Message-ID: <1623436010.91.0.734174721886.issue44372@roundup.psfhosted.org> Steve Dower added the comment: Sorry, you've reported a range of issues here and it's not clear what the problem is. Many many people (literally millions) have successfully installed Python on Windows with these installers, and even more (including most Microsoft products) use the installer toolkit that we use. Fundamentally, it works correctly. Most issues are due to problems or configuration settings on the target machine. The installer file registration is handled by Windows, and is not ours to manage. If the OS is choosing to leave them there after removing the files, you'll have to report it to them. Perhaps you could reproduce the issue, and then send all the Python log files from your %TEMP% directory? That should show us why your install is failing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 14:43:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 11 Jun 2021 18:43:20 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623437000.59.0.929385155827.issue44389@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch nosy: +erlendaasland nosy_count: 1.0 -> 2.0 pull_requests: +25266 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26680 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:01:34 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 11 Jun 2021 19:01:34 +0000 Subject: [issue44340] Add support for building cpython with clang thin lto In-Reply-To: <1623105491.02.0.949113840673.issue44340@roundup.psfhosted.org> Message-ID: <1623438094.61.0.961476308754.issue44340@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:06:36 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 11 Jun 2021 19:06:36 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1623438396.07.0.195025159569.issue44395@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:32:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 11 Jun 2021 19:32:59 +0000 Subject: [issue32275] SSL socket methods don't retry on EINTR? In-Reply-To: <1512989105.2.0.213398074469.issue32275@psf.upfronthosting.co.za> Message-ID: <1623439979.07.0.683114643148.issue32275@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:36:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 19:36:15 +0000 Subject: [issue44398] IDLE: On macOS, cntl-space/backslash display as ^S/^B Message-ID: <1623440174.98.0.65068433782.issue44398@roundup.psfhosted.org> New submission from Terry J. Reedy : (Related to the more general macOS hotkey issue 18444.) 'Edit => Show completions' invokes pseudoevent <>. In all built-in keysets, the latter is bound to Control-space. This includes on macOS, as can be seen on the Settings Keys tab. On Windows, and I presume *nix, this is displayed on the menu as 'Cntl+space'. On macOS, the menu hotkeys are displayed differently than on other systems (how?). 'Cntl+' is condensed to '^', which is fine and which would be okay elsewhere. However, 'space' is condensed to 'S', which is a bug. Can this be fixed? If not, we could add ^S as an alternate hotkey on macOS. '^S' causes 'Edit' to flash, indicating, I believe, that it is recognized as an Edit menu hotkey. But nothing happens as IDLE/tk does not recognize it on macOS. (On Windows, it means 'save'.) ^space, currently works to show completions with 3.10.0b2. The same will be true after the PR for #40128 is merged and backported. The situation is the same for Edit => Show calltip, <>, and control-backslash, except that 'backslash' is visible as '\'. If the hotkey were displayed on Windows as 'Cntl+\', perhaps the result on macOS would be the correct '^\'. ---------- assignee: terry.reedy components: IDLE, macOS messages: 395656 nosy: ned.deily, ronaldoussoren, taleinat, terry.reedy priority: normal severity: normal stage: needs patch status: open title: IDLE: On macOS, cntl-space/backslash display as ^S/^B type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:37:22 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 19:37:22 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623440242.63.0.604435241434.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: With 3.10.0b2 on my MacBook Air, completions work as far as I tested, with Edit => Show completions, Tab, and ^-Space. i i<^-Space> int.(configered pause) int.<^-Space, after dismissing box with Esc key> 3.9.5, without the patch, remains buggy. I attribute the difference to using tcl/tk 8.6.11 in 3.10 versus 8.6.8 in 3.9 (and 3.8 and worse previously). 3.9.5, with the patch, the above work. I will apply the patch in main and then backport because other Mac installers may have not switched to 8.6.11, I am not sure it never helps with 8.6.11, I prefer to keep active versions in sync, and it should not hurt except for a micro slowdown. I opened #44398 for the hotkey issue. ---------- stage: -> patch review versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:39:08 2021 From: report at bugs.python.org (Kaustubh J) Date: Fri, 11 Jun 2021 19:39:08 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623440348.08.0.208318339565.issue40128@roundup.psfhosted.org> Change by Kaustubh J : ---------- keywords: +patch nosy: +thsubaku9 nosy_count: 5.0 -> 6.0 pull_requests: +25267 pull_request: https://github.com/python/cpython/pull/26672 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:50:16 2021 From: report at bugs.python.org (mori-b) Date: Fri, 11 Jun 2021 19:50:16 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space Message-ID: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> New submission from mori-b : In https://docs.python.org/3/howto/logging-cookbook.html#using-a-rotator-and-namer-to-customize-log-rotation-processing, the log rotator example deletes the original log file after compressing it. However, running on Linux the command "lsof +S1" shows that the deleted original log file might still hold the same disk space, and keep growing. Replacing the command "os.remove(source)" with "os.truncate(source,0)" seems to solve the issue by freeing the original log file disk space at each rotation. ---------- assignee: docs at python components: Documentation messages: 395658 nosy: docs at python, mori-b priority: normal severity: normal status: open title: log rotator cookbook example might waste disk space type: resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 15:59:50 2021 From: report at bugs.python.org (mori-b) Date: Fri, 11 Jun 2021 19:59:50 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623441590.93.0.721381203981.issue44399@roundup.psfhosted.org> mori-b added the comment: In https://docs.python.org/3/howto/logging-cookbook.html#using-a-rotator-and-namer-to-customize-log-rotation-processing, the log rotator example deletes the original log file after compressing it. However, running on Linux the command "lsof +L1" shows that the deleted original log file might still hold the same disk space, and keep growing. Replacing the command "os.remove(source)" with "os.truncate(source,0)" seems to solve the issue by freeing the original log file disk space at each rotation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 16:25:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 20:25:10 +0000 Subject: [issue44398] IDLE: On macOS, cntl-space/backslash display as ^S/^B In-Reply-To: <1623440174.98.0.65068433782.issue44398@roundup.psfhosted.org> Message-ID: <1623443110.73.0.923710354959.issue44398@roundup.psfhosted.org> Terry J. Reedy added the comment: ^B would work as an alternate binding for <> as it is not used otherwise, but I prefer not to have to do this. These are the only named keys other than the 'F#'s. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 16:35:48 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Jun 2021 20:35:48 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623443748.04.0.904143250108.issue44381@roundup.psfhosted.org> Steve Dower added the comment: New changeset 5af56c6f2a0d11df37fed7ecaaf321cf6926ba13 by Steve Dower in branch 'main': bpo-44381: Windows build now allows enabling control flow guard (GH-26645) https://github.com/python/cpython/commit/5af56c6f2a0d11df37fed7ecaaf321cf6926ba13 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 16:35:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 20:35:57 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623443757.82.0.0782419282432.issue44381@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25268 pull_request: https://github.com/python/cpython/pull/26681 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 16:36:03 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 20:36:03 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623443763.78.0.773540861063.issue44381@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25269 pull_request: https://github.com/python/cpython/pull/26682 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 17:11:55 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 11 Jun 2021 21:11:55 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623445915.99.0.402445741973.issue38323@roundup.psfhosted.org> Change by Jack DeVries : ---------- nosy: +jack__d nosy_count: 10.0 -> 11.0 pull_requests: +25270 pull_request: https://github.com/python/cpython/pull/26643 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 17:17:14 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Jun 2021 21:17:14 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623446234.51.0.79250775484.issue44381@roundup.psfhosted.org> Steve Dower added the comment: New changeset 9580d3894ad158ae909e7573a02dcd087de0b673 by Miss Islington (bot) in branch '3.9': bpo-44381: Windows build now allows enabling control flow guard (GH-26645) https://github.com/python/cpython/commit/9580d3894ad158ae909e7573a02dcd087de0b673 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 17:21:18 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 21:21:18 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623446478.96.0.932714496467.issue44381@roundup.psfhosted.org> miss-islington added the comment: New changeset 42612db10792dd069149063f67a3b1db700bc7ee by Miss Islington (bot) in branch '3.10': bpo-44381: Windows build now allows enabling control flow guard (GH-26645) https://github.com/python/cpython/commit/42612db10792dd069149063f67a3b1db700bc7ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 17:39:25 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Jun 2021 21:39:25 +0000 Subject: [issue44381] Allow enabling control flow guard in Windows build In-Reply-To: <1623344835.21.0.813448023937.issue44381@roundup.psfhosted.org> Message-ID: <1623447565.56.0.806775958225.issue44381@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 Jun 11 17:59:01 2021 From: report at bugs.python.org (mori-b) Date: Fri, 11 Jun 2021 21:59:01 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623448741.95.0.977793920726.issue44399@roundup.psfhosted.org> mori-b added the comment: Additional precision : this issue can happen when the log file is shared between multiple threads. And naturally also between different processes, which is not recommended but can happen by mistake. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 18:03:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 22:03:21 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623449001.26.0.985783901886.issue41299@roundup.psfhosted.org> miss-islington added the comment: New changeset 57b3ca7f0aef4d180038d475398f809d3fcdd8be by Miss Islington (bot) in branch '3.9': bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision time source (GH-26568) https://github.com/python/cpython/commit/57b3ca7f0aef4d180038d475398f809d3fcdd8be ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 18:13:01 2021 From: report at bugs.python.org (Steve Dower) Date: Fri, 11 Jun 2021 22:13:01 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1623449581.46.0.952955250784.issue43298@roundup.psfhosted.org> Steve Dower added the comment: Jason - I think your -add and -remove options need work. I'm pretty sure the AzureBuildTools component doesn't bring in the C++ compilers or the WinSDK. If you configure it manually and interactively, you should be able to export a JSON configuration and then you can use that later to recreate the install elsewhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 18:55:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 22:55:39 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623452139.72.0.0876107667436.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 3ec3ee7d2e9b45b586e486e429b412d6d0ca530f by Kaustubh J in branch 'main': bpo-40128: Fix IDLE autocomplete on macOS (GH-26672) https://github.com/python/cpython/commit/3ec3ee7d2e9b45b586e486e429b412d6d0ca530f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 18:55:44 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 22:55:44 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623452144.23.0.155018655793.issue40128@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25271 pull_request: https://github.com/python/cpython/pull/26683 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 18:56:27 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 11 Jun 2021 22:56:27 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623452187.44.0.0707249311808.issue40128@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25272 pull_request: https://github.com/python/cpython/pull/26684 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 19:24:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 23:24:24 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623453864.13.0.455570523994.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset b441e99d89a3f05210cc36ade57699384986ca00 by Miss Islington (bot) in branch '3.10': bpo-40128: Fix IDLE autocomplete on macOS (GH-26672) https://github.com/python/cpython/commit/b441e99d89a3f05210cc36ade57699384986ca00 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 19:24:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 23:24:43 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623453883.92.0.209255211768.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset a9e20cf7bbf3ba39260fca112938f95e4f317efc by Miss Islington (bot) in branch '3.9': bpo-40128: Fix IDLE autocomplete on macOS (GH-26672) https://github.com/python/cpython/commit/a9e20cf7bbf3ba39260fca112938f95e4f317efc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 19:26:00 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 11 Jun 2021 23:26:00 +0000 Subject: [issue40128] IDLE Show completions pop-up not working on macOS In-Reply-To: <1585675008.66.0.405710178889.issue40128@roundup.psfhosted.org> Message-ID: <1623453960.51.0.193603346191.issue40128@roundup.psfhosted.org> Terry J. Reedy added the comment: Thank you for the fix. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 20:33:48 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 00:33:48 +0000 Subject: [issue44400] Propose random.randbool() Message-ID: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> New submission from Dong-hee Na : I noticed that the random library does not provide `random.randbool()`. Generating bool value is quite common in the use-case when we generated faked data (unittest, machine learning training, etc) Somebody can say write your own library but it's too common use-case and in physically some isolated environments is hard to use 3rd party library. Since the bool value is the built-in type of python, I think that is very useful when we provide this function. I would like to get opinions from Raymond and then proceed with this issue. Here is the candidate implementation: def randbool(): return bool(getrandbits(1)) ---------- components: Library (Lib) messages: 395671 nosy: corona10, rhettinger priority: normal severity: normal status: open title: Propose random.randbool() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 20:38:41 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Jun 2021 00:38:41 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623458321.88.0.878354431485.issue44316@roundup.psfhosted.org> Terry J. Reedy added the comment: I think you should propose this for discussion on python-ideas list to try for more support. If you can, say more about why reconsider. ---------- nosy: +terry.reedy versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 20:42:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Jun 2021 00:42:09 +0000 Subject: [issue44323] install module fail on windows 10 In-Reply-To: <1623008431.46.0.342907692424.issue44323@roundup.psfhosted.org> Message-ID: <1623458529.12.0.925859562333.issue44323@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is for patching Python doc and CPython implementation. As near as I can tell, you are not reporting a CPython bug. If so, this issue should be closed as 'not a bug'. Questions about using Python should go to more appropriate places, such as python-list. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 20:44:28 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Jun 2021 00:44:28 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623458668.6.0.26995279553.issue44328@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +belopolsky, p-ganssle, vstinner versions: -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 20:51:17 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 00:51:17 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1623459077.18.0.828763760368.issue44395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 21:08:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 01:08:58 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1623460138.82.0.882250697306.issue44395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25273 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26685 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 21:09:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 01:09:27 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1623460167.13.0.451240484657.issue44395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 21:21:56 2021 From: report at bugs.python.org (Richard Barnes) Date: Sat, 12 Jun 2021 01:21:56 +0000 Subject: [issue44401] const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords Message-ID: <1623460916.5.0.468559041794.issue44401@roundup.psfhosted.org> New submission from Richard Barnes : PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords currently accept `kwlist` as `char **`; however, is not modified by either function. Therefore, a `const char **` might be better since this allows calling code to take advantage of `const` safety. ---------- components: C API messages: 395674 nosy: r-barnes priority: normal severity: normal status: open title: const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords type: security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 21:25:33 2021 From: report at bugs.python.org (Richard) Date: Sat, 12 Jun 2021 01:25:33 +0000 Subject: [issue44401] const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords In-Reply-To: <1623460916.5.0.468559041794.issue44401@roundup.psfhosted.org> Message-ID: <1623461133.41.0.0830928309507.issue44401@roundup.psfhosted.org> Change by Richard : ---------- keywords: +patch nosy: +immortalplants nosy_count: 1.0 -> 2.0 pull_requests: +25274 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26686 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 11 21:47:56 2021 From: report at bugs.python.org (Jacob Walls) Date: Sat, 12 Jun 2021 01:47:56 +0000 Subject: [issue19094] urljoin should raise a TypeError if URL is not a string In-Reply-To: <1380142541.83.0.560775690833.issue19094@psf.upfronthosting.co.za> Message-ID: <1623462476.4.0.448412120527.issue19094@roundup.psfhosted.org> Change by Jacob Walls : ---------- pull_requests: +25276 pull_request: https://github.com/python/cpython/pull/26687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 00:22:51 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 12 Jun 2021 04:22:51 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623471771.27.0.241635958969.issue44400@roundup.psfhosted.org> Steven D'Aprano added the comment: Not every one line expression needs to be a function in a library. `bool(getrandbits(1))` is self-explanatory enough, and it is doubtful that any implementation would be faster. Using getrandbits(1) to return 0 or 1 is fine; if you need a bool, call bool on the result. Aside: the name getrandbits is a bit sad, there's no setrandbits and we don't name the other random functions with a leading "get" prefix: getrandint(1, 6) Raymond, would you consider providing an alias randbits and depreciating the getrandbits name? We don't have to remove it, just document it as depreciated to be removed in Python 5000 :-) ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 00:48:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Jun 2021 04:48:36 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1623473316.29.0.606251824329.issue41611@roundup.psfhosted.org> Terry J. Reedy added the comment: #40128, which inserted update_idletasks in a different place, fixed completions for me in installed 3.9.5. They already worked fine for me in installed 3.10.0b2. #41859 is another report by Raymond of a 'random' ValueError connected with completions. Closed as a duplicate of this. I opened #44398 about 'cntl+space' being changed to the currently non-functional '^S' as the shortcut for Show completions on the macOS Edit menu. ^space does work. Nearly the same issue as cntl+backslash for Show calltip be displayed as the non-functional ^B. ---------- resolution: fixed -> stage: resolved -> status: closed -> open type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 00:48:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 12 Jun 2021 04:48:58 +0000 Subject: [issue41611] IDLE: problems with completions on Mac In-Reply-To: <1598032297.66.0.655712746709.issue41611@roundup.psfhosted.org> Message-ID: <1623473338.26.0.750053041152.issue41611@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 01:40:13 2021 From: report at bugs.python.org (Samuel Marks) Date: Sat, 12 Jun 2021 05:40:13 +0000 Subject: [issue44402] Python 3.9 and 3.10 fails to install in WINE Message-ID: <1623476412.99.0.399943466578.issue44402@roundup.psfhosted.org> New submission from Samuel Marks : What works: - python-3.7.9.exe python-3.8.9.exe What fails: - python-3.10.0b2.exe python-3.9.5.exe (I'm debugging some regressions on my test suite? macOS and Linux [incl. in Docker] work, Windows fails) How to reproduce (macOS): 0. Install WINE (crossover) https://github.com/Gcenx/homebrew-wine#how-to-install-using-brew 1. wine python-.exe /quiet /passive /log c:/p.log TargetDir=C:/python- InstallAllUsers=1 Include_doc=0 Include_debug=0 Include_dev=0 Include_exe=1 Include_launcher=0 Include_lib=1 Include_pip=1 Include_symbols=0 Include_tcltk=0 Include_test=0 Include_tools=0 2. curl https://bootstrap.pypa.io/get-pip.py -o http://get-pip.py 3. wine "C:\\python-\\python.exe" http://get-pip.py (replacing ``; obviously) Error: ``` 000b:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 000d:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0010:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0017:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 001d:err:plugplay:process_IOService_Device object 0x9203 001d:err:plugplay:process_IOService_Device Unable to create plug in interface for USB deviceobject 0x9207 001f:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0009:fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub 0025:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0009:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 0009:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 0009:fixme:advapi:DecryptFileW (L"C:\\windows\\Temp\\{FDB2F91C-29EE-4A75-AAA5-39F402CF12ED}\\", 00000000): stub 002b:fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub 002b:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 002b:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 002b:fixme:advapi:DecryptFileW (L"C:\\windows\\Temp\\{3F224591-5EEC-4431-8291-2450B9ECC110}\\", 00000000): stub 002e:fixme:shell:SHAutoComplete stub 002b:fixme:ver:GetCurrentPackageId (0x31fd04 0x0): stub 0009:fixme:ver:GetCurrentPackageId (0x31fd04 0x0): stub ``` Expected (`uniq` output of a successful install of 3.8): ``` 000b:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 000d:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0010:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0017:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 001d:err:plugplay:process_IOService_Device object 0x6a03 001d:err:plugplay:process_IOService_Device Unable to create plug in interface for USB deviceobject 0x6a07 001f:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0009:fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub 0025:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0009:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 0009:fixme:advapi:DecryptFileW (L"C:\\windows\\Temp\\{86717C64-3933-4B4D-9283-CEA5CD0F5EBB}\\", 00000000): stub 002b:fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub 002b:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 002b:fixme:advapi:DecryptFileW (L"C:\\windows\\Temp\\{9A024DD0-BF6A-4DF1-A034-C61E89E6F711}\\", 00000000): stub 002e:fixme:shell:SHAutoComplete stub 002b:fixme:advapi:DecryptFileW (L"C:\\windows\\Temp\\{9A024DD0-BF6A-4DF1-A034-C61E89E6F711}\\", 00000000): stub 002b:fixme:exec:SHELL_execute flags ignored: 0x00000100 0030:fixme:heap:RtlSetHeapInformation 0x0 1 0x0 0 stub 0030:fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub 0030:fixme:ole:CoInitializeSecurity (0031F458,-1,00000000,00000000,6,2,00000000,12288,00000000) - stub! 0030:fixme:wuapi:automatic_updates_Pause 0030:fixme:sfc:SRSetRestorePointW 0031F320 0031F530 0033:fixme:advapi:DecryptFileW (L"C:\\ProgramData\\Package Cache\\{3854F8D0-6FA6-4227-8047-8DE95B0A7DE7}v3.8.9150.0\\core.msi", 00000000): stub 0030:fixme:ntdll:NtLockFile I/O completion on lock not implemented yet 0033:fixme:advapi:DecryptFileW (L"C:\\ProgramData\\Package Cache\\{A3ED59F7-FC59-4793-AEBC-9D3813922BE1}v3.8.9150.0\\exe.msi", 00000000): stub 0030:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0030:err:mscoree:LoadLibraryShim error reading registry key for installroot 0033:fixme:advapi:DecryptFileW (L"C:\\ProgramData\\Package Cache\\{D12B4386-129A-4C17-AB8D-45FD90C6EB0D}v3.8.9150.0\\lib.msi", 00000000): stub 0033:fixme:advapi:DecryptFileW (L"C:\\ProgramData\\Package Cache\\{D9AC2AA4-3635-4476-BDC0-CC9B7992815D}v3.8.9150.0\\pip.msi", 00000000): stub 0030:err:mscoree:LoadLibraryShim error reading registry key for installroot 0037:fixme:thread:create_user_shared_data_thread Creating user shared data update thread. 0030:err:mscoree:LoadLibraryShim error reading registry key for installroot 0041:fixme:msvcrt:_configure_wide_argv (1) stub 0041:fixme:msvcrt:_initialize_wide_environment stub 0041:fixme:msvcrt:__stdio_common_vsprintf options 25 not handled 0041:fixme:ntdll:server_get_file_info Unsupported info class e 0041:fixme:msvcrt:__stdio_common_vsprintf options 25 not handled 0030:fixme:wuapi:automatic_updates_Resume 0030:fixme:ver:GetCurrentPackageId (0x31fd04 0x0): stub 002b:fixme:ver:GetCurrentPackageId (0x31fd04 0x0): stub 0009:fixme:ver:GetCurrentPackageId (0x31fd04 0x0): stub ``` ---------- components: Windows messages: 395677 nosy: paul.moore, samuelmarks, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python 3.9 and 3.10 fails to install in WINE versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 02:24:43 2021 From: report at bugs.python.org (Matthew Clapp) Date: Sat, 12 Jun 2021 06:24:43 +0000 Subject: [issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior In-Reply-To: <1623387648.1.0.29600166507.issue44388@roundup.psfhosted.org> Message-ID: <1623479083.04.0.564472138257.issue44388@roundup.psfhosted.org> Matthew Clapp added the comment: To clarify my intent: I'd really love a way to get the paths info from context from an existing native venv without affecting the directories of the venv. It seems like this is what ensure_directories *actually* does if clear==False. I'm hoping that this is also something that could be pledged in the API and noted in the documentation so this behavior can be relied on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 02:50:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Jun 2021 06:50:49 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623480649.66.0.622340371517.issue44400@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is difficult to deprecate getrandbits() because it is one of two base methods. All Random methods call either getrandbits() or randome(). Overriding them is a way to make a new random generator. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 03:02:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Jun 2021 07:02:12 +0000 Subject: [issue44401] const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords In-Reply-To: <1623460916.5.0.468559041794.issue44401@roundup.psfhosted.org> Message-ID: <1623481332.59.0.69085585177.issue44401@roundup.psfhosted.org> Serhiy Storchaka added the comment: This is a duplicate of issue21011. We cannot change this because it breaks C API. ---------- nosy: +serhiy.storchaka resolution: -> wont fix stage: patch review -> resolved status: open -> closed superseder: -> PyArg_ParseTupleAndKeywords doesn't take const char *keywords[] _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 04:22:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 12 Jun 2021 08:22:41 +0000 Subject: [issue36027] Support negative exponents in pow() where a modulus is specified. In-Reply-To: <1550520659.43.0.126744170658.issue36027@roundup.psfhosted.org> Message-ID: <1623486161.52.0.555179380848.issue36027@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +25277 pull_request: https://github.com/python/cpython/pull/26690 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 04:47:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Jun 2021 08:47:53 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623487673.94.0.473781652926.issue44328@roundup.psfhosted.org> STINNER Victor added the comment: Changing is clock is a tricky. There are many things to consider: * Is it really monotonic in all cases? * Does it have a better resolution than the previous clock? * Corner cases: does it include time spent in time.sleep() and while the system is suspended? * etc. -- When I designed PEP 418 (in 2012), QueryPerformanceCounter() was not reliable: "It has a much higher resolution, but has lower long term precision than GetTickCount() and timeGetTime() clocks. For example, it will drift compared to the low precision clocks." https://www.python.org/dev/peps/pep-0418/#windows-queryperformancecounter And there were a few bugs like: "The performance counter value may unexpectedly leap forward because of a hardware bug". A Microsoft blog article explains that users wanting a steady clock with precision higher than GetTickCount() should interpolate GetTickCount() using QueryPerformanceCounter(). If I recall correctly, this is what Firefox did for instance. Eryk: "That said, Windows 10 also provides QueryInterruptTimePrecise(), which is a hybrid solution. It uses the performance counter to interpolate a timestamp between interrupts. I'd prefer to use this for time.monotonic() instead of QPC, if it's available via GetProcAddress()." Oh, good that they provided an implementation for that :-) -- > V8 uses QueryPerformanceCounter after checking for old CPUs: https://github.com/v8/v8/blob/dc712da548c7fb433caed56af9a021d964952728/src/base/platform/time.cc#L672 It uses CPUID to check for "non stoppable time stamp counter": https://github.com/v8/v8/blob/master/src/base/cpu.cc // Check if CPU has non stoppable time stamp counter. const unsigned parameter_containing_non_stop_time_stamp_counter = 0x80000007; if (num_ext_ids >= parameter_containing_non_stop_time_stamp_counter) { __cpuid(cpu_info, parameter_containing_non_stop_time_stamp_counter); has_non_stop_time_stamp_counter_ = (cpu_info[3] & (1 << 8)) != 0; } Maybe we use such check in Python: use GetTickCount() on old CPUs, or QueryPerformanceCounter() otherwise. MSVC provides the __cpuid() function: https://docs.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex?view=msvc-160 -- > Swift originally used QueryPerformanceCounter, but switched to QueryUnbiasedInterruptTime() because they didn't want to count time the system spent asleep Oh, I recall that it was a tricky question. The PEP 418 simply says: "The behaviour of clocks after a system suspend is not defined in the documentation of new functions." See "Include Sleep" and "Include Suspend" columns of my table: https://www.python.org/dev/peps/pep-0418/#monotonic-clocks ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 05:08:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 12 Jun 2021 09:08:47 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623488927.73.0.0107159454066.issue44400@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 05:23:08 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 12 Jun 2021 09:23:08 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623489788.53.0.974428326142.issue44339@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 4a42cebf6dd769e2fa4e234a9e91093b3ad1cb63 by Mark Dickinson in branch 'main': bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606) https://github.com/python/cpython/commit/4a42cebf6dd769e2fa4e234a9e91093b3ad1cb63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 05:27:42 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 12 Jun 2021 09:27:42 +0000 Subject: [issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf In-Reply-To: <1623093216.78.0.772729157177.issue44339@roundup.psfhosted.org> Message-ID: <1623490062.44.0.996577040732.issue44339@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 05:51:03 2021 From: report at bugs.python.org (Ryan Hileman) Date: Sat, 12 Jun 2021 09:51:03 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623491463.9.0.0943315108628.issue44328@roundup.psfhosted.org> Ryan Hileman added the comment: I think a lot of that is based on very outdated information. It's worth reading this article: https://docs.microsoft.com/en-us/windows/win32/sysinfo/acquiring-high-resolution-time-stamps I will repeat Microsoft's current recommendation (from that article): > Windows has and will continue to invest in providing a reliable and efficient performance counter. When you need time stamps with a resolution of 1 microsecond or better and you don't need the time stamps to be synchronized to an external time reference, choose QueryPerformanceCounter, KeQueryPerformanceCounter, or KeQueryInterruptTimePrecise. When you need UTC-synchronized time stamps with a resolution of 1 microsecond or better, choose GetSystemTimePreciseAsFileTime or KeQuerySystemTimePrecise. (Based on that, it may also be worth replacing time.time()'s GetSystemTimeAsFileTime with GetSystemTimePreciseAsFileTime in CPython, as GetSystemTimePreciseAsFileTime is available in Windows 8 and newer) PEP 418: > It has a much higher resolution, but has lower long term precision than GetTickCount() and timeGetTime() clocks. For example, it will drift compared to the low precision clocks. Microsoft on drift (from the article above): > To reduce the adverse effects of this frequency offset error, recent versions of Windows, particularly Windows 8, use multiple hardware timers to detect the frequency offset and compensate for it to the extent possible. This calibration process is performed when Windows is started. Modern Windows also automatically detects and works around stoppable TSC, as well as several other issues: > Some processors can vary the frequency of the TSC clock or stop the advancement of the TSC register, which makes the TSC unsuitable for timing purposes on these processors. These processors are said to have non-invariant TSC registers. (Windows will automatically detect this, and select an alternative time source for QPC). It seems like Microsoft considers QPC to be a significantly better time source now, than when PEP 418 was written. Another related conversation is whether Python can just expose all of the Windows clocks directly (through clock_gettime enums?), as that gives anyone who really wants full control over their timestamps a good escape hatch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 08:02:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 12 Jun 2021 12:02:17 +0000 Subject: [issue36663] pdb: store whole exception information in locals (via user_exception) In-Reply-To: <1555620611.54.0.476670185148.issue36663@roundup.psfhosted.org> Message-ID: <1623499337.43.0.135825830079.issue36663@roundup.psfhosted.org> Irit Katriel added the comment: Isn't it enough that the traceback is available on exc_value.__traceback__? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 08:15:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Jun 2021 12:15:28 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623500128.0.0.712269808308.issue43475@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba by Serhiy Storchaka in branch 'main': bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) https://github.com/python/cpython/commit/9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 09:13:09 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 13:13:09 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623503589.44.0.24858905701.issue44400@roundup.psfhosted.org> Dong-hee Na added the comment: To explain my thought, > Not every one line expression needs to be a function in a library. `bool(getrandbits(1))` is self-explanatory enough, Yeah, I agree with the point of view, it might be enough. But considering the popularity of the Python language and there is a lot of new people who enter the programming world with Python for their own purpose so there are a lot of people who are not familiar with the concept of bits. So I thought that the random module can become more friendly for those people. And for example, Java/Scala already provides those high-level APIs (and there is a similar proposal at Go also: https://github.com/golang/go/issues/23804). but it does not mean that Python should provide the same APIs. And I know that we also have to consider the maintenance cost and the principle of library scope. Anyway, this is the reason I proposed this feature and I want to hear the opinion from other core-devs :) please let me know if I miss something or historical issue. Enjoy your weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 09:14:36 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 13:14:36 +0000 Subject: [issue44359] test_ftplib fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched In-Reply-To: <1623225511.63.0.739788412824.issue44359@roundup.psfhosted.org> Message-ID: <1623503676.86.0.539260682981.issue44359@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 09:19:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 13:19:38 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623503978.03.0.789943624675.issue44400@roundup.psfhosted.org> Dong-hee Na added the comment: s / from other core-devs / from core-devs ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 09:45:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 12 Jun 2021 13:45:02 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623505502.88.0.150413598834.issue44400@roundup.psfhosted.org> Serhiy Storchaka added the comment: As for randbool() I concur with Steven. It is too trivial and in most case you do not even need to call bool(). Alternate methods: choice((False, True)) random() < 0.5 They are less efficient than getrandbits(1), but can be easily extended to non-binary output or non-uniform distribution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 11:08:45 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 15:08:45 +0000 Subject: [issue29688] Add support for Path.absolute() In-Reply-To: <1488389848.79.0.700814097868.issue29688@psf.upfronthosting.co.za> Message-ID: <1623510525.93.0.348860795764.issue29688@roundup.psfhosted.org> Barney Gale added the comment: Hi - please could a core dev review PR 26153? It adds documentation and tests for Path.absolute(). Thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 11:46:34 2021 From: report at bugs.python.org (=?utf-8?b?0K7Qu9C40Lkg0JHRgNC+0LnQtNC1?=) Date: Sat, 12 Jun 2021 15:46:34 +0000 Subject: [issue34199] Add support for delete logger in log module. In-Reply-To: <1532347771.53.0.56676864532.issue34199@psf.upfronthosting.co.za> Message-ID: <1623512794.69.0.0463426810077.issue34199@roundup.psfhosted.org> ???? ?????? <124bit at gmail.com> added the comment: I have a similar scenario. I need to create a logger for each client of my system and than to delete them ---------- nosy: +124bit versions: +Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 11:51:09 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 15:51:09 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1623513069.61.0.00788884710568.issue43425@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch nosy: +corona10 nosy_count: 4.0 -> 5.0 pull_requests: +25278 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26693 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 12:30:03 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 12 Jun 2021 16:30:03 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623515403.93.0.743615625362.issue44376@roundup.psfhosted.org> Tim Peters added the comment: New changeset 9d8dd8f08aae4ad6e73a9322a4e9dee965afebbc by Tim Peters in branch 'main': bpo-44376 - reduce pow() overhead for small exponents (GH-26662) https://github.com/python/cpython/commit/9d8dd8f08aae4ad6e73a9322a4e9dee965afebbc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 12:49:02 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 12 Jun 2021 16:49:02 +0000 Subject: [issue44376] Improve performance of integer exponentiation In-Reply-To: <1623327135.25.0.232758885401.issue44376@roundup.psfhosted.org> Message-ID: <1623516542.74.0.142100372652.issue44376@roundup.psfhosted.org> Tim Peters added the comment: Closing this now because the pull request did, I believe, all that can be done at the function level. Exponents of 1 and 2 are well within a factor of 2 of repeated multiplication now, and it's essentially a tie at exponent 3 now. Above that, pow() wins now. On my box. Doing better would require a smarter compiler, which, e.g., knew that `pow(x, 2)` is the same as `x*x`. But, as is, `pow` is just another identifier to CPython's compiler, and may refer to any code at all. `i**2` isn't really much better, because CPython just redirects to type(i)'s __pow__ function at runtime. Which, again to the compiler, may refer to any code at all. `pow()` is quite an involved function, needing to cater to all sorts of things, including possible reduction by the optional modulus, and possibly negative exponents. `pow(i, 2)` (same as `i**2` under the covers) does exactly one Python-int multiplication now, same as `i*i`. That's fast. In either case overheads account for the bulk of the elapsed time. The overhead of going around the eval loop an "extra" time (in `i*i`) and doing another name lookup is simply smaller than all the overheads `pow()` incurs to _deduce_, at runtime, that it's only being asked to do one multiply. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 13:45:03 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 17:45:03 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623519903.06.0.539997958171.issue44316@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +25279 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26694 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 13:45:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 12 Jun 2021 17:45:18 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623519918.76.0.155879088045.issue38323@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset af5fb6706219d7949c1db5c9f2b7da53198123f3 by Miss Islington (bot) in branch '3.8': bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) (GH-26670) https://github.com/python/cpython/commit/af5fb6706219d7949c1db5c9f2b7da53198123f3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 13:53:58 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 12 Jun 2021 17:53:58 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623520438.66.0.442609079792.issue44396@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25280 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26695 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 13:53:57 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 12 Jun 2021 17:53:57 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623520437.19.0.192571159104.issue44396@roundup.psfhosted.org> miss-islington added the comment: New changeset a342cc5891dbd8a08d40e9444f2e2c9e93258721 by Pablo Galindo in branch 'main': bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676) https://github.com/python/cpython/commit/a342cc5891dbd8a08d40e9444f2e2c9e93258721 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 13:57:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 12 Jun 2021 17:57:28 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623520648.37.0.624262195353.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: alessandro mantovani, one question, how did you generate the crash scripts? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 14:25:57 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 12 Jun 2021 18:25:57 +0000 Subject: [issue44369] Improve syntax error for wrongly closed strings In-Reply-To: <1623273352.85.0.523852871256.issue44369@roundup.psfhosted.org> Message-ID: <1623522357.71.0.600656134054.issue44369@roundup.psfhosted.org> Batuhan Taskaya added the comment: >From what I can share by my experience, this error happens soo much. So I'd love to see it. For a more consistent message with others, maybe it could be something like this; SyntaxError: invalid syntax. Maybe you meant to use a different type of quote ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 14:29:42 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 18:29:42 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623522582.65.0.150231958004.issue44316@roundup.psfhosted.org> Barney Gale added the comment: Thanks Terry, I've added a topic here: https://discuss.python.org/t/pathlib-and-os-path-code-duplication-and-feature-parity/9239 The bit about `normpath()` is towards the middle of the post. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 14:47:34 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 18:47:34 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623523654.7.0.0653721189322.issue44316@roundup.psfhosted.org> Barney Gale added the comment: For this bug specifically, the pathlib docs describe the desirable behaviour: Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links: >>> PurePath('foo//bar') PurePosixPath('foo/bar') >>> PurePath('foo/./bar') PurePosixPath('foo/bar') >>> PurePath('foo/../bar') PurePosixPath('foo/../bar') (a na?ve approach would make PurePosixPath('foo/../bar') equivalent to PurePosixPath('bar'), which is wrong if foo is a symbolic link to another directory) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 15:00:41 2021 From: report at bugs.python.org (Jacob Walls) Date: Sat, 12 Jun 2021 19:00:41 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1623524441.85.0.178093562543.issue37880@roundup.psfhosted.org> Jacob Walls added the comment: Sounds reasonable to me. ---------- components: +Library (Lib) nosy: +jacobtylerwalls type: -> behavior versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 15:45:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 12 Jun 2021 19:45:06 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1623527106.78.0.170603742536.issue37880@roundup.psfhosted.org> Jack DeVries added the comment: Hi Joannah, I'm a new contributor and happy to take a crack at this if you haven't already started on a fix / would like me to do that. Thanks! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 15:49:47 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 12 Jun 2021 19:49:47 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1623527387.06.0.642565722215.issue37880@roundup.psfhosted.org> Joannah Nanjekye added the comment: @jack__d, please feel free to work on a PR. Also, do not hesitate to ask any questions along the way. Thanks for contributing to CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 15:52:47 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 19:52:47 +0000 Subject: [issue44403] Add os.path.isreserved() function Message-ID: <1623527567.53.0.441598034335.issue44403@roundup.psfhosted.org> New submission from Barney Gale : Windows reserves certain filenames like 'NUL'. Checking for these names is part of a small handful of functionality that is available in pathlib but not in os.path. I propose that we add an os.path.isreserved() function, encorporating Eryk Sun's work on bpo-27827. We then adjust pathlib to call the new function. By doing so, we move one of the few remaining OS-specific implementations in pathlib to low-level libraries (posixpath, ntpath) where it arguably belongs. We also make this functionality available to the segment of people using traditional string-based path operations who don't want to dip their toes into pathlib just for reserved names. ---------- components: Library (Lib) messages: 395702 nosy: barneygale priority: normal severity: normal status: open title: Add os.path.isreserved() function type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 15:54:22 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 19:54:22 +0000 Subject: [issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX In-Reply-To: <1525892699.63.0.682650639539.issue33450@psf.upfronthosting.co.za> Message-ID: <1623527662.03.0.868537486146.issue33450@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:16:38 2021 From: report at bugs.python.org (Bonifacio) Date: Sat, 12 Jun 2021 20:16:38 +0000 Subject: [issue16845] warnings.simplefilter should validate input In-Reply-To: <1357173726.64.0.0586309357998.issue16845@psf.upfronthosting.co.za> Message-ID: <1623528998.67.0.29417850407.issue16845@roundup.psfhosted.org> Change by Bonifacio : ---------- keywords: +patch nosy: +Bonifacio2 nosy_count: 3.0 -> 4.0 pull_requests: +25281 pull_request: https://github.com/python/cpython/pull/26696 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:18:01 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sat, 12 Jun 2021 20:18:01 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623529081.11.0.71800364257.issue44389@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset cb7230c7a7d6d497e54c25e9ba640eec79de10f2 by Erlend Egeberg Aasland in branch 'main': bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680) https://github.com/python/cpython/commit/cb7230c7a7d6d497e54c25e9ba640eec79de10f2 ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:18:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 20:18:58 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623529138.25.0.459838380873.issue44389@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 Jun 12 16:19:30 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 20:19:30 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623529170.96.0.228342826723.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks for the report, Brother Beer. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:25:55 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 12 Jun 2021 20:25:55 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623529555.3.0.73325628652.issue44283@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +25282 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26697 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:27:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 12 Jun 2021 20:27:10 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623529630.41.0.444908026233.issue44396@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d03f342a8389f1ea9100efb0d1a205601e607254 by Miss Islington (bot) in branch '3.10': bpo-44396: Update multi-line-start location when reallocating tokenizer buffers (GH-26676) (GH-26695) https://github.com/python/cpython/commit/d03f342a8389f1ea9100efb0d1a205601e607254 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:27:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 12 Jun 2021 20:27:49 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623422385.05.0.487332987283.issue44396@roundup.psfhosted.org> Message-ID: <1623529669.01.0.679001169226.issue44396@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:35:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 12 Jun 2021 20:35:31 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530131.09.0.74417471181.issue44389@roundup.psfhosted.org> Christian Heimes added the comment: It's a typo, not a duplicate entry. Correct line is: SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3 ---------- nosy: +christian.heimes resolution: fixed -> duplicate stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:36:01 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 12 Jun 2021 20:36:01 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530161.15.0.925673095794.issue44389@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: duplicate -> versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:36:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 20:36:45 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530205.93.0.602392908892.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: But TLSv1.3 is included in openssl 1.1.1, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:39:52 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 20:39:52 +0000 Subject: [issue27827] pathlib is_reserved fails for some reserved paths on Windows In-Reply-To: <1471858428.08.0.847859442583.issue27827@psf.upfronthosting.co.za> Message-ID: <1623530392.14.0.921776926122.issue27827@roundup.psfhosted.org> Change by Barney Gale : ---------- nosy: +barneygale nosy_count: 6.0 -> 7.0 pull_requests: +25283 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26698 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:42:30 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 20:42:30 +0000 Subject: [issue27827] pathlib is_reserved fails for some reserved paths on Windows In-Reply-To: <1471858428.08.0.847859442583.issue27827@psf.upfronthosting.co.za> Message-ID: <1623530550.9.0.167241149021.issue27827@roundup.psfhosted.org> Barney Gale added the comment: I've put Eryk's patch up as a PR: https://github.com/python/cpython/pull/26698 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:44:28 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 12 Jun 2021 20:44:28 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530668.94.0.641959781814.issue44389@roundup.psfhosted.org> Christian Heimes added the comment: 3.10 requires OpenSSL >= 1.1.1 The code checks for presence of deprecated options and emits a warning for all SSL_OP_NO_TLS/SSL* constants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:46:25 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 20:46:25 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530785.15.0.346980866803.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: Yes, and judging from PEP 644, I figured the TLSv1.3 flag was _not_ deprecated. Sorry for the misunderstanding/noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:47:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 20:47:50 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623530870.87.0.0961606801558.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: Let me know if you want me to open a PR that adds the correct flag and adds deprecation wrappers to the tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 16:53:12 2021 From: report at bugs.python.org (Philip Sundt) Date: Sat, 12 Jun 2021 20:53:12 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) Message-ID: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> New submission from Philip Sundt : ``` >>> import tkinter >>> from functools import partial >>> r=tkinter.Tk() >>> r.after(500, partial(print, "lol")) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.7/tkinter/__init__.py", line 755, in after callit.__name__ = func.__name__ AttributeError: 'functools.partial' object has no attribute '__name__' ``` ---------- components: Tkinter messages: 395712 nosy: phil.tgd priority: normal severity: normal status: open title: tkinter's after() AttributeError with functools.partial (no attribute __name__) type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 17:00:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 21:00:58 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623531658.54.0.334753657241.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: Ah, I see now that it's deprecated in the docs as well: https://docs.python.org/3/library/ssl.html#ssl.OP_NO_TLSv1_3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 17:02:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 12 Jun 2021 21:02:15 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623531735.35.0.368590217174.issue44389@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25284 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26699 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 17:05:45 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 12 Jun 2021 21:05:45 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623531945.96.0.289001876444.issue44316@roundup.psfhosted.org> Eryk Sun added the comment: > single dots are collapsed For pathlib, I've previously discussed a desire to retain a leading dot component from the initializing path. This could be implemented in strict mode for normpath(). A leading dot is significant in the path of an executable in a search context, such as the first item in the args sequence of subprocess.Popen(). For example, if "./spam" is normalized as "spam", then the system will search the PATH directories instead of the current working directory. It's also import to note that in Windows a leading dot component is required in order to preclude searching even if the path contains slashes. For example, CreateProcessW() and SearchPathW() will try to resolve r"spam\eggs.exe" against every directory in the search path, whereas r".\spam\eggs.exe" is explicitly relative to just the current working directory. Retaining a leading dot component can also be important in Windows in order to disambiguate a drive-relative path from a named data stream of a file that has a single-letter filename. For example, "C:spam" is a file named "spam" in the working path on drive "C:" (e.g. "C:spam" -> r"C:\working\path\spam"), but r".\C:spam" is a data stream named "spam" in a file named "C" in the current working directory. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 17:06:20 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 12 Jun 2021 21:06:20 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623531980.32.0.672949417116.issue44389@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +25285 pull_request: https://github.com/python/cpython/pull/26700 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 17:14:41 2021 From: report at bugs.python.org (Barney Gale) Date: Sat, 12 Jun 2021 21:14:41 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623532481.03.0.941811486517.issue44316@roundup.psfhosted.org> Barney Gale added the comment: I think I agree How would you feel about two new arguments? Following `os.curdir` and `os.pardir` names: def normpath(path, *, keep_curdir=False, keep_pardir=False) ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 18:07:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 12 Jun 2021 22:07:27 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1623535647.83.0.595003460274.issue43425@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 736ed6f7a9f465ba728198e8bca81e5fbe71bc37 by Dong-hee Na in branch 'main': bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693) https://github.com/python/cpython/commit/736ed6f7a9f465ba728198e8bca81e5fbe71bc37 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 18:29:13 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 12 Jun 2021 22:29:13 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623536953.51.0.699141331507.issue44283@roundup.psfhosted.org> Dennis Sweeney added the comment: Here are some benchmarks: PS C:\Users\sween\Source\Repos\cpython2\cpython> .\python.bat -m pyperf compare_to .\main.json .\PR-26697.json Running Release|x64 interpreter... 1: Mean +- std dev: [main] 117 us +- 4 us -> [PR-26697] 122 us +- 3 us: 1.04x slower 2: Mean +- std dev: [main] 202 us +- 11 us -> [PR-26697] 180 us +- 7 us: 1.12x faster 3: Mean +- std dev: [main] 320 us +- 11 us -> [PR-26697] 243 us +- 13 us: 1.32x faster 4: Mean +- std dev: [main] 474 us +- 15 us -> [PR-26697] 306 us +- 15 us: 1.55x faster 5: Mean +- std dev: [main] 625 us +- 27 us -> [PR-26697] 341 us +- 6 us: 1.83x faster 6: Mean +- std dev: [main] 806 us +- 24 us -> [PR-26697] 404 us +- 20 us: 1.99x faster 7: Mean +- std dev: [main] 1.01 ms +- 0.04 ms -> [PR-26697] 461 us +- 19 us: 2.19x faster 8: Mean +- std dev: [main] 1.22 ms +- 0.03 ms -> [PR-26697] 538 us +- 20 us: 2.27x faster 9: Mean +- std dev: [main] 1.47 ms +- 0.05 ms -> [PR-26697] 607 us +- 27 us: 2.42x faster 10: Mean +- std dev: [main] 1.75 ms +- 0.07 ms -> [PR-26697] 666 us +- 36 us: 2.62x faster ---------- Added file: https://bugs.python.org/file50106/matchperf.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 19:46:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Jun 2021 23:46:22 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623541582.55.0.88696788645.issue38323@roundup.psfhosted.org> STINNER Victor added the comment: > I think this is a good idea. MultiLoopChildWatcher could use setwakeupfd with some no-op callback just to wakeup the loop. A no-op doesn't solve the issue. It doesn't wake up the event loop. There are only two options to wake up the event loop: * Raise an exception in the Python signal handler * Generate any event which stops the event loop polling. In practice, it means to write into the event loop self pipe. This issue is similar to call_soon() which doesn't wake up the event loop if called from a different thread: you must call call_soon_threadsafe() which... writes into the self pipe. The self pipe again! -- MultiLoopChildWatcher cannot use setwakeupfd if it's also used by an event loop to register a signal handler (like CTRL+C). Python currently supports a single signal wakeup FD. The event loop *must* set the wakeup FD to its own self pipe. Otherwise, the asynchronous Python signal handler register by add_signal_handler() is not called. Extract of the Unix add_signal_handler(): # Register a dummy signal handler to ask Python to write the signal # number in the wakeup file descriptor. _process_self_data() will # read signal numbers from this file descriptor to handle signals. signal.signal(sig, _sighandler_noop) Currently, MultiLoopChildWatcher is not related to any event loop, it cannot access such "self pipe". If MultiLoopChildWatcher is modified to be attached to an event loop... does it contract the whole purpose of MultiLoopChildWatcher? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 19:49:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 12 Jun 2021 23:49:27 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623541767.07.0.947468471517.issue44328@roundup.psfhosted.org> STINNER Victor added the comment: > To reduce the adverse effects of this frequency offset error, recent versions of Windows, particularly Windows 8, use multiple hardware timers to detect the frequency offset and compensate for it to the extent possible. This calibration process is performed when Windows is started. Technically, it remains possible to install Python on Windows 7, see: bpo-32592. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 20:44:24 2021 From: report at bugs.python.org (Arjun) Date: Sun, 13 Jun 2021 00:44:24 +0000 Subject: [issue44405] add program passed as string to dis module. Message-ID: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> New submission from Arjun : python dis module should have a program passed in as string. Currently, you can do this: $ echo "x = 6" | python -m dis /dev/stdin 1 0 LOAD_CONST 0 (6) 2 STORE_NAME 0 (x) 4 LOAD_CONST 1 (None) 6 RETURN_VALUE would be convenient like this: $ ./python.exe -m dis -c "x=6" 1 0 LOAD_CONST 0 (6) 2 STORE_NAME 0 (x) 4 LOAD_CONST 1 (None) 6 RETURN_VALUE these changes seem to be working. ---------- components: Library (Lib) files: dis.patch keywords: patch messages: 395720 nosy: CCLDArjun priority: normal severity: normal status: open title: add program passed as string to dis module. type: enhancement Added file: https://bugs.python.org/file50107/dis.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 22:06:49 2021 From: report at bugs.python.org (Dylan) Date: Sun, 13 Jun 2021 02:06:49 +0000 Subject: [issue44406] Divergent sys.prefix behavior causes `python -m build` command to fail when in virtual environment Message-ID: <1623550009.05.0.642341298843.issue44406@roundup.psfhosted.org> New submission from Dylan : Confirmed on 3.6 and 3.9. The issue can be found in venv\__init__.py where the sys.prefix is used to determine the parent path of the python executable (near the bottom of the symlink_or_copy method at about line 190). On the venv documentation page (https://docs.python.org/3/library/venv.html), it is noted that: ==== When a virtual environment is active (i.e., the virtual environment?s Python interpreter is running), the attributes sys.prefix and sys.exec_prefix point to the base directory of the virtual environment, whereas sys.base_prefix and sys.base_exec_prefix point to the non-virtual environment Python installation which was used to create the virtual environment. If a virtual environment is not active, then sys.prefix is the same as sys.base_prefix and sys.exec_prefix is the same as sys.base_exec_prefix (they all point to a non-virtual environment Python installation). ==== This code is called by lib\site-packages\build\env.py (venv.EnvBuilder...) which fails erroneously due to the divergent behavior of the sys.prefix as described in the documentation snippet above. Recommended fix: I'm not sure why that behavior diverges in the first place. Ideally, either the build lib\venv\__init__.py should be updated to not rely on sys.prefix, or the sys.prefix behavior should be changed. Additional Notes: - I am seeing this issue on Windows 10 - The venv instance is within an Anaconda directory. - The python -m build command I am running is from within a virtual environment - I've listed file paths in relation to the library path within the same directory as the python executable for convenience. Let me clarify, however, that there are multiple instances of the python lib folder: 1 global and 1 local copy. The venv path is located in the global instance within the Anaconda path whereas the build script is using the virtual environment instance of python. ---------- assignee: docs at python components: Build, Documentation, Windows messages: 395721 nosy: docs at python, dsmaccy, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Divergent sys.prefix behavior causes `python -m build` command to fail when in virtual environment versions: Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 22:34:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 13 Jun 2021 02:34:08 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623551648.08.0.776997736465.issue44405@roundup.psfhosted.org> Terry J. Reedy added the comment: I checked https://docs.python.org/3/library/dis.html and there is no mention of dis having a command-line interface. This suggests that _test is likely present only for testing the module, not for using it. This was common a couple of decades ago before we had unittests. If _test were considered obsolete, it could be removed. By suggesting that the command line interface by upgraded, I suspect that you are implicitly suggesting that it be considered 'official'. If so, that '_test' should become '_main' (where the underscore leaves it out of __all__), and the CLI documented as in other modules with a CLI. (I am not up on the details and policy around this issue.) It may be appropriate to start a discussion of python-ideas. ---------- nosy: +terry.reedy, yselivanov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 22:44:14 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 13 Jun 2021 02:44:14 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623552254.01.0.8804970044.issue44405@roundup.psfhosted.org> Terry J. Reedy added the comment: What is unusual, I think, for a CLI test function is that it requires a passed in argument. As a sanity-check test, 'python -m dis' could (should) disassemble itself. Perhaps there once were some true tests that were moved to unittests. (I started IDLE unittests by doing this with module test functions.) If you know git, you could check the history and checkin messages. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 23:27:11 2021 From: report at bugs.python.org (Arjun) Date: Sun, 13 Jun 2021 03:27:11 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623554831.92.0.239834317764.issue44405@roundup.psfhosted.org> Arjun added the comment: Huh, that's actually weird that the "exisisting command line interface" (quotes because it was added as a test) isn't official. I've found it to be convinient as a newcomer to the cpython codebase. > What is unusual, I think, for a CLI test function is that it requires a passed in argument git blame shows the commit hash is 095668914c3, which is for bpo: https://bugs.python.org/issue18538 "python -m dis now uses argparse". The Misc/HISTORY file references the change in section "What's New in Python 3.4.0 Alpha 3?" Regardless of the cli being official, personally I think, it's a good feature to add. But also, maybe I should start a discussion in python-ideas about making it official? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 23:33:29 2021 From: report at bugs.python.org (Arjun) Date: Sun, 13 Jun 2021 03:33:29 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623555209.42.0.127591546035.issue44405@roundup.psfhosted.org> Arjun added the comment: > If _test were considered obsolete, it could be removed. Yup, originally it was added 2 decades ago (in 2000) originally as a test: 1fdae12c932 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 23:43:40 2021 From: report at bugs.python.org (alessandro mantovani) Date: Sun, 13 Jun 2021 03:43:40 +0000 Subject: [issue44396] pegen _PyParser_ASTFromFile(): Use-After-Free in syntaxerror() In-Reply-To: <1623520648.37.0.624262195353.issue44396@roundup.psfhosted.org> Message-ID: <48CFD9D0-4EE2-4795-B4AF-1DDE52EE3116@gmail.com> alessandro mantovani added the comment: Fuzzing experimental techniques, but then I observed the same behavior was happening with vanilla afl++. As a starting queue I used the *.py files that I found in the repo under ?test? or so Best Alessandro Mantovani Inviato da iPhone > Il giorno 12.06.2021, alle ore 19:57, Pablo Galindo Salgado ha scritto: > > ? > Pablo Galindo Salgado added the comment: > > alessandro mantovani, one question, how did you generate the crash scripts? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 12 23:57:07 2021 From: report at bugs.python.org (Arjun) Date: Sun, 13 Jun 2021 03:57:07 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623556627.72.0.0598030011097.issue44405@roundup.psfhosted.org> Arjun added the comment: > If _test were considered obsolete, it could be removed. removing _test: https://github.com/CCLDArjun/cpython/commit/8b3b8ccef0ef693f8f4105fd1eb56e9386675301 does not break dis tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 01:17:43 2021 From: report at bugs.python.org (Atsushi Sakai) Date: Sun, 13 Jun 2021 05:17:43 +0000 Subject: [issue44407] A "Coroutines and Tasks" code example needs "asyncio.run(main())" Message-ID: <1623561463.56.0.048465518238.issue44407@roundup.psfhosted.org> New submission from Atsushi Sakai : This is very small documentation improvement proposal. In the "Coroutines and Tasks" doc, the code example after "Let?s modify the above example and run two say_after coroutines concurrently:" is missing "asyncio.run(main())" at the end of the code example: async def main(): task1 = asyncio.create_task( say_after(1, 'hello')) task2 = asyncio.create_task( say_after(2, 'world')) print(f"started at {time.strftime('%X')}") # Wait until both tasks are completed (should take # around 2 seconds.) await task1 await task2 print(f"finished at {time.strftime('%X')}") ---------- assignee: docs at python components: Documentation messages: 395728 nosy: AtsushiSakai, docs at python priority: normal severity: normal status: open title: A "Coroutines and Tasks" code example needs "asyncio.run(main())" type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 01:34:08 2021 From: report at bugs.python.org (John L) Date: Sun, 13 Jun 2021 05:34:08 +0000 Subject: [issue44408] imaplib fails when server sends extra blank line after literal value Message-ID: <1623562448.65.0.279795750286.issue44408@roundup.psfhosted.org> New submission from John L : Some IMAP servers return an extra blank line after a counted literal value, which makes imaplib crash. MacOS mail and T'bird handle the blank line OK so it seems to be a somewhat common bug. ---------- components: Library (Lib) messages: 395729 nosy: jrlevine priority: normal severity: normal status: open title: imaplib fails when server sends extra blank line after literal value type: crash versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 01:35:29 2021 From: report at bugs.python.org (John L) Date: Sun, 13 Jun 2021 05:35:29 +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: <1623562529.8.0.681712606012.issue44408@roundup.psfhosted.org> Change by John L : ---------- keywords: +patch pull_requests: +25286 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26701 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 01:58:04 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 13 Jun 2021 05:58:04 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623563884.78.0.991659266192.issue44405@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 02:44:16 2021 From: report at bugs.python.org (Bodo Graumann) Date: Sun, 13 Jun 2021 06:44:16 +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: <1623566656.28.0.744559115484.issue37751@roundup.psfhosted.org> Bodo Graumann added the comment: Unfortunately this is not quite finished yet. First of all, the change is bigger than what is documented: ?Changed in version 3.9: Hyphens and spaces are converted to underscore.? In reality, now | Normalization works as follows: all non-alphanumeric | characters except the dot used for Python package names are | collapsed and replaced with a single underscore, e.g. ' -;#' | becomes '_'. Leading and trailing underscores are removed.? Cf. [encodings/__init__.py](https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/encodings/__init__.py#L47-L50) Secondly, this change breaks lots of iconv codecs with the python-iconv binding. E.g. `ASCII//TRANSLIT` is now normalized to `ascii_translit`, which iconv does not understand. Codec names which use hyphens also break and iinm not all of them have aliases in iconv without hyphens. Cf. [python-iconv #4](https://github.com/bodograumann/python-iconv/issues/4) The codecs api feels extremely well-fitting for integrating iconv in python and any alternative I can think of seems unsatisfactory. Please advise. ---------- nosy: +bodograumann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 03:35:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 13 Jun 2021 07:35:45 +0000 Subject: [issue36027] Support negative exponents in pow() where a modulus is specified. In-Reply-To: <1550520659.43.0.126744170658.issue36027@roundup.psfhosted.org> Message-ID: <1623569745.18.0.904693806145.issue36027@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +25287 pull_request: https://github.com/python/cpython/pull/26703 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 03:36:22 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 07:36:22 +0000 Subject: [issue36027] Support negative exponents in pow() where a modulus is specified. In-Reply-To: <1550520659.43.0.126744170658.issue36027@roundup.psfhosted.org> Message-ID: <1623569782.39.0.858604765465.issue36027@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +25288 pull_request: https://github.com/python/cpython/pull/26702 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 04:12:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Jun 2021 08:12:10 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623571930.71.0.23415412845.issue44405@roundup.psfhosted.org> Serhiy Storchaka added the comment: I often use the command-line interface of dis, ast, and sometimes tokenize modules. They are mature enough and not only for self-testing. If they are not documented, we need to document them. Since they read from stdin by default (no need to specify /dev/stdin or CON explicitly) I never needed the -c option. It would not be particularly useful in any case because Python code is usually multi-line. BTW sometimes I want to implement GUI for these modules in IDLE. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 04:30:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Jun 2021 08:30:51 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623573051.96.0.139177111603.issue44283@roundup.psfhosted.org> Serhiy Storchaka added the comment: How common match-case statements with literal integers? I expect that in most cases such magic numbers are not used directly, but as named constants. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 04:42:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Jun 2021 08:42:12 +0000 Subject: [issue44400] Propose random.randbool() In-Reply-To: <1623458028.32.0.0235692226246.issue44400@roundup.psfhosted.org> Message-ID: <1623573732.69.0.84517145143.issue44400@roundup.psfhosted.org> Raymond Hettinger added the comment: > I would like to get opinions from Raymond and then > proceed with this issue. I concur with Steven and Serhiy and don't think this should be added. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 04:44:24 2021 From: report at bugs.python.org (Paul Moore) Date: Sun, 13 Jun 2021 08:44:24 +0000 Subject: [issue44406] Divergent sys.prefix behavior causes `python -m build` command to fail when in virtual environment In-Reply-To: <1623550009.05.0.642341298843.issue44406@roundup.psfhosted.org> Message-ID: <1623573864.59.0.163769682836.issue44406@roundup.psfhosted.org> Paul Moore added the comment: I don't inderstand what "discrepancy" you mean here. The documentation you quote explains the behaviour, and I don't see the problem. If build is failing, why do you not think that is a bug in build? I can only see one call to venv.EnvBuilder in the code you mention and it looks correct. What error are you seeing? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 04:51:06 2021 From: report at bugs.python.org (E. Paine) Date: Sun, 13 Jun 2021 08:51:06 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1623574266.06.0.554407612502.issue44404@roundup.psfhosted.org> E. Paine added the comment: Reproducible in Python 3.9. The issue occurs because functools.partial is a class, not function. I believe the fix is simply something like: try: callit.__name__ = func.__name__ except AttributeError: callit.__name__ = type(func).__name__ This will use the name 'partial'. The lack of '__name__' is noted in the functools docs so I agree with Philip that this is an issue with tkinter. Philip, do you want to open a pull request for this? It should be noted that functools.partial is not required in this situation as 'after' takes arguments for the function call: r.after(500, print, "lol") ---------- nosy: +epaine, serhiy.storchaka versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 05:01:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Jun 2021 09:01:27 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623574887.45.0.131262018266.issue44399@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> vinay.sajip nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 05:17:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Jun 2021 09:17:40 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623575860.86.0.898201024591.issue44370@roundup.psfhosted.org> Raymond Hettinger added the comment: > There's also a somewhat arbitrary choice to be made here: > do we consider NaNs to be negative or positive? > That is, do we want NaNs to sort to the beginning of the > list, or the end? I had suggested putting NaNs at the beginning because that is how None was sorted in Python 2. But that doesn't really need to be a guide. Likely the best choice is to follow numpy's decision, placing NaNs at the end. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 05:23:18 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Jun 2021 09:23:18 +0000 Subject: [issue44370] Inconsistent results for min() and max() with math.nan as argument In-Reply-To: <1623290055.89.0.0955889494044.issue44370@roundup.psfhosted.org> Message-ID: <1623576198.61.0.442829698971.issue44370@roundup.psfhosted.org> Raymond Hettinger added the comment: > Maybe add two key functions for making NaN either the smallest > or the largest number? SQL does this with NULLS FIRST or NULLS LAST but it is a nuisance. I think it better to opt for simplicity and choose a default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 05:54:55 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 13 Jun 2021 09:54:55 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623578095.82.0.0783055815132.issue44283@roundup.psfhosted.org> Raymond Hettinger added the comment: > How common match-case statements with literal integers? Nothing is common yet because the feature hasn't been released ;-) I suspect that if match-case were optimized for integer constants, they would be used. In discussions about case statements, there are two groups, one looking for a prettier if-elif-else chain and the other looking for a fast vectored jump. This optimization is aimed at the latter group -- they would be happy to have this opportunity to make faster code, even if it means using integer constants. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 06:09:38 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 10:09:38 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623578978.47.0.903920951446.issue44389@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25289 pull_request: https://github.com/python/cpython/pull/26704 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 06:29:46 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 10:29:46 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623580186.11.0.716321704185.issue44389@roundup.psfhosted.org> miss-islington added the comment: New changeset f30f484e9660c6ad5d5a554869593d14d709a7f4 by Miss Islington (bot) in branch '3.10': bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680) https://github.com/python/cpython/commit/f30f484e9660c6ad5d5a554869593d14d709a7f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 07:25:16 2021 From: report at bugs.python.org (Florian Weimer) Date: Sun, 13 Jun 2021 11:25:16 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None Message-ID: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> New submission from Florian Weimer : This example results in an undocumented value None for the lineno attribute: ``` source = b"\xef\xbb\xbf#coding: utf8\nprint('\xe6\x88\x91')\n" try: compile(source, filename="example.py", mode="exec") except SyntaxError as e: print(str(e)) print(type(e.lineno)) ``` Output: ``` encoding problem: utf8 with BOM ``` Seen with python3-3.9.5-2.fc33.x86_64. python3-3.8.10-1.fc32.x86_64 used a lineno value of 0 (type int). ---------- components: Parser messages: 395740 nosy: fweimer, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: compile raises SyntaxError with undocumented lineno attribute None type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 07:46:16 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 11:46:16 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623584776.13.0.945448721505.issue44389@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25290 pull_request: https://github.com/python/cpython/pull/26705 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 07:46:35 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 13 Jun 2021 11:46:35 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623584795.05.0.498608540876.issue44389@roundup.psfhosted.org> Christian Heimes added the comment: New changeset bf527277d4e4907e32d76ca7ba667ab3149fe258 by Christian Heimes in branch 'main': bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) https://github.com/python/cpython/commit/bf527277d4e4907e32d76ca7ba667ab3149fe258 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 08:05:23 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 13 Jun 2021 12:05:23 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623585923.52.0.53405056782.issue44389@roundup.psfhosted.org> Christian Heimes added the comment: OpenSSL has deprecated these constants: > SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, SSL_OP_NO_TLSv1_3, SSL_OP_NO_DTLSv1, SSL_OP_NO_DTLSv1_2 > > As of OpenSSL 1.1.0, these options are deprecated, use SSL_CTX_set_min_proto_version(3) and SSL_CTX_set_max_proto_version(3) instead. https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_options.html ---------- stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 08:07:07 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 12:07:07 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623586027.89.0.933098762783.issue44389@roundup.psfhosted.org> miss-islington added the comment: New changeset 4becc569a606102bce624a4e28f4068317d09f42 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705) https://github.com/python/cpython/commit/4becc569a606102bce624a4e28f4068317d09f42 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 08:07:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 13 Jun 2021 12:07:25 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623586045.52.0.474717915439.issue44389@roundup.psfhosted.org> Change by Christian Heimes : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 08:52:24 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 13 Jun 2021 12:52:24 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623588744.46.0.526047542479.issue44389@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks, Christian. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:02:29 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 13 Jun 2021 13:02:29 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623589349.72.0.420377911762.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: @realead > This change makes life harder for people trying to get sane behavior with sets [...] Yes, code that assumes that all NaNs have the same hash value will need to change. But that doesn't seem unreasonable for objects that are already considered distinct with respect to the containment equivalence relation ("is" followed by "=="). I think this change was the right one to make, and my expectation was that there would be few cases of breakage, and that for those few cases it shouldn't be difficult to fix the breakage. If that's not true (either there are lots of cases of breakage, or the breakage is hard to fix), perhaps we should reconsider. I haven't yet seen evidence that either of those things is true, though. > Maybe a new comparator is called for [...] Agreed that that seems like a possible technical solution: Python could add a new special method __container_eq__ which is required to provide (at the least) a reflexive and symmetric relation, and whose default implementation does the same is-followed-by-== check that's already used for list, dict and set containment. For what it's worth, this is close to the approach that Julia takes: they have an "is_equal" function that's mostly the same as the normal equality == but differs for NaNs (and incidentally for signed zeros). But whether this would make sense from a language design perspective is another matter, and it would be a significant language-level change (certainly requiring a PEP). It feels like an enormous conceptual change to introduce to the language just to deal with the annoyance of NaNs. And that really is all it would be good for, unless perhaps it also provides a solution to the problem of NumPy arrays in containers, again caused by NumPy arrays overriding __eq__ in a nonstandard way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:03:39 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 13 Jun 2021 13:03:39 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623589419.83.0.0228116671808.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: @Serhiy: can this be closed again? Does GH-26679 need to be backported to the 3.10 branch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:17:57 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Sun, 13 Jun 2021 13:17:57 +0000 Subject: [issue16845] warnings.simplefilter should validate input In-Reply-To: <1357173726.64.0.0586309357998.issue16845@psf.upfronthosting.co.za> Message-ID: <1623590277.32.0.898665375741.issue16845@roundup.psfhosted.org> Joannah Nanjekye added the comment: @Bonifacio2, As commented on the PR, I think opening a PR with a patch close to what @berker.peksag suggested looks more elaborate, IMHO. Thanks for your contribution. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:24:32 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 13:24:32 +0000 Subject: [issue22234] urllib.parse.urlparse accepts any falsy value as an url In-Reply-To: <1408538391.97.0.53072227801.issue22234@psf.upfronthosting.co.za> Message-ID: <1623590672.07.0.762619299236.issue22234@roundup.psfhosted.org> Change by Jacob Walls : ---------- nosy: +jacobtylerwalls nosy_count: 7.0 -> 8.0 pull_requests: +25291 pull_request: https://github.com/python/cpython/pull/26687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:35:32 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 13:35:32 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623591332.24.0.703059462319.issue43475@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25292 pull_request: https://github.com/python/cpython/pull/26706 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 09:39:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Jun 2021 13:39:12 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623591552.52.0.113993098112.issue43475@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Maybe a new comparator is called for (like PY_EQ_FOR_HASH_COLLECTION), which would yield float("nan") equivalent to float("nan") and which should be used in hash-set/dict? It is difficult to do from technical point of view because all rich comparison implementations support currently only 6 operations. If you call tp_richcomp with something else it will crash. So we need to add new slot tp_richcomp_ex and complex logic to call either tp_richcomp_ex or tp_richcomp and correctly handle inheritance. It is too high bar. > Does GH-26679 need to be backported to the 3.10 branch? I thought that the original change was 3.11 only, but seems it was merged before the split of the 3.10 branch. So PR 26679 needs to be backported. I would add a NEWS entry if I knew this. ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 10:05:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 14:05:42 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623593142.46.0.926734718305.issue43475@roundup.psfhosted.org> miss-islington added the comment: New changeset 128899d8b8d65d86bd9bbea6801e9f36e6f409f2 by Miss Islington (bot) in branch '3.10': bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) https://github.com/python/cpython/commit/128899d8b8d65d86bd9bbea6801e9f36e6f409f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 10:07:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 13 Jun 2021 14:07:05 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623593225.2.0.76981297477.issue43475@roundup.psfhosted.org> Serhiy Storchaka added the comment: Does this change need to be mentioned in What's New? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 10:07:41 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 13 Jun 2021 14:07:41 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623593261.73.0.667798469138.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: The cookbook example is (by design) limited in scope and doesn't especially discuss usage in multi-thread or multi-process scenarios - as with other examples in the cookbook which aren't specifically concerned with such scenarios. I don't think this is a problem with the example. The problem occurs because on POSIX-style platforms, you can have multiple sources pointing to a file, and if deleted it only actually disappears when there are no references to it (such as open file descriptors/handles in other threads/processes). On Windows, for example, you would typically get a "sharing violation" type of error because you can't have multiple concurrent writers to a given file. This is not specifically a logging issue, as you could get the same thing happening with other kinds of files shared between processes and/or threads. Adding os.truncate() might just serve to hide the problem for a while, but the right answer is to avoid opening the same log file multiple times. In the examples you mention, do multiple threads create handlers pointing to the same file? That might be an anti-pattern. Normally, the main thread configures logging (early in the "if __name__ == '__main__'" clause which creates the relevant handlers) and then any subsequently created threads just log to their loggers, but don't create any new handlers in the thread. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 10:52:02 2021 From: report at bugs.python.org (Daniel Andersson) Date: Sun, 13 Jun 2021 14:52:02 +0000 Subject: [issue44410] Exception in AsyncMock side_effect cases incorrect refcount Message-ID: <1623595921.99.0.250644393873.issue44410@roundup.psfhosted.org> New submission from Daniel Andersson : Dear maintainers, I discovered an unexpected behavior when the `side_effect` of an `AsyncMock` includes an exception. The test case below fails but I expected it to pass: ``` import sys import unittest from unittest.mock import AsyncMock class A: async def foobar(self): while True: try: return await self.mock() except Exception: continue class TestA(unittest.IsolatedAsyncioTestCase): async def test_refcount(self): a = A() a.mock = AsyncMock(side_effect=[Exception(), None]) refc = sys.getrefcount(a) await a.foobar() self.assertEqual(refc, sys.getrefcount(a)) if __name__ == "__main__": unittest.main() ``` If `side_effect=[Exception(), None]` is changed to `side_effect=[None, None]` the test case pass. I discovered this in a bigger codebase while debugging why a weakref.finalize did not trigger as expected. ---------- components: asyncio messages: 395752 nosy: asvetlov, penlect, yselivanov priority: normal severity: normal status: open title: Exception in AsyncMock side_effect cases incorrect refcount type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:15:28 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 15:15:28 +0000 Subject: [issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot In-Reply-To: <1409817164.01.0.942615937948.issue22334@psf.upfronthosting.co.za> Message-ID: <1623597328.45.0.415487982209.issue22334@roundup.psfhosted.org> Change by Jacob Walls : ---------- nosy: +jacobtylerwalls nosy_count: 5.0 -> 6.0 pull_requests: +25293 pull_request: https://github.com/python/cpython/pull/26687 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:16:30 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 15:16:30 +0000 Subject: [issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot In-Reply-To: <1409817164.01.0.942615937948.issue22334@psf.upfronthosting.co.za> Message-ID: <1623597390.99.0.233217488034.issue22334@roundup.psfhosted.org> Change by Jacob Walls : ---------- pull_requests: -25293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:16:58 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 15:16:58 +0000 Subject: [issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot In-Reply-To: <1409817164.01.0.942615937948.issue22334@psf.upfronthosting.co.za> Message-ID: <1623597418.82.0.279902280042.issue22334@roundup.psfhosted.org> Jacob Walls added the comment: Sorry for noise; I typo-d when linking a PR on GitHub. Unlinked. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:17:45 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 15:17:45 +0000 Subject: [issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot In-Reply-To: <1409817164.01.0.942615937948.issue22334@psf.upfronthosting.co.za> Message-ID: <1623597465.72.0.242099507703.issue22334@roundup.psfhosted.org> Change by Jacob Walls : ---------- nosy: -jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:21:10 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 13 Jun 2021 15:21:10 +0000 Subject: [issue44411] regrtests fail with segfault after failing calls to malloc Message-ID: <1623597670.2.0.418457748374.issue44411@roundup.psfhosted.org> New submission from Jack DeVries : When running regrtests via `./python.exe -m test` on my system, several warnings about failing calls to malloc are generated during `test_decorators`. Then, a segmentation fault happens shortly thereafter in `test_descrtut`. The most recent commit on the main branch as of this test run was 17b16e13bb444001534ed6fccb459084596c8bcf. Here are some details about my system: Model Name: MacBook Pro Model Identifier: MacBookPro12,1 Processor Name: Dual-Core Intel Core i5 Processor Speed: 2.7 GHz Number of Processors: 1 Total Number of Cores: 2 L2 Cache (per Core): 256 KB L3 Cache: 3 MB Hyper-Threading Technology: Enabled Memory: 8 GB System Firmware Version: 427.0.0.0.0 SMC Version (system): 2.28f7 Serial Number (system): C02P9EMTFVH5 Hardware UUID: ABA9DB61-5A93-54BC-8057-6F0E0DA6544B Provisioning UDID: ABA9DB61-5A93-54BC-8057-6F0E0DA6544B Here is the full output from cloning all the way down to segfault ================================================================= ? tmp.kw3WJpEs git clone git at github.com:python/cpython.git . --depth=1 Cloning into '.'... remote: Enumerating objects: 4779, done. remote: Counting objects: 100% (4779/4779), done. remote: Compressing objects: 100% (4362/4362), done. remote: Total 4779 (delta 488), reused 1570 (delta 314), pack-reused 0 Receiving objects: 100% (4779/4779), 24.71 MiB | 11.00 MiB/s, done. Resolving deltas: 100% (488/488), done. Updating files: 100% (4537/4537), done. ? tmp.kw3WJpEs git:(main) ./configure --with-pydebug checking for git... found checking build system type... x86_64-apple-darwin20.5.0 checking host system type... x86_64-apple-darwin20.5.0 checking for python3.11... no checking for python3... python3 checking for --enable-universalsdk... no checking for --with-universal-archs... no checking MACHDEP... "darwin" Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for a sed that does not truncate output... /usr/bin/sed checking for --with-cxx-main=... no checking for g++... no configure: By default, distutils will build C++ extension modules with "g++". If this is not intended, then set CXX on the configure command line. checking for the platform triplet based on compiler characteristics... darwin checking for -Wl,--no-as-needed... no checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define __EXTENSIONS__... yes checking for the Android API level... not Android checking for --with-suffix... checking for case-insensitive build directory... yes checking LIBRARY... libpython$(VERSION)$(ABIFLAGS).a checking LINKCC... $(PURIFY) $(MAINCC) checking EXPORTSYMS... checking for GNU ld... no checking for --enable-shared... no checking for --enable-profiling... no checking LDLIBRARY... libpython$(VERSION)$(ABIFLAGS).a checking for ar... ar checking for readelf... no checking for a BSD-compatible install... /usr/bin/install -c checking for a thread-safe mkdir -p... ./install-sh -c -d checking for --with-pydebug... yes checking for --with-trace-refs... no checking for --with-assertions... implied by --with-pydebug checking for --enable-optimizations... no checking PROFILE_TASK... -m test --pgo --timeout=$(TESTTIMEOUT) checking for --with-lto... no checking for llvm-profdata... no configure: llvm-profdata found via xcrun: /usr/bin/xcrun llvm-profdata checking for -Wextra... yes checking whether gcc accepts and needs -fno-strict-aliasing... no checking if we can turn off gcc unused result warning... yes checking if we can turn off gcc unused parameter warning... yes checking if we can turn off gcc missing field initializers warning... yes checking if we can turn on gcc mixed sign comparison warning... yes checking if we can turn on gcc unreachable code warning... no checking if we can turn on gcc strict-prototypes warning... yes checking if we can make implicit function declaration an error in gcc... yes checking if we can use visibility in gcc... yes checking which compiler should be used... gcc checking which MACOSX_DEPLOYMENT_TARGET to use... 11.4 checking if specified universal architectures work... yes checking whether pthreads are available without options... yes checking whether g++ also accepts flags for thread support... no checking for ANSI C header files... (cached) yes checking asm/types.h usability... no checking asm/types.h presence... no checking for asm/types.h... no checking crypt.h usability... no checking crypt.h presence... no checking for crypt.h... no checking conio.h usability... no checking conio.h presence... no checking for conio.h... no checking direct.h usability... no checking direct.h presence... no checking for direct.h... no checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking ieeefp.h usability... no checking ieeefp.h presence... no checking for ieeefp.h... no checking io.h usability... no checking io.h presence... no checking for io.h... no checking langinfo.h usability... yes checking langinfo.h presence... yes checking for langinfo.h... yes checking libintl.h usability... yes checking libintl.h presence... yes checking for libintl.h... yes checking process.h usability... no checking process.h presence... no checking for process.h... no checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking sched.h usability... yes checking sched.h presence... yes checking for sched.h... yes checking shadow.h usability... no checking shadow.h presence... no checking for shadow.h... no checking signal.h usability... yes checking signal.h presence... yes checking for signal.h... yes checking stropts.h usability... no checking stropts.h presence... no checking for stropts.h... no checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking utime.h usability... yes checking utime.h presence... yes checking for utime.h... yes checking poll.h usability... yes checking poll.h presence... yes checking for poll.h... yes checking sys/devpoll.h usability... no checking sys/devpoll.h presence... no checking for sys/devpoll.h... no checking sys/epoll.h usability... no checking sys/epoll.h presence... no checking for sys/epoll.h... no checking sys/poll.h usability... yes checking sys/poll.h presence... yes checking for sys/poll.h... yes checking sys/audioio.h usability... no checking sys/audioio.h presence... no checking for sys/audioio.h... no checking sys/xattr.h usability... yes checking sys/xattr.h presence... yes checking for sys/xattr.h... yes checking sys/bsdtty.h usability... no checking sys/bsdtty.h presence... no checking for sys/bsdtty.h... no checking sys/event.h usability... yes checking sys/event.h presence... yes checking for sys/event.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/kern_control.h usability... yes checking sys/kern_control.h presence... yes checking for sys/kern_control.h... yes checking sys/loadavg.h usability... no checking sys/loadavg.h presence... no checking for sys/loadavg.h... no checking sys/lock.h usability... yes checking sys/lock.h presence... yes checking for sys/lock.h... yes checking sys/mkdev.h usability... no checking sys/mkdev.h presence... no checking for sys/mkdev.h... no checking sys/modem.h usability... no checking sys/modem.h presence... no checking for sys/modem.h... no checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking sys/random.h usability... yes checking sys/random.h presence... yes checking for sys/random.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/sendfile.h usability... no checking sys/sendfile.h presence... no checking for sys/sendfile.h... no checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/statvfs.h usability... yes checking sys/statvfs.h presence... yes checking for sys/statvfs.h... yes checking for sys/stat.h... (cached) yes checking sys/syscall.h usability... yes checking sys/syscall.h presence... yes checking for sys/syscall.h... yes checking sys/sys_domain.h usability... yes checking sys/sys_domain.h presence... yes checking for sys/sys_domain.h... yes checking sys/termio.h usability... no checking sys/termio.h presence... no checking for sys/termio.h... no checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/times.h usability... yes checking sys/times.h presence... yes checking for sys/times.h... yes checking for sys/types.h... (cached) yes checking sys/uio.h usability... yes checking sys/uio.h presence... yes checking for sys/uio.h... yes checking sys/un.h usability... yes checking sys/un.h presence... yes checking for sys/un.h... yes checking sys/utsname.h usability... yes checking sys/utsname.h presence... yes checking for sys/utsname.h... yes checking sys/wait.h usability... yes checking sys/wait.h presence... yes checking for sys/wait.h... yes checking pty.h usability... no checking pty.h presence... no checking for pty.h... no checking libutil.h usability... no checking libutil.h presence... no checking for libutil.h... no checking sys/resource.h usability... yes checking sys/resource.h presence... yes checking for sys/resource.h... yes checking netpacket/packet.h usability... no checking netpacket/packet.h presence... no checking for netpacket/packet.h... no checking sysexits.h usability... yes checking sysexits.h presence... yes checking for sysexits.h... yes checking bluetooth.h usability... no checking bluetooth.h presence... no checking for bluetooth.h... no checking linux/tipc.h usability... no checking linux/tipc.h presence... no checking for linux/tipc.h... no checking linux/random.h usability... no checking linux/random.h presence... no checking for linux/random.h... no checking spawn.h usability... yes checking spawn.h presence... yes checking for spawn.h... yes checking util.h usability... yes checking util.h presence... yes checking for util.h... yes checking alloca.h usability... yes checking alloca.h presence... yes checking for alloca.h... yes checking endian.h usability... no checking endian.h presence... no checking for endian.h... no checking sys/endian.h usability... no checking sys/endian.h presence... no checking for sys/endian.h... no checking sys/sysmacros.h usability... no checking sys/sysmacros.h presence... no checking for sys/sysmacros.h... no checking linux/memfd.h usability... no checking linux/memfd.h presence... no checking for linux/memfd.h... no checking linux/wait.h usability... no checking linux/wait.h presence... no checking for linux/wait.h... no checking sys/memfd.h usability... no checking sys/memfd.h presence... no checking for sys/memfd.h... no checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking sys/eventfd.h usability... no checking sys/eventfd.h presence... no checking for sys/eventfd.h... no checking for dirent.h that defines DIR... yes checking for library containing opendir... none required checking whether sys/types.h defines makedev... yes checking bluetooth/bluetooth.h usability... no checking bluetooth/bluetooth.h presence... no checking for bluetooth/bluetooth.h... no checking for net/if.h... yes checking for linux/netlink.h... no checking for linux/qrtr.h... no checking for linux/vm_sockets.h... no checking for linux/can.h... no checking for linux/can/bcm.h... no checking for linux/can/j1939.h... no checking for linux/can/raw.h... no checking for clock_t in time.h... yes checking for makedev... yes checking for le64toh... no checking for mode_t... yes checking for off_t... yes checking for pid_t... yes checking for size_t... yes checking for uid_t in sys/types.h... yes checking for ssize_t... yes checking for __uint128_t... yes checking size of int... 4 checking size of long... 8 checking alignment of long... 8 checking size of long long... 8 checking size of void *... 8 checking size of short... 2 checking size of float... 4 checking size of double... 8 checking size of fpos_t... 8 checking size of size_t... 8 checking alignment of size_t... 8 checking size of pid_t... 4 checking size of uintptr_t... 8 checking for long double... yes checking size of long double... 16 checking size of _Bool... 1 checking size of off_t... 8 checking whether to enable large file support... no checking size of time_t... 8 checking for pthread_t... yes checking size of pthread_t... 8 checking size of pthread_key_t... 8 checking whether pthread_key_t is compatible with int... no checking for --enable-framework... no checking for dyld... always on for Darwin checking the extension of shared libraries... .so checking LDSHARED... $(CC) -bundle -undefined dynamic_lookup checking CCSHARED... checking LINKFORSHARED... -Wl,-stack_size,1000000 -framework CoreFoundation checking CFLAGSFORSHARED... checking SHLIBS... $(LIBS) checking for sendfile in -lsendfile... no checking for dlopen in -ldl... yes checking for shl_load in -ldld... no checking uuid/uuid.h usability... yes checking uuid/uuid.h presence... yes checking for uuid/uuid.h... yes checking uuid.h usability... no checking uuid.h presence... no checking for uuid.h... no checking for uuid_generate_time_safe... no checking for uuid_create... no checking for uuid_enc_be... no checking for library containing sem_init... none required checking for textdomain in -lintl... yes checking aligned memory access is required... no checking for --with-hash-algorithm... default checking for --with-tzpath... "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo" checking for --with-address-sanitizer... no checking for --with-memory-sanitizer... no checking for --with-undefined-behavior-sanitizer... no checking for t_open in -lnsl... no checking for socket in -lsocket... no checking for --with-libs... no ./configure: line 10530: PKG_PROG_PKG_CONFIG: command not found checking for --with-system-expat... no checking for --with-system-ffi... no checking for --with-system-libmpdec... no checking for --with-decimal-contextvar... yes checking for --enable-loadable-sqlite-extensions... no checking for --with-tcltk-includes... default checking for --with-tcltk-libs... default checking for --with-dbmliborder... checking if PTHREAD_SCOPE_SYSTEM is supported... yes checking for pthread_sigmask... yes checking for pthread_getcpuclockid... no checking if --enable-ipv6 is specified... yes checking if RFC2553 API is available... yes checking ipv6 stack type... kame using libc checking for CAN_RAW_FD_FRAMES... no checking for CAN_RAW_JOIN_FILTERS... no checking for --with-doc-strings... yes checking for --with-pymalloc... yes checking for --with-c-locale-coercion... yes checking for --with-valgrind... no checking for --with-dtrace... no checking for dlopen... yes checking DYNLOADFILE... dynload_shlib.o checking MACHDEP_OBJS... none checking for alarm... yes checking for accept4... no checking for setitimer... yes checking for getitimer... yes checking for bind_textdomain_codeset... yes checking for chown... yes checking for clock... yes checking for confstr... yes checking for close_range... no checking for copy_file_range... no checking for ctermid... yes checking for dup3... no checking for execv... yes checking for explicit_bzero... no checking for explicit_memset... no checking for faccessat... yes checking for fchmod... yes checking for fchmodat... yes checking for fchown... yes checking for fchownat... yes checking for fdwalk... no checking for fexecve... no checking for fdopendir... yes checking for fork... yes checking for fpathconf... yes checking for fstatat... yes checking for ftime... yes checking for ftruncate... yes checking for futimesat... no checking for futimens... yes checking for futimes... yes checking for gai_strerror... yes checking for getentropy... yes checking for getgrgid_r... yes checking for getgrnam_r... yes checking for getgrouplist... yes checking for getgroups... yes checking for getlogin... yes checking for getloadavg... yes checking for getpeername... yes checking for getpgid... yes checking for getpid... yes checking for getpriority... yes checking for getresuid... no checking for getresgid... no checking for getpwent... yes checking for getpwnam_r... yes checking for getpwuid_r... yes checking for getspnam... no checking for getspent... no checking for getsid... yes checking for getwd... yes checking for if_nameindex... yes checking for initgroups... yes checking for kill... yes checking for killpg... yes checking for lchown... yes checking for lockf... yes checking for linkat... yes checking for lstat... yes checking for lutimes... yes checking for mmap... yes checking for memrchr... no checking for mbrtowc... yes checking for mkdirat... yes checking for mkfifo... yes checking for madvise... yes checking for mkfifoat... no checking for mknod... yes checking for mknodat... no checking for mktime... yes checking for mremap... no checking for nice... yes checking for openat... yes checking for pathconf... yes checking for pause... yes checking for pipe2... no checking for plock... no checking for poll... yes checking for posix_fallocate... no checking for posix_fadvise... no checking for posix_spawn... yes checking for posix_spawnp... yes checking for pread... yes checking for preadv... yes checking for preadv2... no checking for pthread_condattr_setclock... no checking for pthread_init... no checking for pthread_kill... yes checking for pwrite... yes checking for pwritev... yes checking for pwritev2... no checking for readlink... yes checking for readlinkat... yes checking for readv... yes checking for realpath... yes checking for renameat... yes checking for sem_open... yes checking for sem_timedwait... no checking for sem_getvalue... yes checking for sem_unlink... yes checking for sendfile... yes checking for setegid... yes checking for seteuid... yes checking for setgid... yes checking for sethostname... yes checking for setlocale... yes checking for setregid... yes checking for setreuid... yes checking for setresuid... no checking for setresgid... no checking for setsid... yes checking for setpgid... yes checking for setpgrp... yes checking for setpriority... yes checking for setuid... yes checking for setvbuf... yes checking for sched_get_priority_max... yes checking for sched_setaffinity... no checking for sched_setscheduler... no checking for sched_setparam... no checking for sched_rr_get_interval... no checking for sigaction... yes checking for sigaltstack... yes checking for sigfillset... yes checking for siginterrupt... yes checking for sigpending... yes checking for sigrelse... yes checking for sigtimedwait... no checking for sigwait... yes checking for sigwaitinfo... no checking for snprintf... yes checking for splice... no checking for strftime... yes checking for strlcpy... yes checking for strsignal... yes checking for symlinkat... yes checking for sync... yes checking for sysconf... yes checking for tcgetpgrp... yes checking for tcsetpgrp... yes checking for tempnam... yes checking for timegm... yes checking for times... yes checking for tmpfile... yes checking for tmpnam... yes checking for tmpnam_r... no checking for truncate... yes checking for uname... yes checking for unlinkat... yes checking for utimensat... yes checking for utimes... yes checking for vfork... yes checking for waitid... yes checking for waitpid... yes checking for wait3... yes checking for wait4... yes checking for wcscoll... yes checking for wcsftime... yes checking for wcsxfrm... yes checking for wmemcmp... yes checking for writev... yes checking for _getpty... no checking for rtpSpawn... no checking for lchmod... yes checking whether dirfd is declared... yes checking for chroot... yes checking for link... yes checking for symlink... yes checking for fchdir... yes checking for fsync... yes checking for fdatasync... no checking for epoll... no checking for epoll_create1... no checking for kqueue... yes checking for prlimit... no checking for _dyld_shared_cache_contains_path... yes checking for memfd_create... no checking for eventfd... no checking for ctermid_r... yes checking for flock declaration... yes checking for flock... yes checking for getpagesize... yes checking for broken unsetenv... no checking for true... true checking for inet_aton in -lc... yes checking for chflags... yes checking for lchflags... yes checking for inflateCopy in -lz... yes checking for hstrerror... yes checking for inet_aton... yes checking for inet_pton... yes checking for setgroups... yes checking for openpty... yes checking for forkpty... yes checking for fseek64... no checking for fseeko... yes checking for fstatvfs... yes checking for ftell64... no checking for ftello... yes checking for statvfs... yes checking for dup2... yes checking for getpgrp... yes checking for setpgrp... (cached) yes checking for library containing crypt... none required checking for library containing crypt_r... no checking for crypt_r... no checking for clock_gettime... yes checking for clock_getres... yes checking for clock_settime... yes checking for major... yes checking for getaddrinfo... yes checking getaddrinfo bug... no checking for getnameinfo... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for struct tm.tm_zone... yes checking for struct stat.st_rdev... yes checking for struct stat.st_blksize... yes checking for struct stat.st_flags... yes checking for struct stat.st_gen... yes checking for struct stat.st_birthtime... yes checking for struct stat.st_blocks... yes checking for struct passwd.pw_gecos... yes checking for struct passwd.pw_passwd... yes checking for siginfo_t.si_band... yes checking for time.h that defines altzone... no checking whether sys/select.h and sys/time.h may both be included... yes checking for addrinfo... yes checking for sockaddr_storage... yes checking for sockaddr_alg... no checking whether char is unsigned... no checking for an ANSI C-conforming const... yes checking for working signed char... yes checking for prototypes... yes checking for variable length prototypes and stdarg.h... yes checking for socketpair... yes checking if sockaddr has sa_len member... yes checking for gethostbyname_r... no checking for gethostbyname... yes checking for __fpu_control... no checking for __fpu_control in -lieee... no checking for --with-libm=STRING... default LIBM="" checking for --with-libc=STRING... default LIBC="" checking for x64 gcc inline assembler... yes checking whether float word ordering is bigendian... no checking whether we can use gcc inline assembler to get and set x87 control word... yes checking whether we can use gcc inline assembler to get and set mc68881 fpcr... no checking for x87-style double rounding... no checking for acosh... yes checking for asinh... yes checking for atanh... yes checking for copysign... yes checking for erf... yes checking for erfc... yes checking for expm1... yes checking for finite... yes checking for gamma... yes checking for hypot... yes checking for lgamma... yes checking for log1p... yes checking for log2... yes checking for round... yes checking for tgamma... yes checking whether isinf is declared... yes checking whether isnan is declared... yes checking whether isfinite is declared... yes checking whether POSIX semaphores are enabled... yes checking for broken sem_getvalue... yes checking whether RTLD_LAZY is declared... yes checking whether RTLD_NOW is declared... yes checking whether RTLD_GLOBAL is declared... yes checking whether RTLD_LOCAL is declared... yes checking whether RTLD_NODELETE is declared... yes checking whether RTLD_NOLOAD is declared... yes checking whether RTLD_DEEPBIND is declared... no checking whether RTLD_MEMBER is declared... no checking digit size for Python's longs... no value specified checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking size of wchar_t... 4 checking for UCS-4 tcl... no checking whether wchar_t is signed... yes checking whether wchar_t is usable... no checking whether byte ordering is bigendian... no checking ABIFLAGS... d checking SOABI... cpython-311d-darwin checking LDVERSION... $(VERSION)$(ABIFLAGS) checking for --with-platlibdir... no checking for --with-wheel-pkg-dir... no checking whether right shift extends the sign bit... yes checking for getc_unlocked() and friends... yes checking how to link readline libs... -lreadline checking whether rl_completion_append_character is declared... yes checking whether rl_completion_suppress_append is declared... no checking for rl_pre_input_hook in -lreadline... yes checking for rl_completion_display_matches_hook in -lreadline... yes checking for rl_resize_terminal in -lreadline... no checking for rl_completion_matches in -lreadline... yes checking whether rl_catch_signals is declared... no checking for append_history in -lreadline... no checking for broken nice()... no checking for broken poll()... no checking for working tzset()... yes checking for tv_nsec in struct stat... no checking for tv_nsec2 in struct stat... yes checking curses.h usability... yes checking curses.h presence... yes checking for curses.h... yes checking ncurses.h usability... yes checking ncurses.h presence... yes checking for ncurses.h... yes checking for term.h... yes checking whether mvwdelch is an expression... yes checking whether WINDOW has _flags... yes checking for is_pad... no checking for is_term_resized... yes checking for resize_term... yes checking for resizeterm... yes checking for immedok... yes checking for syncok... yes checking for wchgat... yes checking for filter... yes checking for has_key... yes checking for typeahead... yes checking for use_env... yes configure: checking for device files checking for /dev/ptmx... yes checking for /dev/ptc... no checking for %zd printf() format support... yes checking for socklen_t... yes checking for broken mbstowcs... no checking for --with-computed-gotos... no value specified checking whether gcc supports computed gotos... yes checking for build directories... done checking for -O2... yes checking for glibc _FORTIFY_SOURCE/memmove bug... no checking for gcc ipa-pure-const bug... no checking for stdatomic.h... yes checking for builtin __atomic_load_n and __atomic_store_n functions... yes checking for ensurepip... upgrade checking if the dirent structure of a d_type field... yes checking for the Linux getrandom() syscall... no checking for the getrandom() function... no checking for library containing shm_open... none required checking for sys/mman.h... (cached) yes checking for shm_open... yes checking for shm_unlink... yes checking for pkg-config... pkg-config checking whether compiling and linking against OpenSSL works... yes checking for --with-openssl-rpath... checking for --with-ssl-default-suites... python checking for --with-builtin-hashlib-hashes... md5,sha1,sha256,sha512,sha3,blake2 checking for --with-experimental-isolated-subinterpreters... no checking for --with-static-libpython... yes checking for --disable-test-modules... no configure: creating ./config.status config.status: creating Makefile.pre config.status: creating Misc/python.pc config.status: creating Misc/python-embed.pc config.status: creating Misc/python-config.sh config.status: creating Modules/ld_so_aix config.status: creating pyconfig.h creating Modules/Setup.local creating Makefile ? tmp.kw3WJpEs git:(main) make -s -j /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpython3.11d.a(dynamic_annotations.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpython3.11d.a(pymath.o) has no symbols CC='gcc' LDSHARED='gcc -bundle -undefined dynamic_lookup ' OPT='-g -O0 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python.exe -E ./setup.py -q build ld: warning: directory not found for option '-L/usr/lib/termcap' /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/_sqlite/module.c:145:10: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS 10.7 - Not supported [-Wdeprecated-declarations] rc = sqlite3_enable_shared_cache(do_enable); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sqlite3.h:6341:16: note: 'sqlite3_enable_shared_cache' has been explicitly marked deprecated here SQLITE_API int sqlite3_enable_shared_cache(int); ^ 1 warning generated. /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/_tkinter.c:2927:12: warning: 'Tk_GetNumMainWindows' is deprecated: first deprecated in macOS 10.15 - Tk API deprecated. [-Wdeprecated-declarations] while (Tk_GetNumMainWindows() > threshold && ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers/tkDecls.h:673:13: note: 'Tk_GetNumMainWindows' has been explicitly marked deprecated here EXTERN int Tk_GetNumMainWindows(void); ^ /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/_tkinter.c:3054:13: warning: 'Tk_Init' is deprecated: first deprecated in macOS 10.15 - Tk API deprecated. [-Wdeprecated-declarations] if (Tk_Init(interp) == TCL_ERROR) { ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers/tkDecls.h:769:13: note: 'Tk_Init' has been explicitly marked deprecated here EXTERN int Tk_Init(Tcl_Interp *interp); ^ /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/_tkinter.c:3450:9: warning: 'Tk_GetNumMainWindows' is deprecated: first deprecated in macOS 10.15 - Tk API deprecated. [-Wdeprecated-declarations] if (Tk_GetNumMainWindows() == 0 && PyOS_InputHook == EventHook) { ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers/tkDecls.h:673:13: note: 'Tk_GetNumMainWindows' has been explicitly marked deprecated here EXTERN int Tk_GetNumMainWindows(void); ^ 3 warnings generated. /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/tkappinit.c:105:9: warning: 'Tk_Init' is deprecated: first deprecated in macOS 10.15 - Tk API deprecated. [-Wdeprecated-declarations] if (Tk_Init(interp) == TCL_ERROR) { ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers/tkDecls.h:769:13: note: 'Tk_Init' has been explicitly marked deprecated here EXTERN int Tk_Init(Tcl_Interp *interp); ^ /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Modules/tkappinit.c:113:5: warning: 'Tk_MainWindow' is deprecated: first deprecated in macOS 10.15 - Tk API deprecated. [-Wdeprecated-declarations] Tk_MainWindow(interp); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers/tkDecls.h:792:18: note: 'Tk_MainWindow' has been explicitly marked deprecated here EXTERN Tk_Window Tk_MainWindow(Tcl_Interp *interp); ^ 2 warnings generated. Python build finished successfully! The necessary bits to build these optional modules were not found: ossaudiodev spwd To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc pwd time ? tmp.kw3WJpEs git:(main) ./python.exe -m test == CPython 3.11.0a0 (heads/main:17b16e1, Jun 13 2021, 00:58:47) [Clang 12.0.0 (clang-1200.0.32.27)] == macOS-11.4-x86_64-i386-64bit little-endian == cwd: /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/build/test_python_37107? == CPU count: 4 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 27.15 Run tests sequentially 0:00:00 load avg: 27.15 [ 1/427] test_grammar 0:00:00 load avg: 27.15 [ 2/427] test_opcodes 0:00:00 load avg: 27.15 [ 3/427] test_dict 0:00:02 load avg: 27.15 [ 4/427] test_builtin 0:00:04 load avg: 27.15 [ 5/427] test_exceptions 0:00:07 load avg: 25.22 [ 6/427] test_types 0:00:08 load avg: 25.22 [ 7/427] test_unittest 0:00:22 load avg: 20.29 [ 8/427] test_doctest 0:00:27 load avg: 19.06 [ 9/427] test_doctest2 0:00:27 load avg: 19.06 [ 10/427] test_support 0:00:40 load avg: 15.65 [ 11/427] test___all__ 0:00:51 load avg: 13.62 [ 12/427] test___future__ 0:00:52 load avg: 13.62 [ 13/427] test__locale 0:00:53 load avg: 13.62 [ 14/427] test__opcode 0:00:55 load avg: 12.85 [ 15/427] test__osx_support 0:00:56 load avg: 12.85 [ 16/427] test__xxsubinterpreters 0:01:02 load avg: 11.98 [ 17/427] test_abc 0:01:03 load avg: 11.98 [ 18/427] test_abstract_numbers 0:01:04 load avg: 11.98 [ 19/427] test_aifc 0:01:06 load avg: 11.26 [ 20/427] test_argparse 0:01:19 load avg: 10.06 [ 21/427] test_array 0:01:29 load avg: 9.36 [ 22/427] test_asdl_parser 0:01:30 load avg: 8.85 [ 23/427] test_ast 0:01:42 load avg: 8.10 [ 24/427] test_asyncgen 0:01:44 load avg: 8.10 [ 25/427] test_asynchat 0:01:47 load avg: 7.70 [ 26/427] test_asyncio 0:06:25 load avg: 2.97 [ 27/427] test_asyncore -- test_asyncio passed in 4 min 38 sec 0:06:28 load avg: 3.77 [ 28/427] test_atexit 0:06:30 load avg: 3.77 [ 29/427] test_audioop 0:06:32 load avg: 3.77 [ 30/427] test_audit 0:06:38 load avg: 4.30 [ 31/427] test_augassign 0:06:40 load avg: 4.30 [ 32/427] test_base64 0:06:42 load avg: 4.30 [ 33/427] test_baseexception 0:06:44 load avg: 4.35 [ 34/427] test_bdb 0:06:46 load avg: 4.35 [ 35/427] test_bigaddrspace 0:06:47 load avg: 4.35 [ 36/427] test_bigmem 0:06:48 load avg: 4.16 [ 37/427] test_binascii 0:06:50 load avg: 4.16 [ 38/427] test_binhex 0:06:51 load avg: 4.16 [ 39/427] test_binop 0:06:52 load avg: 4.16 [ 40/427] test_bisect 0:06:54 load avg: 4.71 [ 41/427] test_bool 0:06:56 load avg: 4.71 [ 42/427] test_buffer 0:07:37 load avg: 6.24 [ 43/427] test_bufio -- test_buffer passed in 40.9 sec 0:07:46 load avg: 11.70 [ 44/427] test_bytes 0:08:07 load avg: 11.21 [ 45/427] test_bz2 0:08:18 load avg: 12.44 [ 46/427] test_c_locale_coercion 0:08:25 load avg: 11.45 [ 47/427] test_calendar 0:08:35 load avg: 10.14 [ 48/427] test_call 0:08:37 load avg: 10.14 [ 49/427] test_capi 0:08:49 load avg: 8.47 [ 50/427] test_cgi 0:08:50 load avg: 8.47 [ 51/427] test_cgitb 0:08:53 load avg: 8.47 [ 52/427] test_charmapcodec 0:08:54 load avg: 8.47 [ 53/427] test_check_c_globals /private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Tools/c-analyzer/c_common/tables.py:236: FutureWarning: Possible nested set at position 12 _COLSPEC_RE = re.compile(textwrap.dedent(r''' 0:08:55 load avg: 7.87 [ 54/427] test_class 0:08:57 load avg: 7.87 [ 55/427] test_clinic 0:08:59 load avg: 7.87 [ 56/427] test_cmath 0:09:00 load avg: 7.40 [ 57/427] test_cmd 0:09:02 load avg: 7.40 [ 58/427] test_cmd_line 0:09:11 load avg: 6.65 [ 59/427] test_cmd_line_script 0:09:22 load avg: 6.00 [ 60/427] test_code 0:09:24 load avg: 6.00 [ 61/427] test_code_module 0:09:25 load avg: 5.84 [ 62/427] test_codeccallbacks 0:09:27 load avg: 5.84 [ 63/427] test_codecencodings_cn 0:09:29 load avg: 5.84 [ 64/427] test_codecencodings_hk 0:09:31 load avg: 5.70 [ 65/427] test_codecencodings_iso2022 0:09:33 load avg: 5.70 [ 66/427] test_codecencodings_jp 0:09:37 load avg: 5.48 [ 67/427] test_codecencodings_kr 0:09:39 load avg: 5.48 [ 68/427] test_codecencodings_tw 0:09:40 load avg: 5.28 [ 69/427] test_codecmaps_cn 0:09:42 load avg: 5.28 [ 70/427] test_codecmaps_hk 0:09:43 load avg: 5.28 [ 71/427] test_codecmaps_jp 0:09:45 load avg: 5.18 [ 72/427] test_codecmaps_kr 0:09:46 load avg: 5.18 [ 73/427] test_codecmaps_tw 0:09:48 load avg: 5.18 [ 74/427] test_codecs 0:09:54 load avg: 5.00 [ 75/427] test_codeop 0:09:56 load avg: 5.08 [ 76/427] test_collections 0:10:03 load avg: 5.00 [ 77/427] test_colorsys 0:10:05 load avg: 4.76 [ 78/427] test_compare 0:10:06 load avg: 4.76 [ 79/427] test_compile 0:10:19 load avg: 4.56 [ 80/427] test_compileall 0:10:58 load avg: 3.53 [ 81/427] test_complex -- test_compileall passed in 38.7 sec 0:11:00 load avg: 3.41 [ 82/427] test_concurrent_futures 0:14:26 load avg: 2.90 [ 83/427] test_configparser -- test_concurrent_futures passed in 3 min 26 sec 0:14:30 load avg: 2.82 [ 84/427] test_contains 0:14:31 load avg: 2.82 [ 85/427] test_context 0:14:38 load avg: 2.78 [ 86/427] test_contextlib 0:14:40 load avg: 2.78 [ 87/427] test_contextlib_async Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> Task was destroyed but it is pending! task: ()>> 0:14:42 load avg: 2.78 [ 88/427] test_copy 0:14:43 load avg: 2.63 [ 89/427] test_copyreg 0:14:45 load avg: 2.63 [ 90/427] test_coroutines 0:14:49 load avg: 2.58 [ 91/427] test_cprofile 0:14:54 load avg: 2.54 [ 92/427] test_crashers 0:14:56 load avg: 2.54 [ 93/427] test_crypt 0:14:57 load avg: 2.54 [ 94/427] test_csv 0:15:09 load avg: 2.71 [ 95/427] test_ctypes 0:15:15 load avg: 2.65 [ 96/427] test_curses test_curses skipped -- Use of the 'curses' resource not enabled 0:15:16 load avg: 2.65 [ 97/427] test_dataclasses -- test_curses skipped (resource denied) 0:15:19 load avg: 2.84 [ 98/427] test_datetime 0:15:33 load avg: 2.71 [ 99/427] test_dbm 0:15:35 load avg: 2.49 [100/427] test_dbm_dumb 0:15:38 load avg: 2.49 [101/427] test_dbm_gnu 0:15:40 load avg: 2.37 [102/427] test_dbm_ndbm 0:15:42 load avg: 2.37 [103/427] test_decimal python.exe(37107,0x10189fe00) malloc: can't allocate region :*** mach_vm_map(size=842105263157895168, flags: 100) failed (error code=3) python.exe(37107,0x10189fe00) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(37107,0x10189fe00) malloc: can't allocate region :*** mach_vm_map(size=842105263157895168, flags: 100) failed (error code=3) python.exe(37107,0x10189fe00) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(37107,0x10189fe00) malloc: can't allocate region :*** mach_vm_map(size=421052631578947584, flags: 100) failed (error code=3) python.exe(37107,0x10189fe00) malloc: *** set a breakpoint in malloc_error_break to debug python.exe(37107,0x10189fe00) malloc: can't allocate region :*** mach_vm_map(size=421052631578947584, flags: 100) failed (error code=3) python.exe(37107,0x10189fe00) malloc: *** set a breakpoint in malloc_error_break to debug 0:16:03 load avg: 2.19 [104/427] test_decorators 0:16:05 load avg: 2.25 [105/427] test_defaultdict 0:16:06 load avg: 2.25 [106/427] test_deque 0:16:25 load avg: 2.28 [107/427] test_descr Fatal Python error: Segmentation fault Current thread 0x000000010189fe00 (most recent call first): File "", line 306 in _module_repr File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/test_descr.py", line 3696 in test_uninitialized_modules File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/case.py", line 549 in _callTestMethod File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/case.py", line 592 in run File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/case.py", line 652 in __call__ File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/suite.py", line 122 in run File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/suite.py", line 84 in __call__ File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/suite.py", line 122 in run File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/unittest/suite.py", line 84 in __call__ File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/support/testresult.py", line 169 in run File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/support/__init__.py", line 960 in _run_suite File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/support/__init__.py", line 1083 in run_unittest File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/test_descr.py", line 5734 in test_main File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/main.py", line 423 in run_tests_sequential File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/main.py", line 521 in run_tests File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/main.py", line 694 in _main File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/main.py", line 641 in main File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/libregrtest/main.py", line 719 in main File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/test/__main__.py", line 2 in File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/runpy.py", line 86 in _run_code File "/private/var/folders/wt/twzkdpd53g182wvx2s1n_6540000gn/T/tmp.kw3WJpEs/Lib/runpy.py", line 196 in _run_module_as_main Extension modules: _testcapi, _scproxy, _xxsubinterpreters, _testbuffer, _testinternalcapi, _ctypes_test, xxsubtype (total: 7) [1] 37107 segmentation fault ./python.exe -m test ---------- messages: 395754 nosy: jack__d priority: normal severity: normal status: open title: regrtests fail with segfault after failing calls to malloc _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:22:27 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 13 Jun 2021 15:22:27 +0000 Subject: [issue44411] regrtests fail with segfault after failing calls to malloc In-Reply-To: <1623597670.2.0.418457748374.issue44411@roundup.psfhosted.org> Message-ID: <1623597747.13.0.419367369206.issue44411@roundup.psfhosted.org> Change by Jack DeVries : ---------- components: +Library (Lib), macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:35:00 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 13 Jun 2021 15:35:00 +0000 Subject: [issue44411] regrtests fail with segfault after failing calls to malloc In-Reply-To: <1623597670.2.0.418457748374.issue44411@roundup.psfhosted.org> Message-ID: <1623598500.26.0.266448272603.issue44411@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25295 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:35:00 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 13 Jun 2021 15:35:00 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1623598500.17.0.0414169597316.issue37880@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25294 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26707 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:49:54 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 15:49:54 +0000 Subject: [issue39950] Add pathlib.Path.hardlink_to() In-Reply-To: <1584060605.38.0.95953512485.issue39950@roundup.psfhosted.org> Message-ID: <1623599394.03.0.774607321836.issue39950@roundup.psfhosted.org> Change by Barney Gale : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 11:51:38 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 15:51:38 +0000 Subject: [issue42998] pathlib.Path: add `username` argument to `home()` In-Reply-To: <1611287835.84.0.363729514225.issue42998@roundup.psfhosted.org> Message-ID: <1623599498.45.0.986978836463.issue42998@roundup.psfhosted.org> Barney Gale added the comment: Per discussion, expanduser('~other') is considered unreliable, and we shouldn't add new functions that call through to it. Resolving as 'rejected'. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 12:10:22 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 16:10:22 +0000 Subject: [issue44412] Add os.path.fileuri() function Message-ID: <1623600622.48.0.298537036447.issue44412@roundup.psfhosted.org> New submission from Barney Gale : Proposal: - Introduce `os.path.fileuri()` function that produces a 'file://' URI - Adjust `PurePosixPath.to_uri()` to call `posixpath.fileuri()` - Adjust `PureWindowsPath.to_uri()` to call `ntpath.fileuri()` - Adjust `nturl2path.pathname2url()` to call `ntpath.fileuri()` Rationale: - pathlib is 95% a wrapper around `os` and `os.path`. It implements little itself except the OOP interface. `as_uri()` is one of only a tiny handful of pathlib features that have no decent antecedents. - the existence of these OS-specific features complicates pathlib's internals, necessitating the existence of OS-specific '_Flavour' classes that greatly complicate work on bpo-24132 - this is a useful feature with lots of stackoverflow posts. It seems silly to /require/ users to use pathlib for this, as the rest of their codebase may work just fine using traditional path manip. Further discussion on python-ideas: https://discuss.python.org/t/pathlib-and-os-path-feature-parity-and-code-de-duplication/9239 Related: bpo-44403, bpo-44136, bpo-24132 ---------- components: Library (Lib) messages: 395756 nosy: barneygale priority: normal severity: normal status: open title: Add os.path.fileuri() function type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 12:13:32 2021 From: report at bugs.python.org (mori-b) Date: Sun, 13 Jun 2021 16:13:32 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623600812.97.0.314646200143.issue44399@roundup.psfhosted.org> mori-b added the comment: Indeed this situation would rise only under misusage of the log, where multiple processes inherit by mistake or by wrong design a file descriptor of a same log file (Regarding the threads case I unfortunately cannot reproduce). While this kind of misusage doesn't have terrible consequences when not using the rotator, the growing used disk space which occurs when using the rotator is more serious, that's why I found appropriate to try and protect the programmer from his own mistake. But I understand if this is out of scope. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 12:55:20 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 16:55:20 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1623603320.18.0.906213942637.issue24132@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +25298 pull_request: https://github.com/python/cpython/pull/26708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 12:55:19 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 16:55:19 +0000 Subject: [issue44412] Add os.path.fileuri() function In-Reply-To: <1623600622.48.0.298537036447.issue44412@roundup.psfhosted.org> Message-ID: <1623603319.48.0.551200606091.issue44412@roundup.psfhosted.org> Change by Barney Gale : ---------- keywords: +patch pull_requests: +25296 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 12:55:20 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 16:55:20 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1623603320.12.0.784697291398.issue44136@roundup.psfhosted.org> Change by Barney Gale : ---------- pull_requests: +25297 pull_request: https://github.com/python/cpython/pull/26708 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 13:28:41 2021 From: report at bugs.python.org (John L) Date: Sun, 13 Jun 2021 17:28:41 +0000 Subject: [issue44269] smtplib AUTH command doesn't handle EAI arguments In-Reply-To: <1622402720.57.0.196040289354.issue44269@roundup.psfhosted.org> Message-ID: <1623605321.98.0.0728721670545.issue44269@roundup.psfhosted.org> Change by John L : ---------- keywords: +patch pull_requests: +25299 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 14:02:13 2021 From: report at bugs.python.org (Vyacheslav) Date: Sun, 13 Jun 2021 18:02:13 +0000 Subject: [issue44413] OverflowError: mktime argument out of range after 2019 Message-ID: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org> New submission from Vyacheslav : date_str = "2019-06-06 10:02:00" datetime_obj = datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S") datetime_obj_utc1 = datetime_obj.replace(tzinfo=pytz.timezone("America/New_York")) datetime_obj_utc2 = pytz.timezone("America/New_York").localize(datetime_obj) print(datetime_obj_utc1, datetime_obj_utc2) ts1 = time.mktime(datetime_obj_utc1.timetuple()) ts2 = time.mktime(datetime_obj_utc2.timetuple()) >>> Output: ts2 = int(time.mktime(datetime_obj_utc2.timetuple())) OverflowError: mktime argument out of range OS: Linux OpenSuse TW ---------- messages: 395758 nosy: psijic priority: normal severity: normal status: open title: OverflowError: mktime argument out of range after 2019 type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 14:25:31 2021 From: report at bugs.python.org (Barney Gale) Date: Sun, 13 Jun 2021 18:25:31 +0000 Subject: [issue44136] Remove pathlib flavours In-Reply-To: <1621016938.4.0.46024543706.issue44136@roundup.psfhosted.org> Message-ID: <1623608731.14.0.157025425039.issue44136@roundup.psfhosted.org> Barney Gale added the comment: Depends: bpo-39899, bpo-43757, bpo-44316, bpo-44403, bpo-44412 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 15:33:54 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 13 Jun 2021 19:33:54 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1623612834.03.0.330043980084.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: > But I understand if this is out of scope. I think it's out of scope here (as discussion of such issues will obscure the basic point about how to use the namer and rotator). However, it might be useful to have a "gotchas" section somewhere in the logging docs called something like "Things to be careful about", "Anti-patterns", "Patterns to Avoid" or similar. Or maybe have it in the cookbook with a section at the end - "Recipes to Avoid". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 16:31:33 2021 From: report at bugs.python.org (realead) Date: Sun, 13 Jun 2021 20:31:33 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623616293.88.0.908348296693.issue43475@roundup.psfhosted.org> realead added the comment: @mark.dickinson > ...my expectation was that there would be few cases of breakage, and that for those few cases it shouldn't be difficult to fix the breakage. This expectation is probably correct. My issue is somewhat only partly on-topic here: If one wants to have all NaNs in one equivalency class (e.g. if used as a key-value for example in pandas) it is almost impossible to do so in a consistent way without taking a performance hit. It seems to be possible builtin-types (even if frozenset won't be pretty), but already something like class A: def __init__(self, a): self.a=a def __hash__(self): return hash(self.a) def __eq__(self, other): return self.a == other.a is not easy to handle. A special comparator for containers would be an ultimative solution, but I see how this could be too much hassle for a corner case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 17:00:20 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Jun 2021 21:00:20 +0000 Subject: [issue44386] importlib and math.pi interact strangely In-Reply-To: <1623365159.13.0.132987664597.issue44386@roundup.psfhosted.org> Message-ID: <1623618020.05.0.0191903205536.issue44386@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 17:08:57 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 13 Jun 2021 21:08:57 +0000 Subject: [issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior In-Reply-To: <1623387648.1.0.29600166507.issue44388@roundup.psfhosted.org> Message-ID: <1623618537.31.0.798676522226.issue44388@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 17:20:30 2021 From: report at bugs.python.org (James Wilcox) Date: Sun, 13 Jun 2021 21:20:30 +0000 Subject: [issue44414] from __future__ import annotations breaks profiler's handling of dataclasses Message-ID: <1623619230.3.0.519841029097.issue44414@roundup.psfhosted.org> New submission from James Wilcox : This program behaves differently when run under the profiler (either profile or cProfile) versus when run normally. ``` from __future__ import annotations # *** import dataclasses @dataclasses.dataclass class C: x: dataclasses.InitVar[int] def __post_init__(self, x): print(f'hello {x}') C(0) ``` Save this as foo.py. Then python foo.py prints hello 0 but python -m profile foo.py results in the traceback ``` Traceback (most recent call last): File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/profile.py", line 610, in main() File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/profile.py", line 599, in main runctx(code, globs, None, options.outfile, options.sort) File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/profile.py", line 99, in runctx return _Utils(Profile).runctx(statement, globals, locals, filename, sort) File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/profile.py", line 62, in runctx prof.runctx(statement, globals, locals) File "/Users/jrw12/.pyenv/versions/3.9.5/lib/python3.9/profile.py", line 422, in runctx exec(cmd, globals, locals) File "foo.py", line 11, in C(0) File "", line 4, in __init__ TypeError: __post_init__() missing 1 required positional argument: 'x' ``` A similar traceback occurs if using `-m cProfile` instead of `-m profile`. No such traceback occurs if the `from future import __annotations__` is removed from the file. Possibly related to #39442. ---------- components: Library (Lib) messages: 395762 nosy: wilcoxjay priority: normal severity: normal status: open title: from __future__ import annotations breaks profiler's handling of dataclasses type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 17:31:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 13 Jun 2021 21:31:33 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623619893.52.0.535352674367.issue44409@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Well, in both cases this means that the line number is not available. I think None is a bit cleaner in this regard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 17:33:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Sun, 13 Jun 2021 21:33:10 +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: <1623619990.17.0.874177200268.issue37751@roundup.psfhosted.org> STINNER Victor added the comment: > The codecs api feels extremely well-fitting for integrating iconv in python and any alternative I can think of seems unsatisfactory. This issue is now closed, would you mind to open a new issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 18:13:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 13 Jun 2021 22:13:19 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623622399.86.0.878811985976.issue44409@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25300 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26712 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 18:13:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 13 Jun 2021 22:13:30 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623622410.07.0.169880033273.issue44409@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +3.10regression, 3.9regression -patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 18:22:18 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 22:22:18 +0000 Subject: [issue22234] urllib.parse.urlparse accepts any falsy value as an url In-Reply-To: <1408538391.97.0.53072227801.issue22234@psf.upfronthosting.co.za> Message-ID: <1623622938.52.0.371232483657.issue22234@roundup.psfhosted.org> Jacob Walls added the comment: Both this ticket and #19094 started from one method in urllib.parse and then generalized a proposal for the rest of the submodule to move away from duck-typing and to instead raise TypeErrors (or at least some error) for invalid types. The attached PR does that. But it broke pip, which was passing None to the `fragment` argument of `urlunsplit()`. In a blaze of efficiency, Pip already merged my fix, but since the CPython test suite depends on the current version of pip -- perhaps there's an argument for at least raising a deprecation warning for ``None`` and then converting to '' or b''? In any case, green CI makes patches more reviewable, so I'm inclined to add such a warning/conversion for now and then see how feedback goes. Cheers, all. BTW: perhaps we can close this as dupe of #19094? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 18:43:49 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 13 Jun 2021 22:43:49 +0000 Subject: [issue22234] urllib.parse.urlparse accepts any falsy value as an url In-Reply-To: <1408538391.97.0.53072227801.issue22234@psf.upfronthosting.co.za> Message-ID: <1623624229.24.0.0604931528058.issue22234@roundup.psfhosted.org> Jacob Walls added the comment: Well, now I've looked at the CPython test failure more closely, and it's in `test.test_venv.EnsurePipTest` where we just download latest pip. Their release cadence suggests a new release in July, about 2-4 weeks from now. So I'll wait on adding the DeprecationWarning for passing `None` unless folks ask for it during review, and am happy to wait a few weeks for green CI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 18:48:09 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 13 Jun 2021 22:48:09 +0000 Subject: [issue19007] precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime In-Reply-To: <1379015074.37.0.397731646491.issue19007@psf.upfronthosting.co.za> Message-ID: <1623624489.15.0.0973442737973.issue19007@roundup.psfhosted.org> Eryk Sun added the comment: > What are the expected benefits from changing? Just a higher > resolution? I'm not sure that's worth anything if it's inaccurate. GetSystemTimePreciseAsFileTime() returns an accurate timestamp, which is the current system time plus the difference between the current value of the performance counter and its value when the system time was last updated. This can't be replicated simply with separate calls to GetSystemTimeAsFileTime() and QueryPerformanceCounter(). It relies on the following undocumented fields in the KUSER_SHARED_DATA record: BaselineSystemTimeQpc, QpcSystemTimeIncrement, and QpcSystemTimeIncrementShift. The system uses a similar procedure in QueryInterruptTimePrecise() to extend the precision of QueryInterruptTime(). Ditto for QueryUnbiasedInterruptTime() vs QueryUnbiasedInterruptTimePrecise(). > "GetSystemTimePreciseAsFileTime() has very little overhead; the new > function is even a little faster than GetSystemTimeAsFileTime(), a > call takes a few ten nanoseconds." The above claim was corrected back in 2014. GetSystemTimePreciseAsFileTime() is considerably more expensive than GetSystemTimeAsFileTime(). It costs about 10 times more on a system that supports an invariant TSC. It would be more expensive on an older system that use the chipset's HPET or ACPI PM timer. That said, I doubt this matters very much when calling time.time() in interpreted code. It's a difference measured in tens of nanoseconds. ---------- nosy: +eryksun versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 19:20:02 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 13 Jun 2021 23:20:02 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1623626402.95.0.147348366972.issue43425@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25301 pull_request: https://github.com/python/cpython/pull/26713 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 19:23:45 2021 From: report at bugs.python.org (Arjun) Date: Sun, 13 Jun 2021 23:23:45 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623626625.05.0.422064168202.issue44405@roundup.psfhosted.org> Change by Arjun : ---------- pull_requests: +25302 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26714 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 20:24:23 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 00:24:23 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1623630263.49.0.59896573741.issue43425@roundup.psfhosted.org> miss-islington added the comment: New changeset 2b57ad3f5382edb6fe2dfe3c721573fbf25a826f by Miss Islington (bot) in branch '3.10': bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693) https://github.com/python/cpython/commit/2b57ad3f5382edb6fe2dfe3c721573fbf25a826f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 21:03:13 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Jun 2021 01:03:13 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623632593.98.0.804282986679.issue44328@roundup.psfhosted.org> Eryk Sun added the comment: On second thought, starting with Windows 8, WaitForSingleObject() and WaitForMultipleObjects() exclude time when the system is suspended. For consistency, an external deadline (e.g. for SIGINT support) should work the same way. The monotonic clock should thus be based on QueryUnbiasedInterruptTime(). We can conditionally use QueryUnbiasedInterruptTimePrecise() in Windows 10, which I presume includes most users of Python 3.9+ on Windows since Windows 8.1 only has a 3% share of desktop/laptop systems. If we can agree on the above, then the change to use QueryPerformanceCounter() to resolve bpo-41299 should be reverted. The deadline should instead be computed with QueryUnbiasedInterruptTime(). It's limited to the resolution of the system interrupt time, but at least compared to GetTickCount64() it returns the real interrupt time instead of an idealized 64 ticks/second. > expose all of the Windows clocks directly (through clock_gettime enums?) _Py_clock_gettime() and _Py_clock_getres() could be implemented in Python/pytime.c. For Windows we could implement the following clocks: CLOCK_REALTIME GetSystemTimePreciseAsFileTime CLOCK_REALTIME_COARSE GetSystemTimeAsFileTime CLOCK_MONOTONIC_COARSE QueryUnbiasedInterruptTime CLOCK_PROCESS_CPUTIME_ID GetProcessTimes CLOCK_THREAD_CPUTIME_ID GetThreadTimes CLOCK_PERF_COUNTER QueryPerformanceCounter Windows 10+ CLOCK_MONOTONIC QueryUnbiasedInterruptTimePrecise CLOCK_BOOTTIME QueryInterruptTimePrecise CLOCK_BOOTTIME_COARSE QueryInterruptTime > it may also be worth replacing time.time()'s GetSystemTimeAsFileTime with > GetSystemTimePreciseAsFileTime See bpo-19007, which is nearly 8 years old. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 23:35:12 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Jun 2021 03:35:12 +0000 Subject: [issue44316] Support preserving path meaning in os.path.normpath() and abspath() In-Reply-To: <1622841679.24.0.579072106292.issue44316@roundup.psfhosted.org> Message-ID: <1623641712.7.0.208050759893.issue44316@roundup.psfhosted.org> Eryk Sun added the comment: I think separate keep_curdir and keep_pardir options is over-complicating the signature. Also, I'd prefer to remove a dot component if it's not the first component since there's no reason to keep it. If you plan to use normpath() in pathlib, then the case for special_prefixes in ntpath.normpath() should be removed. Actually, it never should have been added. IIRC it was added as a workaround for a buggy implementation that's no longer an issue. Only \\?\ is special, and that's only when opening/accessing a path. It's not special in GetFullPathNameW(), as is called by ntpath.abspath() in Windows. This needlessly introduces inconsistency for ntpath.abspath() calls in Windows vs Unix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 13 23:47:35 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 14 Jun 2021 03:47:35 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623642455.38.0.955894065533.issue44328@roundup.psfhosted.org> Ryan Hileman added the comment: > The monotonic clock should thus be based on QueryUnbiasedInterruptTime My primary complaint here is that Windows is the only major platform with a low resolution monotonic clock. Using QueryUnbiasedInterruptTime() on older OS versions wouldn't entirely help that, so we have the same consistency issue (just on a smaller scale). I would personally need to still use time.perf_counter() instead of time.monotonic() due to this, but I'm not totally against it. > For consistency, an external deadline (e.g. for SIGINT support) should work the same way. Have there been any issues filed about the deadline behaviors across system suspend? > which I presume includes most users of Python 3.9+ Seems like Windows 7 may need to be considered as well, as per vstinner's bpo-32592 mention? > starting with Windows 8, WaitForSingleObject() and WaitForMultipleObjects() exclude time when the system is suspended Looks like Linux (CLOCK_MONOTONIC) and macOS (mach_absolute_time()) already don't track suspend time in time.monotonic(). I think that's enough to suggest that long-term Windows shouldn't either, but I don't know how to reconcile that with my desire for Windows not to be the only platform with low resolution monotonic time by default. > then the change to use QueryPerformanceCounter() to resolve bpo-41299 should be reverted. The deadline should instead be computed with QueryUnbiasedInterruptTime() I don't agree with this, as it would regress the fix. This is more of a topic for bpo-41299, but I tested QueryUnbiasedInterruptTime() and it exhibits the same 16ms jitter as GetTickCount64() (which I expected), so non-precise interrupt time can't solve this issue. I do think QueryUnbiasedInterruptTimePrecise() would be a good fit. I think making this particular timeout unbiased (which would be a new behavior) should be a lower priority than making it not jitter. > For Windows we could implement the following clocks: I think that list is great and making those enums work with clock_gettime on Windows sounds like a very clear improvement to the timing options available. Having the ability to query each clock source directly would also reduce the impact if time.monotonic() does not perfectly suit a specific application. --- I think my current positions after writing all of this are: - I would probably be in support of a 3.11+ change for time.monotonic() to use QueryUnbiasedInterruptTime() pre-Windows 10, and dynamically use QueryUnbiasedInterruptTimePrecise() on Windows 10+. Ideally the Windows clock_gettime() code lands in the same release, so users can directly pick their time source if necessary. This approach also helps my goal of making time.monotonic()'s suspend behavior more uniform across platforms. - Please don't revert bpo-41299 (especially the backports), as it does fix the issue and tracking suspend time is the same (not a regression) as the previous GetTickCount64() code. I think the lock timeouts should stick with QPC pre-Windows-10 to fix the jitter, but could use QueryUnbiasedInterruptTimePrecise() on Windows 10+ (which needs the same runtime check as the time.monotonic() change, thus could probably land in the same patch set). - I'm honestly left with more questions than I started after diving into the GetSystemTimePreciseAsFileTime() rabbit hole. I assume it's not a catastrophic issue? Maybe it's a situation where adding the clock_gettime() enums would sufficiently help anyone who cares about the exact behavior during clock modification. I don't have strong opinions about it, besides it being a shame that Windows currently has lower precision timestamps in general. Could be worth doing a survey of other languages' choices, but any further discussion can probably go to bpo-19007. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 00:36:52 2021 From: report at bugs.python.org (Rajeev Chaurasia) Date: Mon, 14 Jun 2021 04:36:52 +0000 Subject: [issue44415] sys.stdout.flush and print() hanging Message-ID: <1623645412.68.0.708640835339.issue44415@roundup.psfhosted.org> New submission from Rajeev Chaurasia : I am running an application using cronjob. This application runs on Linux(X86_64) platform where inside a loop we have print() and sys.stdout.flush() statements. This loop iterates around 500 times and after the loop we have few more sys.stdout.flush() and print() statements. When I am running same application on terminal (without cronjob) then it is working fine. Inside the loop everything is working fine but application is hanging after the loop. I put some debug statements and I found it is hanging on print() and sys.stdout.flush(). Code logic:- for x in range(500): print(x) print ("something") sys.stdout.flush() self.logger.info("A") sys.stdout.flush() #1 self.logger.info("B") print ("Hello") #2 self.logger.info("C") print ("Bye") #3 self.logger.info("D") ----------------------------------------- "A" is getting printed in log file and nothing after that but- If I comment #1 then I get "B" as well in the log file. If I comment #2 then I get "C" as well in the log file If I comment #3 then I get "D" as well in the log file. ----------------------------------------- ps results- [root at scao05adm07 ~]# ps -ef|grep exachk root 239265 98963 0 Jun11 ? 00:00:00 sh /opt/oracle.ahf/bin/exachk -silentforce -showpass -dball -nocvu -autorun_id DEFAULT root 239706 239265 0 Jun11 ? 00:00:35 /opt/oracle.ahf/python/bin/python /opt/oracle.ahf/exachk/exachk.py -silentforce -showpass -dball -nocvu -autorun_id DEFAULT root 277938 239706 0 Jun11 ? 00:00:00 sh /opt/oracle.ahf/exachk/exachk -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly -sudo_remoterun 0 root 278989 277938 0 Jun11 ? 00:12:26 /opt/oracle.ahf/python/bin/python /opt/oracle.ahf/exachk/exachk.py -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly -sudo_remoterun 0 root 281983 278989 0 Jun11 ? 00:00:27 /opt/oracle.ahf/python/bin/python /opt/oracle.ahf/exachk/exachk.py -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly -sudo_remoterun 0 ----------------------------------------- # uname -a Linux ************ 4.14.35-1902.306.2.2.el7uek.x86_64 #2 SMP Thu Nov 19 18:09:09 PST 2020 x86_64 x86_64 x86_64 GNU/Linux ----------------------------------------- I believe this issue is related to standard output buffer but I am not able to find a fix for it. Please help. -Rajeev ---------- components: Library (Lib) messages: 395772 nosy: rajeevkchaurasia priority: normal severity: normal status: open title: sys.stdout.flush and print() hanging versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 00:40:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 04:40:26 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623645626.06.0.202953890235.issue43475@roundup.psfhosted.org> Raymond Hettinger added the comment: > If one wants to have all NaNs in one equivalency class > (e.g. if used as a key-value for example in pandas) it > is almost impossible to do so in a consistent way > without taking a performance hit. ISTM the performance of the equivalent class case is far less important than the one we were trying to solve. Given a choice we should prefer helping normal unadorned instances rather than giving preference to a subclass that redefines the usual behaviors. In CPython, it is a fact of life that overriding builtin behaviors with pure python code always incurs a performance hit. Also, in your example, the subclass isn't technically correct because it relies on a non-guaranteed implementation details. It likely isn't even the fastest approach. The only guaranteed behaviors are that math.isnan(x) reliably detects a NaN and that x!=x when x is a NaN. Those are the only assured tools in the uphill battle to fight the weird intrinsic nature of NaNs. So one possible solution is to replace all the NaNs with a canonical placeholder value that doesn't have undesired properties: {None if isnan(x) else x for x in arr} That relies on guaranteed behaviors and is reasonably fast. IMO that beats trying to reprogram float('NaN') to behave the opposite of how it was designed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 00:51:07 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 14 Jun 2021 04:51:07 +0000 Subject: [issue44414] from __future__ import annotations breaks profiler's handling of dataclasses In-Reply-To: <1623619230.3.0.519841029097.issue44414@roundup.psfhosted.org> Message-ID: <1623646267.91.0.997945468947.issue44414@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 01:29:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 05:29:22 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623648562.73.0.149218238441.issue44310@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +25303 pull_request: https://github.com/python/cpython/pull/26715 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 01:47:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 05:47:35 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623649655.86.0.593502374355.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset fafcfff9262ae9dee03a00006638dfcbcfc23a7b by Raymond Hettinger in branch 'main': bpo-44310: Note that lru_cache keep references to both arguments and results (GH-26715) https://github.com/python/cpython/commit/fafcfff9262ae9dee03a00006638dfcbcfc23a7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 01:47:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 05:47:38 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623649658.48.0.297202213517.issue44310@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25304 pull_request: https://github.com/python/cpython/pull/26716 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 01:54:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 05:54:45 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623650085.41.0.277933012762.issue44310@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: duplicate -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 02:28:27 2021 From: report at bugs.python.org (neonene) Date: Mon, 14 Jun 2021 06:28:27 +0000 Subject: [issue43105] [Windows] Can't import extension modules resolved via relative paths in sys.path In-Reply-To: <1612285380.24.0.495785451269.issue43105@roundup.psfhosted.org> Message-ID: <1623652107.78.0.841813952324.issue43105@roundup.psfhosted.org> neonene added the comment: After this contribution, when using module at the root dir (maybe bad manners), the followings are expected behaviors? (1) relative drive in sys.path -> bytecode is not put in __pycache__ folder. >>> import sys >>> sys.path.append('F:') # flash device, etc... >>> import foo >>> foo.__file__ 'F:foo.py' >>> foo.__cached__ 'F:foo.cpython-311.pyc' (2) absolute drive in sys.path -> __pycache__ is under current dir, not absolute. >>> import sys >>> sys.path.append('F:\\') >>> import foo >>> foo.__file__ 'F:\\foo.py' >>> foo.__cached__ 'F:__pycache__\\foo.cpython-311.pyc' ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 02:39:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Jun 2021 06:39:53 +0000 Subject: [issue44415] sys.stdout.flush and print() hanging In-Reply-To: <1623645412.68.0.708640835339.issue44415@roundup.psfhosted.org> Message-ID: <1623652793.07.0.306817726654.issue44415@roundup.psfhosted.org> Serhiy Storchaka added the comment: What is self.logger and how do you run your application? Do you redirect its stdout and stderr and to where? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 03:14:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 07:14:25 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623654865.02.0.824685644595.issue41299@roundup.psfhosted.org> STINNER Victor added the comment: I suggest to remove the (now <= 0) check. _PyTime_t now = _PyTime_GetPerfCounter(); if (now <= 0) { Py_FatalError("_PyTime_GetPerfCounter() == 0"); } Please don't add such Py_FatalError() in the middle of a function. If this case happens, it means that Python immediately exits and creates a debug report (ex: coredump on Unix, popup on Windows asking to open a debugger), and worse: it exits the process immediately. I'm not aware of anyone reporting that _PyTime_GetPerfCounter() returns 0. Do you fear that the clock is broken and *always* report 0? If yes, please add at check when Python starts. But why do you think that it could happen? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 03:27:58 2021 From: report at bugs.python.org (Florian Weimer) Date: Mon, 14 Jun 2021 07:27:58 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623655678.63.0.989840605645.issue44409@roundup.psfhosted.org> Florian Weimer added the comment: I suppose changing the documentation to mention `None` would be possible as well, but restoring the old behavior works for me too. Thanks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 03:36:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 07:36:56 +0000 Subject: [issue44416] test_threading: test_print_exception() hangs and killed after 3h15 Message-ID: <1623656216.7.0.491497742026.issue44416@roundup.psfhosted.org> New submission from STINNER Victor : AMD64 Windows8.1 Refleaks 3.9: https://buildbot.python.org/all/#/builders/6/builds/48 4:03:35 load avg: 3.98 [425/425/1] test_threading crashed (Exit code 1) beginning 6 repetitions 123456 Timeout (3:15:00)! Thread 0x00000748 (most recent call first): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\subprocess.py", line 1479 in _readerthread File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 907 in run File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 970 in _bootstrap_inner File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 927 in _bootstrap Thread 0x00001138 (most recent call first): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\subprocess.py", line 1479 in _readerthread File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 907 in run File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 970 in _bootstrap_inner File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 927 in _bootstrap Thread 0x00000b80 (most recent call first): File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 1066 in _wait_for_tstate_lock File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\threading.py", line 1050 in join File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\subprocess.py", line 1508 in _communicate File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\subprocess.py", line 1134 in communicate File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\script_helper.py", line 132 in run_python_until_end File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\script_helper.py", line 140 in _assert_python File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\support\script_helper.py", line 156 in assert_python_ok File "D:\buildarea\3.9.ware-win81-release.refleak\build\lib\test\test_threading.py", line 1164 in test_print_exception ... The test runs a subprocess, the logs don't say where the child process was stuck: def test_print_exception(self): script = r"""if True: import threading import time running = False def run(): global running running = True while running: time.sleep(0.01) 1/0 t = threading.Thread(target=run) t.start() while not running: time.sleep(0.01) running = False t.join() """ rc, out, err = assert_python_ok("-c", script) self.assertEqual(out, b'') err = err.decode() self.assertIn("Exception in thread", err) self.assertIn("Traceback (most recent call last):", err) self.assertIn("ZeroDivisionError", err) self.assertNotIn("Unhandled exception", err) Note: using a "busy loop" to (1) waits until the thread starts (2) waits until the thread is requested to stop, is not an effecient way to synchonize. One two threading.Event would be better. ---------- components: Tests messages: 395779 nosy: vstinner priority: normal severity: normal status: open title: test_threading: test_print_exception() hangs and killed after 3h15 versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 03:37:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 07:37:08 +0000 Subject: [issue44416] test_threading: test_print_exception() hangs and killed after 3h15 on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1623656216.7.0.491497742026.issue44416@roundup.psfhosted.org> Message-ID: <1623656228.38.0.436119866944.issue44416@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: test_threading: test_print_exception() hangs and killed after 3h15 -> test_threading: test_print_exception() hangs and killed after 3h15 on AMD64 Windows8.1 Refleaks 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 03:43:16 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 14 Jun 2021 07:43:16 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623656596.79.0.167605121245.issue41299@roundup.psfhosted.org> Ryan Hileman added the comment: I agree with not throwing fatal errors, but that check is unlikely to actually be hit, and you removed the startup checks covering the underlying clocks here: https://github.com/python/cpython/commit/ae6cd7cfdab0599139002c526953d907696d9eef I think if the time source is broken, a user would probably prefer an exception or fatal error to the deadlock they will otherwise get (as time not advancing means it's impossible to timeout), so it doesn't make sense to remove the check without doing something else about it. There are three places win_perf_counter_frequency() can fail: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Python/pytime.c#L974 I mention the QueryPerformanceFrequency error case here (stack misalignment): https://bugs.python.org/issue41299#msg395237 The other option, besides startup checks, would be to better parameterize the timer used (mentioned in bpo-44328): Prefer QueryUnbiasedInterruptTimePrecise if available (Win 10+ via GetProcAddress), then QPC, then QueryUnbiasedInterruptTime (which has the original bug wrt jitter but should never be used as QPC is unlikely to be broken). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 04:01:16 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 14 Jun 2021 08:01:16 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623657676.04.0.603125531273.issue41299@roundup.psfhosted.org> Ryan Hileman added the comment: Perhaps the simplest initial fix would be to move that check down to PyThread__init_thread() in the same file. I'm not sure what the cpython convention for that kind of init error is, would it just be the same Py_FatalError block or is there a better pattern? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 04:41:41 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Jun 2021 08:41:41 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623660101.84.0.283829196618.issue44328@roundup.psfhosted.org> Eryk Sun added the comment: > Seems like Windows 7 may need to be considered as well, as > per vstinner's bpo-32592 mention? Python 3.9 doesn't support Windows 7. Moreover, the interpreter DLL in 3.9 implicitly imports PathCchCanonicalizeEx, PathCchCombineEx, and PathCchSkipRoot, which were added in Windows 8. So it won't even load in Windows 7. > Have there been any issues filed about the deadline behaviors > across system suspend? Not that I'm aware of, but waits should be correct and consistent in principle. It shouldn't behave drastically different just because the user closed the laptop lid for an hour. > Looks like Linux (CLOCK_MONOTONIC) and macOS (mach_absolute_time()) > already don't track suspend time in time.monotonic(). I think that's > enough to suggest that long-term Windows shouldn't either I'm not overly concerned here with cross-platform consistency. If Windows hadn't changed the behavior of wait timeouts, then I wouldn't worry about it since most clocks in Windows are biased by the time spent suspended. It's a bonus that this change would also improve cross-platform consistency for time.monotonic(). > I tested QueryUnbiasedInterruptTime() and it exhibits the same > 16ms jitter as GetTickCount64() (which I expected), For bpo-41299, it occurs to me that we've only ever used _PY_EMULATED_WIN_CV, in which case PyCOND_TIMEDWAIT() returns 1 for a timeout, as implemented in _PyCOND_WAIT_MS(). Try changing EnterNonRecursiveMutex() to break out of the loop in this case. For example: } else if (milliseconds != 0) { /* wait at least until the target */ ULONGLONG now, target; QueryUnbiasedInterruptTime(&target); target += milliseconds; while (mutex->locked) { int ret = PyCOND_TIMEDWAIT(&mutex->cv, &mutex->cs, (long long)milliseconds * 1000); if (ret < 0) { result = WAIT_FAILED; break; } if (ret == 1) { /* timeout */ break; } QueryUnbiasedInterruptTime(&now); if (target <= now) break; milliseconds = (DWORD)(target - now); } } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 04:53:56 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 14 Jun 2021 08:53:56 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623660836.56.0.201079877369.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: > Does this change need to be mentioned in What's New? Yes, I think so, given that it's a change to documented behavior. It's also something that third party packages (like NumPy) potentially need to be aware of. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 05:15:47 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 14 Jun 2021 09:15:47 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623662147.78.0.0807709580249.issue44328@roundup.psfhosted.org> Ryan Hileman added the comment: > It shouldn't behave drastically different just because the user closed the laptop lid for an hour I talked to someone who's been helping with the Go time APIs and it seems like that holds pretty well for interactive timeouts, but makes no sense for network related code. If you lost a network connection (with, say, a 30 second timeout) due to the lid being closed, you don't want to wait 30 seconds after opening the lid for the application to realize it needs to reconnect. (However there's probably no good way to design Python's locking system around both cases, so it's sufficient to say "lock timers won't advance during suspend" and make the application layer work around that on its own in the case of network code) > Try changing EnterNonRecursiveMutex() to break out of the loop in this case This does work, but unfortunately a little too well - in a single test I saw several instances where that approach returned _earlier_ than the timeout. I assume the reason for this loop is the call can get interrupted with a "needs retry" state. If so, you'd still see 16ms of jitter anytime that happens as long as it's backed by a quantized time source. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 05:58:43 2021 From: report at bugs.python.org (Rajeev Chaurasia) Date: Mon, 14 Jun 2021 09:58:43 +0000 Subject: [issue44415] sys.stdout.flush and print() hanging In-Reply-To: <1623645412.68.0.708640835339.issue44415@roundup.psfhosted.org> Message-ID: <1623664723.77.0.147134417938.issue44415@roundup.psfhosted.org> Rajeev Chaurasia added the comment: self.logger = lib.logger.Log() We have cronjob entry to call the application everyday $crontab -e 0 1 * * * /scratch/rajeev/cronjob/exachk.sh exachk.sh makes call to my python application as- python3 /opt/oracle.ahf/exachk/exachk.py Yes I am redirecting stdout to- sys.stdout = lib.debugger.Tee("/tmp/exachk_screen_output_061321_23211.log") I am not redirecting stderr anywhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 06:04:31 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 14 Jun 2021 10:04:31 +0000 Subject: [issue44338] Port LOAD_GLOBAL to adaptive interpreter In-Reply-To: <1623089094.6.0.928459069961.issue44338@roundup.psfhosted.org> Message-ID: <1623665071.9.0.0646061650277.issue44338@roundup.psfhosted.org> Mark Shannon added the comment: New changeset eecbc7c3900a7f40d8498b151db543a202c72f74 by Mark Shannon in branch 'main': bpo-44338: Port LOAD_GLOBAL to PEP 659 adaptive interpreter (GH-26638) https://github.com/python/cpython/commit/eecbc7c3900a7f40d8498b151db543a202c72f74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 06:09:16 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Mon, 14 Jun 2021 10:09:16 +0000 Subject: [issue44417] bytecode<>line number mapping seems wrong in 3.10.0b2 Message-ID: <1623665356.44.0.686515764926.issue44417@roundup.psfhosted.org> New submission from Gabriele N Tornetta : I was looking at how the new co_linetable works in order to add initial support for Python 3.10 to Austin (https://github.com/P403n1x87/austin) when I stumbled upon the following interesting output from the dis module. I am using the following test target: https://github.com/P403n1x87/austin/blob/master/test/target34.py When I call python3.10 -m dis target34.py using Python 3.10.0b2 I get ---- 25 0 LOAD_CONST 0 (0) 2 LOAD_CONST 1 (None) 4 IMPORT_NAME 0 (threading) 6 STORE_NAME 0 (threading) 28 8 LOAD_CONST 2 () 10 LOAD_CONST 3 ('keep_cpu_busy') 12 MAKE_FUNCTION 0 14 STORE_NAME 1 (keep_cpu_busy) 36 16 LOAD_NAME 2 (__name__) 18 LOAD_CONST 4 ('__main__') 20 COMPARE_OP 2 (==) 22 POP_JUMP_IF_FALSE 25 (to 50) 37 24 LOAD_NAME 0 (threading) 26 LOAD_ATTR 3 (Thread) 28 LOAD_NAME 1 (keep_cpu_busy) 30 LOAD_CONST 5 (('target',)) 32 CALL_FUNCTION_KW 1 34 LOAD_METHOD 4 (start) 36 CALL_METHOD 0 38 POP_TOP 38 40 LOAD_NAME 1 (keep_cpu_busy) 42 CALL_FUNCTION 0 44 POP_TOP 46 LOAD_CONST 1 (None) 48 RETURN_VALUE 36 >> 50 LOAD_CONST 1 (None) 52 RETURN_VALUE Disassembly of : 29 0 BUILD_LIST 0 2 STORE_FAST 0 (a) 30 4 LOAD_GLOBAL 0 (range) 6 LOAD_CONST 1 (2000000) 8 CALL_FUNCTION 1 10 GET_ITER >> 12 FOR_ITER 21 (to 56) 14 STORE_FAST 1 (i) 31 16 LOAD_FAST 0 (a) 18 LOAD_METHOD 1 (append) 20 LOAD_FAST 1 (i) 22 CALL_METHOD 1 24 POP_TOP 32 26 LOAD_FAST 1 (i) 28 LOAD_CONST 2 (1000000) 30 BINARY_MODULO 32 LOAD_CONST 3 (0) 34 COMPARE_OP 2 (==) 36 POP_JUMP_IF_FALSE 27 (to 54) 33 38 LOAD_GLOBAL 2 (print) 40 LOAD_CONST 4 ('Unwanted output ') 42 LOAD_GLOBAL 3 (str) 44 LOAD_FAST 1 (i) 46 CALL_FUNCTION 1 48 BINARY_ADD 50 CALL_FUNCTION 1 52 POP_TOP >> 54 JUMP_ABSOLUTE 6 (to 12) 30 >> 56 LOAD_CONST 0 (None) 58 RETURN_VALUE ---- Note how the line number is not monotonic. Compare this to the output generated by Python 3.9.5 ---- 25 0 LOAD_CONST 0 (0) 2 LOAD_CONST 1 (None) 4 IMPORT_NAME 0 (threading) 6 STORE_NAME 0 (threading) 28 8 LOAD_CONST 2 () 10 LOAD_CONST 3 ('keep_cpu_busy') 12 MAKE_FUNCTION 0 14 STORE_NAME 1 (keep_cpu_busy) 36 16 LOAD_NAME 2 (__name__) 18 LOAD_CONST 4 ('__main__') 20 COMPARE_OP 2 (==) 22 POP_JUMP_IF_FALSE 46 37 24 LOAD_NAME 0 (threading) 26 LOAD_ATTR 3 (Thread) 28 LOAD_NAME 1 (keep_cpu_busy) 30 LOAD_CONST 5 (('target',)) 32 CALL_FUNCTION_KW 1 34 LOAD_METHOD 4 (start) 36 CALL_METHOD 0 38 POP_TOP 38 40 LOAD_NAME 1 (keep_cpu_busy) 42 CALL_FUNCTION 0 44 POP_TOP >> 46 LOAD_CONST 1 (None) 48 RETURN_VALUE Disassembly of : 29 0 BUILD_LIST 0 2 STORE_FAST 0 (a) 30 4 LOAD_GLOBAL 0 (range) 6 LOAD_CONST 1 (2000000) 8 CALL_FUNCTION 1 10 GET_ITER >> 12 FOR_ITER 42 (to 56) 14 STORE_FAST 1 (i) 31 16 LOAD_FAST 0 (a) 18 LOAD_METHOD 1 (append) 20 LOAD_FAST 1 (i) 22 CALL_METHOD 1 24 POP_TOP 32 26 LOAD_FAST 1 (i) 28 LOAD_CONST 2 (1000000) 30 BINARY_MODULO 32 LOAD_CONST 3 (0) 34 COMPARE_OP 2 (==) 36 POP_JUMP_IF_FALSE 12 33 38 LOAD_GLOBAL 2 (print) 40 LOAD_CONST 4 ('Unwanted output ') 42 LOAD_GLOBAL 3 (str) 44 LOAD_FAST 1 (i) 46 CALL_FUNCTION 1 48 BINARY_ADD 50 CALL_FUNCTION 1 52 POP_TOP 54 JUMP_ABSOLUTE 12 >> 56 LOAD_CONST 0 (None) 58 RETURN_VALUE ---- This problem seems to get reflected in the output generated by Austin. With Python 3.9 I do get the expected traceback: P1539;T1539;/mnt/c/Users/Gabriele/Projects/austin/test/target34.py::38;/mnt/c/Users/Gabriele/Projects/austin/test/target34.py:keep_cpu_busy:32 101003 (note the correct path :38 => keep_cpu_busy:32) but with Python 3.10.0b2 I do get P2064;T2064;/mnt/c/Users/Gabriele/Projects/austin/test/target34.py::36;/mnt/c/Users/Gabriele/Projects/austin/test/target34.py:keep_cpu_busy:32 100511 which is incorrect. What seems to be off is the value of the f_lasti field. The computation that I'm performing to map bytecode to line number produces the following "[start, end) => line number" triplets (the computation stops as soon as end > lasti): (lasti = 21) [0, 8) => 25 [8, 16) => 28 [16, 24) => 36 The computations within the code object for the keep_cpu_busy function look fine: keep_cpu_busy (lasti = 27) [0, 4) => 29 [4, 16) => 30 [16, 26) => 31 [26, 38) => 32 ---------- components: C API messages: 395787 nosy: Gabriele Tornetta priority: normal severity: normal status: open title: bytecode<>line number mapping seems wrong in 3.10.0b2 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 06:20:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 10:20:50 +0000 Subject: [issue43803] ctypes string_at/wstring_at - bad argument name used in docs and in docstring In-Reply-To: <1618106073.56.0.0553736134144.issue43803@roundup.psfhosted.org> Message-ID: <1623666050.02.0.99633307602.issue43803@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 06:48:36 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 14 Jun 2021 10:48:36 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1623667716.17.0.121094947426.issue37224@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +25305 pull_request: https://github.com/python/cpython/pull/26717 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 07:05:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 11:05:30 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623668730.43.0.488098983254.issue41299@roundup.psfhosted.org> STINNER Victor added the comment: I'm fine with adding _PyTime_Init() again, and maybe only implement checks on Windows. On Linux, I only saw a single failure in _PyTime_Init() once, when Python was run in a sandbox, and the time syscalls were not allowed. It was a corner case about the new 64-bit time_t syscalls on a 32-bit system (container): https://bugzilla.redhat.com/show_bug.cgi?id=1887445 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 07:11:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 11:11:07 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623669067.79.0.256028914978.issue41299@roundup.psfhosted.org> STINNER Victor added the comment: > I mention the QueryPerformanceFrequency error case here (stack misalignment): https://bugs.python.org/issue41299#msg395237 Do you think that pytime.c has the bug? I don't think so. > There are three places win_perf_counter_frequency() can fail: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Python/pytime.c#L974 In theory yes, in practice we got zero error reports. So it sounds like it cannot happen. I don't think that it's a good pratice to start to add checks in all functions using a clock "just in case" the clock might fail. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 07:24:59 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 14 Jun 2021 11:24:59 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623669899.95.0.0179283051381.issue44392@roundup.psfhosted.org> Ronald Oussoren added the comment: I'm not working on this. Feel free to work on a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 07:52:07 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 14 Jun 2021 11:52:07 +0000 Subject: [issue44417] bytecode<>line number mapping seems wrong in 3.10.0b2 In-Reply-To: <1623665356.44.0.686515764926.issue44417@roundup.psfhosted.org> Message-ID: <1623671527.19.0.718625917161.issue44417@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:09:09 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 14 Jun 2021 12:09:09 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623672549.38.0.815587390718.issue44337@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25306 pull_request: https://github.com/python/cpython/pull/26718 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:16:23 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 14 Jun 2021 12:16:23 +0000 Subject: [issue38460] 3.8 Release Notes: document asyncio exception changes In-Reply-To: <1570969254.43.0.827620904639.issue38460@roundup.psfhosted.org> Message-ID: <1623672983.46.0.683901951729.issue38460@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:16:18 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 14 Jun 2021 12:16:18 +0000 Subject: [issue38460] 3.8 Release Notes: document asyncio exception changes In-Reply-To: <1570969254.43.0.827620904639.issue38460@roundup.psfhosted.org> Message-ID: <1623672978.06.0.265851462745.issue38460@roundup.psfhosted.org> Sebastian Rittau added the comment: Closing per the comments by Andrew and Raymond and the fact that 3.8 has been released for quite some while now. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:21:13 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 14 Jun 2021 12:21:13 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation Message-ID: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> New submission from Miro Hron?ok : In bpo-42157, the unicodedata.ucnhash_CAPI attribute was removed without deprecation. This breaks at least https://github.com/dgrunwald/rust-cpython with: AttributeError: module 'unicodedata' has no attribute 'ucnhash_CAPI' Please revert the removal and deprecate the attribute for 2 Python releases if you want to remove it. Thanks ---------- components: Library (Lib) messages: 395792 nosy: hroncok, vstinner priority: normal severity: normal status: open title: unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:23:05 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Mon, 14 Jun 2021 12:23:05 +0000 Subject: [issue44417] bytecode<>line number mapping and f_lasti seem wrong in 3.10.0b2 In-Reply-To: <1623665356.44.0.686515764926.issue44417@roundup.psfhosted.org> Message-ID: <1623673385.83.0.798089906389.issue44417@roundup.psfhosted.org> Change by Gabriele N Tornetta : ---------- title: bytecode<>line number mapping seems wrong in 3.10.0b2 -> bytecode<>line number mapping and f_lasti seem wrong in 3.10.0b2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:43:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 14 Jun 2021 12:43:51 +0000 Subject: [issue44415] sys.stdout.flush and print() hanging In-Reply-To: <1623645412.68.0.708640835339.issue44415@roundup.psfhosted.org> Message-ID: <1623674631.09.0.557023326599.issue44415@roundup.psfhosted.org> Serhiy Storchaka added the comment: I do not know what are lib.logger.Log and lib.debugger.Tee, but I guess that lib.logger.Log() creates a logger which writes to sys.stdout, and lib.debugger.Tee() is a file-like object which writes to the specified file and to standard output. Standard output of your program is not consumed, so your program writes to it until fill the buffer and then hangs. Add >/dev/null 2>/dev/null at the end of the command in cronjob to redirect stdout and stderr. This issue is not specific for Python, you can get the same issue with any program which outputs to stdout or stderr. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:57:09 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 14 Jun 2021 12:57:09 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623675429.15.0.666921273923.issue38291@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- pull_requests: +25307 pull_request: https://github.com/python/cpython/pull/26719 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 08:58:03 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 14 Jun 2021 12:58:03 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623675483.74.0.293582540798.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: And I opened a second PR (for Python 3.11 only) to issue a deprecation warning when typing.io or typing.re gets imported. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 09:19:13 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 14 Jun 2021 13:19:13 +0000 Subject: [issue44417] bytecode<>line number mapping and f_lasti seem wrong in 3.10.0b2 In-Reply-To: <1623665356.44.0.686515764926.issue44417@roundup.psfhosted.org> Message-ID: <1623676753.08.0.106403597063.issue44417@roundup.psfhosted.org> Mark Shannon added the comment: What does "seem wrong" mean? What exactly is the problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 09:43:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 13:43:56 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623678236.95.0.843131401845.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 809c3faa032d32bc45a0fa54d0400fcbc42a618f by Miss Islington (bot) in branch '3.10': bpo-44310: Note that lru_cache keep references to both arguments and results (GH-26715) (GH-26716) https://github.com/python/cpython/commit/809c3faa032d32bc45a0fa54d0400fcbc42a618f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 09:45:34 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 14 Jun 2021 13:45:34 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623678333.99.0.244961042917.issue44283@roundup.psfhosted.org> Mark Shannon added the comment: This is going in the wrong direction. Rather than add more complex instructions for use only by pattern matching, we need to simplify the individual operations and re-use existing instructions. That way pattern matching can benefit from the general performance improvements that we are making. If you are serious about improving the performance of pattern matching, you need to do the following in the compiler: 1. Generate a decision tree. 2. Improve that decision tree so that fewer decisions are required. 3. Generate bytecode from that tree that uses lower level operations. E.g. match x: case [1]: A case [2]: B The initial decision tree looks like: if is_sequence(x): if len(x) == 1: if x[0] == 1: A if is_sequence(x): if len(x) == 1: if x[0] == 2: B which can be improved to: if is_sequence(x): if len(x) == 1: if x[0] == 1: A elif x[0] == 2: B For a sequence of integer constants, introducing the test `type(x) == int` at the start would allow you to convert the linear sequence of tests into a tree. Reducing `n` tests to `ln(n) + 1` tests. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:04:18 2021 From: report at bugs.python.org (Abbas Baharforoosh) Date: Mon, 14 Jun 2021 14:04:18 +0000 Subject: [issue44419] Wrong division calculation for numbers more than 16 digits Message-ID: <1623679458.04.0.92278906874.issue44419@roundup.psfhosted.org> New submission from Abbas Baharforoosh : Hi For big numbers (more than about 16 digits), python wrong calculate division, but calculating mod (%) is correct. I write a sample code of manual division in file. Thanks ---------- files: big_number.py messages: 395798 nosy: abahar1996 priority: normal severity: normal status: open title: Wrong division calculation for numbers more than 16 digits versions: Python 3.9 Added file: https://bugs.python.org/file50108/big_number.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Jun 2021 14:45:27 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1623681927.48.0.264433303264.issue35089@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8a76683cfb842e12b57f6d276839f6c68fd94e1a by Sebastian Rittau in branch 'main': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/8a76683cfb842e12b57f6d276839f6c68fd94e1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 14:45:33 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623681933.88.0.396737021417.issue38291@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25310 pull_request: https://github.com/python/cpython/pull/26721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:28 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 14:45:28 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1623681928.68.0.964015486177.issue35089@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25309 pull_request: https://github.com/python/cpython/pull/26720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Jun 2021 14:45:27 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623681927.58.0.66042186167.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8a76683cfb842e12b57f6d276839f6c68fd94e1a by Sebastian Rittau in branch 'main': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/8a76683cfb842e12b57f6d276839f6c68fd94e1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:28 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 14:45:28 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623681928.58.0.254227644344.issue38291@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25308 pull_request: https://github.com/python/cpython/pull/26720 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:45:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 14:45:33 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1623681933.98.0.241262869938.issue35089@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25311 pull_request: https://github.com/python/cpython/pull/26721 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 10:53:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 14 Jun 2021 14:53:00 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623682380.41.0.971322522536.issue44418@roundup.psfhosted.org> Erlend E. Aasland added the comment: It's not removed, it's renamed (by 84f7382215b9e024a5590454726b6ae4b0ca70a0, GH-22994, bpo-42157). You can access it using the '_ucnhash_CAPI' attribute. ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:06:37 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 15:06:37 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1623683197.07.0.126350102401.issue35089@roundup.psfhosted.org> miss-islington added the comment: New changeset fc310cb862ce0411bb5daed37f7f31b75647495b by Miss Islington (bot) in branch '3.10': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/fc310cb862ce0411bb5daed37f7f31b75647495b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:06:37 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 15:06:37 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623683197.14.0.59201232126.issue38291@roundup.psfhosted.org> miss-islington added the comment: New changeset fc310cb862ce0411bb5daed37f7f31b75647495b by Miss Islington (bot) in branch '3.10': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/fc310cb862ce0411bb5daed37f7f31b75647495b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:07:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 15:07:08 +0000 Subject: [issue35089] Remove typing.io and typing.re from documentation In-Reply-To: <1540726823.63.0.788709270274.issue35089@psf.upfronthosting.co.za> Message-ID: <1623683228.88.0.0269055599369.issue35089@roundup.psfhosted.org> miss-islington added the comment: New changeset 7f021952b2debb51306f70ec96a94ecc7fbffc19 by Miss Islington (bot) in branch '3.9': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/7f021952b2debb51306f70ec96a94ecc7fbffc19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:07:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 15:07:08 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1623683228.94.0.656616195124.issue38291@roundup.psfhosted.org> miss-islington added the comment: New changeset 7f021952b2debb51306f70ec96a94ecc7fbffc19 by Miss Islington (bot) in branch '3.9': bpo-38291: Remove mention of typing.io and typing.re again (GH-26113) https://github.com/python/cpython/commit/7f021952b2debb51306f70ec96a94ecc7fbffc19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:13:22 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 14 Jun 2021 15:13:22 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623683601.99.0.359447448805.issue44418@roundup.psfhosted.org> Miro Hron?ok added the comment: Right. Nevertheless, the reaming has effectively removed the old name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 11:30:42 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 14 Jun 2021 15:30:42 +0000 Subject: [issue44419] Wrong division calculation for numbers more than 16 digits In-Reply-To: <1623679458.04.0.92278906874.issue44419@roundup.psfhosted.org> Message-ID: <1623684642.73.0.833145672469.issue44419@roundup.psfhosted.org> Zachary Ware added the comment: The `/` operator does true division, which means the result will be a `float` rather than an `int`. When the resultant float is large enough, precision will be lost. You can use the `//` operator for floor (integer) division, where the result will remain as an integer. ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:23:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 16:23:22 +0000 Subject: [issue42387] Pdb should restore the execution environment before reexecuting the target In-Reply-To: <1605614068.9.0.0418270403043.issue42387@roundup.psfhosted.org> Message-ID: <1623687802.85.0.406585922564.issue42387@roundup.psfhosted.org> Irit Katriel added the comment: I recently fixed a bug where breakpoints were not saved properly between reruns of the program - the assumption there was that if you set a breakpoint you don't want to have to set it again and again. Similarly, how do you know that the change to sys.path was made by the program rather than by a user from the debugger prompt? It is easy enough to reset the state (just start a new debugger session) but if you want to restart the program with the env as it currently is, and you can't, it can be very annoying to have to re-apply all your settings again. ---------- nosy: +iritkatriel type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:34:00 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 14 Jun 2021 16:34:00 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623688440.51.0.0817537695348.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: Sorry, I?ve been out on vacation this weekend. I didn?t realize that there was already a PR for this? I?m honestly not sure that it?s totally ready yet. While I absolutely agree that compiling efficient decision trees lies in our future, it certainly seems to me that using *both* strategies (decision trees and jump tables) would create the most efficient branching structure. In effect, our control flow would be a rose tree. In your example, Mark, we could perform the checks for the integers 1 and 2 simultaneously, right? Or consider a slightly more complicated example (simplified from PEP 636): match ?: case ["quit"]: ? case ["look"]: ? case ["get", obj]: ? case ["go", direction]: ? We could compile this to something like: - Check for Sequence. - Multi-way jump on length. - Multi-way jump on first item. ?which looks ideal to me. I?m also confident that the jumping ops could also be broken up into fairly primitive instructions. A multi-way branch would just look something like: (subject on TOS) LOAD_CONST() ROT_TWO BINARY_SUBSCR JUMP_FORWARD_TOS ?where only JUMP_FORWARD_TOS is new. > For a sequence of integer constants, introducing the test `type(x) == int` at the start would allow you to convert the linear sequence of tests into a tree. Reducing `n` tests to `ln(n) + 1` tests. Sorry, I?m having a bit of difficulty following this part. Is it something like the strategy I just described? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:37:27 2021 From: report at bugs.python.org (Jacob Walls) Date: Mon, 14 Jun 2021 16:37:27 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623688647.65.0.558839530845.issue44242@roundup.psfhosted.org> Jacob Walls added the comment: With the followup patch merged, can this be closed now? ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:46:20 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 16:46:20 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623689180.7.0.948974731669.issue44409@roundup.psfhosted.org> Change by miss-islington : ---------- keywords: +patch nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25312 pull_request: https://github.com/python/cpython/pull/26722 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:46:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 14 Jun 2021 16:46:32 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623689192.94.0.739786084375.issue44409@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 507ed6fa1d6661e0f8e6d3282764aa9625a99594 by Pablo Galindo in branch 'main': bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712) https://github.com/python/cpython/commit/507ed6fa1d6661e0f8e6d3282764aa9625a99594 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 12:49:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 14 Jun 2021 16:49:01 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623689341.26.0.739906827782.issue44409@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25313 pull_request: https://github.com/python/cpython/pull/26723 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:00:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 17:00:45 +0000 Subject: [issue25682] __package__ not set to None under pdb in Python 3 In-Reply-To: <1448035339.32.0.969832659097.issue25682@psf.upfronthosting.co.za> Message-ID: <1623690045.68.0.573874385932.issue25682@roundup.psfhosted.org> Irit Katriel added the comment: pdb imports the module with importlib, and populates __main__ with data from its spec, including the package. This doesn't contradict the fact that the python command line can have only one "-m". What is the actual problem here? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:02:35 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 14 Jun 2021 17:02:35 +0000 Subject: [issue44283] Add jump table for certain safe match-case statements In-Reply-To: <1622584692.02.0.792244992516.issue44283@roundup.psfhosted.org> Message-ID: <1623690155.71.0.686252810533.issue44283@roundup.psfhosted.org> Brandt Bucher added the comment: Also (because some of the people who might be interested are nosied on this issue), I?ve been working a bit on general performance benchmarks for our pattern-matching implementation: https://github.com/brandtbucher/patmaperformance I still need something that hits sequence patterns hard, but I think these will help give us a good baseline for measuring future perf work in this area. (There?s also the perf script at the bottom of Lib/test/test_patma.py, but the test cases it runs on probably are much less representative of ?real? code.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:08:00 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 17:08:00 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623690480.12.0.689011532865.issue44409@roundup.psfhosted.org> miss-islington added the comment: New changeset 133cddf76e8265536c584872351c191e3afd66a2 by Miss Islington (bot) in branch '3.10': bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712) https://github.com/python/cpython/commit/133cddf76e8265536c584872351c191e3afd66a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:08:00 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 14 Jun 2021 17:08:00 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623690480.12.0.689011532865.issue44409@roundup.psfhosted.org> miss-islington added the comment: New changeset 133cddf76e8265536c584872351c191e3afd66a2 by Miss Islington (bot) in branch '3.10': bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712) https://github.com/python/cpython/commit/133cddf76e8265536c584872351c191e3afd66a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:08:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 14 Jun 2021 17:08:00 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623690480.22.0.27152281123.issue44409@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0d0a9eaa822658679cc2b65f125ab74bfd4aedfe by Pablo Galindo in branch '3.9': [3.9] bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712). (GH-26723) https://github.com/python/cpython/commit/0d0a9eaa822658679cc2b65f125ab74bfd4aedfe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:09:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 17:09:38 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623690578.37.0.693700451886.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I forgot about this issue. Let me rebuild the context. Copy of the What's New in Python 3.10 entry: "Removed the unicodedata.ucnhash_CAPI attribute which was an internal PyCapsule object. The related private _PyUnicode_Name_CAPI structure was moved to the internal C API. (Contributed by Victor Stinner in bpo-42157.)" The C API changes. Python <= 3.9: typedef struct { /* Size of this struct */ int size; /* Get name for a given character code. Returns non-zero if success, zero if not. Does not set Python exceptions. If self is NULL, data come from the default version of the database. If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, int with_alias_and_seq); /* Get character code for a given name. Same error handling as for getname. */ int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, int with_named_seq); } _PyUnicode_Name_CAPI; Python >= 3.10: typedef struct { /* Get name for a given character code. Returns non-zero if success, zero if not. Does not set Python exceptions. */ int (*getname)(Py_UCS4 code, char* buffer, int buflen, int with_alias_and_seq); /* Get character code for a given name. Same error handling as for getname(). */ int (*getcode)(const char* name, int namelen, Py_UCS4* code, int with_named_seq); } _PyUnicode_Name_CAPI; Changes: * _PyUnicode_Name_CAPI.size was removed * getname and getcode functions have no more "self" argument There was also a "void *state" parameter in commit https://github.com/python/cpython/commit/47e1afd2a1793b5818a16c41307a4ce976331649 but it was removed later. In Python, it's used in two places: * unicodeobject.c: "\N{...}" format to get a code point by its name * codecs.c: PyCodec_NameReplaceErrors(), "namereplace" error handler Both used self=NULL in Python 3.9. It was simpler to remove the C API rather than trying to keep backward compatibility. The problem was to support the "self" parameter. See the comment: --- // Check if self is an unicodedata.UCD instance. // If self is NULL (when the PyCapsule C API is used), return 0. // PyModule_Check() is used to avoid having to retrieve the ucd_type. // See unicodedata_functions comment to the rationale of this macro. #define UCD_Check(self) (self != NULL && !PyModule_Check(self)) --- In my PR, I wrote: "I prefer to merge this early in the 3.10 dev cycle, to increase chances of getting early user feedback if this change breaks 3rd party applications. Thanks for the review @methane. Usually, features require 2 Python release to be removed, with a deprecation first. But this specific case is really weird. I chose to remove it immediately. IMO it was exposed in public "by mistake", whereas a private attribute would be enough for internal usage." https://github.com/python/cpython/pull/22994#issuecomment-716958371 ---------- nosy: +koubaa, methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:15:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 17:15:19 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623690919.24.0.172751712632.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: > This breaks at least https://github.com/dgrunwald/rust-cpython When I search for "ucnhash_CAPI" in the GitHub search, I only find commented code: https://github.com/dgrunwald/rust-cpython/blob/b63d691addc978952380a8eb146d01a444e16e7a/src/objects/capsule.rs Does rust-cpython generate code? Do you have more details about the error? How does it use unicodedata.ucnhash_CAPI? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:18:15 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 14 Jun 2021 17:18:15 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623691095.02.0.329113297983.issue44392@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +25314 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26724 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:25:40 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Mon, 14 Jun 2021 17:25:40 +0000 Subject: [issue44417] bytecode<>line number mapping and f_lasti seem wrong in 3.10.0b2 In-Reply-To: <1623665356.44.0.686515764926.issue44417@roundup.psfhosted.org> Message-ID: <1623691540.91.0.469237282351.issue44417@roundup.psfhosted.org> Gabriele N Tornetta added the comment: I think I managed to find the source of the confusion. This seems to be due to https://github.com/python/cpython/commit/fcb55c0037baab6f98f91ee38ce84b6f874f034a, with the f_lasti from the C struct now being half of the value returned by the f_lasti attribute of the frame object (is this documented somewhere?). ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:27:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 14 Jun 2021 17:27:22 +0000 Subject: [issue44409] compile raises SyntaxError with undocumented lineno attribute None In-Reply-To: <1623583516.06.0.84402770903.issue44409@roundup.psfhosted.org> Message-ID: <1623691642.62.0.306507640552.issue44409@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 Jun 14 13:28:54 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 14 Jun 2021 17:28:54 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623691734.3.0.968277380474.issue44418@roundup.psfhosted.org> Miro Hron?ok added the comment: All details I have about rust-cpython are that it fails tests with: AttributeError: module 'unicodedata' has no attribute 'ucnhash_CAPI' See the test failures in https://koschei.fedoraproject.org/package/rust-cpython e.g.: ---- src/objects/capsule.rs - objects::capsule::PyCapsule (line 34) stdout ---- Test executable failed (exit code 101). stderr: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr { ptype: , pvalue: Some(AttributeError("module 'unicodedata' has no attribute 'ucnhash_CAPI'")), ptraceback: None }', src/objects/capsule.rs:77:2 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ---- src/objects/capsule.rs - py_capsule (line 232) stdout ---- Test executable failed (exit code 101). stderr: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr { ptype: , pvalue: Some(AttributeError("module 'unicodedata' has no attribute 'ucnhash_CAPI'")), ptraceback: None }', src/objects/capsule.rs:73:47 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: src/objects/capsule.rs - objects::capsule::PyCapsule (line 34) src/objects/capsule.rs - py_capsule (line 232) (Note that there are also other failures regarding an implicit float->int conversion, but they seem to be caused by a change that followed the deprecation period.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:30:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 17:30:02 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623691802.69.0.0259820177359.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: The UCD_Check() issue was discussed in Mohamed Koubaa's PRs: * https://github.com/python/cpython/pull/22145 (closed) <= HERE * https://github.com/python/cpython/pull/22328 (merged) * https://github.com/python/cpython/pull/22490 (closed) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:32:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 17:32:21 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623691941.61.0.896476427368.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: > (Note that there are also other failures regarding an implicit float->int conversion, but they seem to be caused by a change that followed the deprecation period.) Does it mean that rust-cpython was broken in Python 3.10 even if a change was prepared with a deprecation period if Python 3.9? Does it mean that the deprecation period was inefficient on this project? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:33:33 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Jun 2021 17:33:33 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623692013.48.0.0558510818805.issue44392@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, maybe it was a mistake to expose this? Remind me what use is made of this from C code? Can we remove this from the stable API during beta? It was never exposed before. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:38:12 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 14 Jun 2021 17:38:12 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623692292.7.0.290220978033.issue44418@roundup.psfhosted.org> Miro Hron?ok added the comment: > Does it mean that rust-cpython was broken in Python 3.10 even if a change was prepared with a deprecation period if Python 3.9? Does it mean that the deprecation period was inefficient on this project? I don't see any deprecation warning when running the test suite with Python 3.9 and I am unsure what exactly changed there. My assumption is that it might be related to PyNumber_Long not taking floats any more and I am unsure that this particular thing omitted deprecation warnings. Still investigating. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:46:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 17:46:19 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623692779.79.0.433679399771.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: If we decide to restore the C API to the Python 3.9 C API, *all* changes done in the unicodedata in Python 3.10 should be reverted, since early changes already changed/broke the C API, and following changes rely on that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:51:07 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 14 Jun 2021 17:51:07 +0000 Subject: [issue44419] Wrong division calculation for numbers more than 16 digits In-Reply-To: <1623679458.04.0.92278906874.issue44419@roundup.psfhosted.org> Message-ID: <1623693067.38.0.805494723739.issue44419@roundup.psfhosted.org> Steven D'Aprano added the comment: Also please read this: https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:51:57 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 14 Jun 2021 17:51:57 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623693117.47.0.172934782851.issue44392@roundup.psfhosted.org> Jelle Zijlstra added the comment: It could be useful for C extensions that want to support PEP 585 for their types, such as numpy's array type. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:58:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Jun 2021 17:58:37 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623693517.47.0.190366986212.issue44392@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, but is that what they are doing? I assume that they use stub files, since static type checkers don?t introspect the runtime API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 13:58:42 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 14 Jun 2021 17:58:42 +0000 Subject: [issue44402] Python 3.9 and 3.10 fails to install in WINE In-Reply-To: <1623476412.99.0.399943466578.issue44402@roundup.psfhosted.org> Message-ID: <1623693522.68.0.206269546323.issue44402@roundup.psfhosted.org> Steve Dower added the comment: WINE is not a platform that we officially support, and for the installer, I'm willing to say that we never will. Our installer is based on the WiX Toolset, so anything that can be fixed will have to be fixed by them first. It's possible that they have already fixed whatever broke between those releases and we just need to update the version we're using, but a detailed report is not going to help us as we don't control that code. If you download the package from https://www.nuget.org/packages/python/ (either using the Nuget CLI tool or directly from the page), you should be able to just extract and run it on WINE (at least as well as WINE can support it, which is up to them rather than us, but at least any specific issues in CPython we can work around if necessary). ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:00:09 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 14 Jun 2021 18:00:09 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623693609.36.0.152986192271.issue44392@roundup.psfhosted.org> Jelle Zijlstra added the comment: They'd still need runtime support from GenericAlias to allow users to write `numpy.ndarray[int]` at runtime. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:00:51 2021 From: report at bugs.python.org (Douglas Thor) Date: Mon, 14 Jun 2021 18:00:51 +0000 Subject: [issue44420] Add CapWords classes to datetime module? Message-ID: <1623693651.24.0.820963890692.issue44420@roundup.psfhosted.org> New submission from Douglas Thor : Has there been any discussion on adding CapWords class names to the datetime.py module? I searched through the bug tracker ("CapWords" and "CamelCase") and didn't find anything, but perhaps I'm not searching for the correct keywords. Eg: ``` # datetime.py class datetime: ... class tzinfo: ... ... DateTime = datetime TzInfo = tzinfo TimeZone = timezone TimeDelta = timedelta ... ``` I'd imaging implementing this would be pretty trivial and wouldn't break any existing functionality. I'd be happy to implement it. Benefits: + Starts down the road to naming conventions found in pep8. + Maybe makes discovery easier for new users? It can be confusing for new users when the same word "datetime" can refer to either a class or a module. + Can start a deprecation process for the all-lowercase class names if so desired (actually doing so is outside the scope of this discussion) + Makes it easy, at a glance, to tell if code is referring to `datetime` the module or `DateTime` the class. Downsides: - fragments future usage: there will be a split between people using `DateTime` and `datetime`. This makes it hard to do things like mass grep over codebase. - "If it ain't broke, don't fix it" - ??? ---------- components: Library (Lib) messages: 395830 nosy: dougthor42 priority: normal severity: normal status: open title: Add CapWords classes to datetime module? 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 Mon Jun 14 14:02:31 2021 From: report at bugs.python.org (Douglas Thor) Date: Mon, 14 Jun 2021 18:02:31 +0000 Subject: [issue34025] SMTP EmailPolicy not using the correct line length for RCF 2045 encoded data (is 78, should be 76) In-Reply-To: <1530548294.1.0.56676864532.issue34025@psf.upfronthosting.co.za> Message-ID: <1623693751.39.0.977687082684.issue34025@roundup.psfhosted.org> Change by Douglas Thor : ---------- nosy: +dougthor42 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:03:15 2021 From: report at bugs.python.org (Douglas Thor) Date: Mon, 14 Jun 2021 18:03:15 +0000 Subject: [issue34025] SMTP EmailPolicy not using the correct line length for RCF 2045 encoded data (is 78, should be 76) In-Reply-To: <1530548294.1.0.56676864532.issue34025@psf.upfronthosting.co.za> Message-ID: <1623693795.96.0.191196924066.issue34025@roundup.psfhosted.org> Change by Douglas Thor : ---------- nosy: -Douglas Thor _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:04:19 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 14 Jun 2021 18:04:19 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623693859.24.0.126171267485.issue44392@roundup.psfhosted.org> Ken Jin added the comment: > maybe it was a mistake to expose this I was wondering if this was accidentally added at the time too. > Remind me what use is made of this from C code It's required for a C extension type to implement the __class_getitem__ method properly. Eg. ``MyCType[int]``. The other alternative is for them to import the types.GenericAlias Python constructor and call that, but that seems strange. > Can we remove this from the stable API during beta? It was never exposed before. Unfortunately, it seems like it has been (accidentally?) exposed since 3.9 :(. I see some 3rd party projects using it already, so I don't know if we can get rid of it so easily: https://github.com/Nuitka/Nuitka/blob/57fecfe6cc939f4694b57d2efa37d1893c06b85b/nuitka/build/include/nuitka/helper/subscripts.h#L97 CC-ing Petr, seeking advice on the C stable ABI for this please. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:06:06 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 14 Jun 2021 18:06:06 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623693966.34.0.178538823094.issue44392@roundup.psfhosted.org> Guido van Rossum added the comment: Maybe the docs then should contain a more-or-less complete example showing how a 3rd party type should use this? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:06:34 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 14 Jun 2021 18:06:34 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623693994.51.0.746270151748.issue43475@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +25315 pull_request: https://github.com/python/cpython/pull/26725 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:15:42 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 14 Jun 2021 18:15:42 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623694542.5.0.0279223969226.issue44392@roundup.psfhosted.org> Ken Jin added the comment: (Copied over from the PR) BTW, I also noticed the stable ABI manifest exposes the wrong return type for Py_GenericAliasType. It exposes it as a function when it's a var/type/struct. So I fixed that in the PR too otherwise the docs weren't compiling (I can split that into a separate PR if needed). But that means the exported symbol for Windows is also modified. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:19:53 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 14 Jun 2021 18:19:53 +0000 Subject: [issue44420] Add CapWords classes to datetime module? In-Reply-To: <1623693651.24.0.820963890692.issue44420@roundup.psfhosted.org> Message-ID: <1623694793.32.0.436076906075.issue44420@roundup.psfhosted.org> Eric V. Smith added the comment: Changing versions: this could only be added to 3.11. I think the ship has sailed on this. The old names could never be removed so we'd have to support both names forever. I think it's not worth the hassle. ---------- nosy: +eric.smith versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:37:13 2021 From: report at bugs.python.org (Ryan Hileman) Date: Mon, 14 Jun 2021 18:37:13 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623695833.02.0.0461741900881.issue41299@roundup.psfhosted.org> Ryan Hileman added the comment: > Do you think that pytime.c has the bug? I don't think so. No, a misaligned stack would be an issue in the caller or compiler, not pytime.c. I have hit misaligned stack in practice, but it should be rare enough to check on init only. > In theory yes, in practice we got zero error reports. So it sounds like it cannot happen. > I don't think that it's a good practice to start to add checks in all functions using a clock "just in case" the clock might fail. My read is that as long as we're not confident enough to remove those checks from pytime.c, a caller should assume they're reachable. If the pytime checks need to stay, adding a Windows only pytime init check to make sure that locks won't deadlock sounds fine to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:47:03 2021 From: report at bugs.python.org (Christian Kleineidam) Date: Mon, 14 Jun 2021 18:47:03 +0000 Subject: [issue44421] random.uniform() hangs will eating up all available RAM Message-ID: <1623696423.1.0.630569105584.issue44421@roundup.psfhosted.org> New submission from Christian Kleineidam : I'm writing a model that needs a lot of random numbers. The model counts up to "Year:640: Count:1339" (taking around two minutes) and then hangs on random.uniform(0, 1). While it hangs, the amount of RAM python takes grows till it eats up all available RAM with RAM usage growing by around 100 MB per second. I'm running Windows 10 and the error appears in both Python 3.8.8 as well as in 3.9.5. I'm attaching a file that reproduces the error. File "C:\Users\Christian\folder\obfuscated.py", line 427, in population = population.next() File "C:\Users\Christian\folder\obfuscated.py", line 385, in next return Class4(self.nextClass4) File "C:\Users\Christian\folder\obfuscated.py", line 280, in __init__ var42.var30() File "C:\Users\Christian\folder\obfuscated.py", line 177, in var30 var22.var30(self.var17,self.var18,self.var21) File "C:\Users\Christian\folder\obfuscated.py", line 100, in var30 self.barClass1s.append(var23.child()) File "C:\Users\Christian\folder\obfuscated.py", line 29, in child if var6>random.uniform(0, 1): File "C:\Progs\anaconda3\lib\random.py", line 417, in uniform return a + (b-a) * self.random() ---------- components: Library (Lib) files: obfuscated.py messages: 395836 nosy: Christian.Kleineidam priority: normal severity: normal status: open title: random.uniform() hangs will eating up all available RAM versions: Python 3.9 Added file: https://bugs.python.org/file50109/obfuscated.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 14:54:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 14 Jun 2021 18:54:32 +0000 Subject: [issue44369] Improve syntax error for wrongly closed strings In-Reply-To: <1623273352.85.0.523852871256.issue44369@roundup.psfhosted.org> Message-ID: <1623696872.25.0.0225706679066.issue44369@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: One problem with that is that the lookahead will move the error indicator to some incorrect place if the match fails. For example: PYTHON3.9 >>> "dfssdfsdfsd" fdsf sdfsdfsd {} File "", line 1 "dfssdfsdfsd" fdsf sdfsdfsd {} ^ SyntaxError: invalid syntax with this PR: >>> "dfssdfsdfsd" fdsf sdfsdfsd {} File "", line 1 "dfssdfsdfsd" fdsf sdfsdfsd {} ^ SyntaxError: invalid syntax We need a solution to this problem first ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:05:28 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 14 Jun 2021 19:05:28 +0000 Subject: [issue44242] enum.IntFlag regression: missing values cause TypeError In-Reply-To: <1622057503.27.0.852704547544.issue44242@roundup.psfhosted.org> Message-ID: <1623697528.26.0.307535494643.issue44242@roundup.psfhosted.org> Ethan Furman added the comment: Yup, just had to get back from the weekend. :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:19:10 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 14 Jun 2021 19:19:10 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623698350.26.0.466817716347.issue38323@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: -25270 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:19:34 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 14 Jun 2021 19:19:34 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1623698374.29.0.457723846284.issue38323@roundup.psfhosted.org> Change by Jack DeVries : ---------- nosy: -jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:26:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 14 Jun 2021 19:26:38 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623698798.6.0.689742894556.issue44392@roundup.psfhosted.org> Petr Viktorin added the comment: > Can we remove this from the stable API during beta? It was added (to PC/python3.def) in 3.9, so removing in 3.10 beta wouldn't be good. It can be deprecated; should it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:28:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 19:28:17 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623698897.78.0.530602353053.issue44418@roundup.psfhosted.org> STINNER Victor added the comment: > https://github.com/dgrunwald/rust-cpython/blob/b63d691addc978952380a8eb146d01a444e16e7a/src/objects/capsule.rs A friend explained me that it's a doctest and unicodedata.ucnhash_CAPI was picked as an example, but any other capsule could be used to test the Capsule API of rust-cpython. rust-cpython doesn't use unicodedata.ucnhash_CAPI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:32:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 14 Jun 2021 19:32:10 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623699130.43.0.335247766403.issue44418@roundup.psfhosted.org> Erlend E. Aasland added the comment: Sounds like an easy solution is to open an issue/PR against rust-cpython to update the doctest, IMO. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:41:38 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 14 Jun 2021 19:41:38 +0000 Subject: [issue44421] random.uniform() hangs will eating up all available RAM In-Reply-To: <1623696423.1.0.630569105584.issue44421@roundup.psfhosted.org> Message-ID: <1623699698.91.0.603572583185.issue44421@roundup.psfhosted.org> Jack DeVries added the comment: This doesn't look like a bug. It's hard to disentangle what your code is doing, exactly, but it's most likely that between all your nested loops and classes initializing each other, there is an exponential or greater growth in time complexity happening. As your input values grow, the program slows down at an exponential rate until it appears to just "hang". The RAM is growing because the program hasn't really stopped running, it's just dutifully chugging along and filling up more and more memory, and if you waited long enough the program would either crash having run out of memory or maybe the program would complete in a very, very long time. I hope I'm not missing something; feel free to let me know, or share a more minimal example to reproduce the issue. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:47:01 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Mon, 14 Jun 2021 19:47:01 +0000 Subject: [issue44418] unicodedata.ucnhash_CAPI removed from Python 3.10 without deprecation In-Reply-To: <1623673273.47.0.342389136094.issue44418@roundup.psfhosted.org> Message-ID: <1623700021.52.0.527082776535.issue44418@roundup.psfhosted.org> Miro Hron?ok added the comment: Updating the doctest is certainly a good solution for this particular project. However I still think this regression deserves to be resolved. This was part of the API, whether intended or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 15:49:30 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 14 Jun 2021 19:49:30 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623700170.8.0.625504768813.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25316 pull_request: https://github.com/python/cpython/pull/26726 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:04:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:04:45 +0000 Subject: [issue31289] File paths in exception traceback resolve symlinks In-Reply-To: <1503865076.7.0.858933592926.issue31289@psf.upfronthosting.co.za> Message-ID: <1623701085.71.0.473964521612.issue31289@roundup.psfhosted.org> Irit Katriel added the comment: Closing as there doesn't seem to be interest in this currently. If you would like to pursue it, please bring it up for discussion on python-ideas. The semantics you request are not the only obvious option, so this needs to be agreed. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:06:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:06:16 +0000 Subject: [issue31248] method wrapper type has invalid __name__/__qualname__ 'method-wrapper' In-Reply-To: <1503330859.0.0.694490112113.issue31248@psf.upfronthosting.co.za> Message-ID: <1623701176.09.0.855073298776.issue31248@roundup.psfhosted.org> Irit Katriel added the comment: Closing as it's not clear what the problem is. Please reopen or create a new issue if you can explain. ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:06:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:06:59 +0000 Subject: [issue3014] file_dealloc() assumes errno is set when EOF is returned In-Reply-To: <1212184451.2.0.27521352304.issue3014@psf.upfronthosting.co.za> Message-ID: <1623701219.3.0.668740301143.issue3014@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:09:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:09:10 +0000 Subject: [issue29799] Add tests for header API of 'urllib.request.Request' class In-Reply-To: <1489357967.78.0.336863380753.issue29799@psf.upfronthosting.co.za> Message-ID: <1623701350.94.0.622681497443.issue29799@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this seems abandoned. Please reopen or create a new issue if you would like to continue working on it. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:17:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:17:01 +0000 Subject: [issue7089] shlex behaves unexpected if newlines are not whitespace In-Reply-To: <1255075914.03.0.04545559487.issue7089@psf.upfronthosting.co.za> Message-ID: <1623701821.79.0.700679422007.issue7089@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:18:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 20:18:08 +0000 Subject: [issue7089] shlex behaves unexpected if newlines are not whitespace In-Reply-To: <1255075914.03.0.04545559487.issue7089@psf.upfronthosting.co.za> Message-ID: <1623701888.28.0.506132939959.issue7089@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced on 3.11. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 16:52:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 20:52:29 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1623703949.64.0.408900047802.issue41299@roundup.psfhosted.org> STINNER Victor added the comment: > My read is that as long as we're not confident enough to remove those checks from pytime.c, a caller should assume they're reachable. If the pytime checks need to stay, adding a Windows only pytime init check to make sure that locks won't deadlock sounds fine to me. If you consider that the risk is non-zero, you can add a check at startup. Do you expect that a startup check is enough, or do you expect failures later? I understood that if the first call succeed, later calls are very unlikely to fail. The first call should be enough to check for all possible errors. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:10:46 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 14 Jun 2021 21:10:46 +0000 Subject: [issue44328] time.monotonic() should use a different clock source on Windows In-Reply-To: <1623017107.78.0.286257337073.issue44328@roundup.psfhosted.org> Message-ID: <1623705046.84.0.833583863444.issue44328@roundup.psfhosted.org> Eryk Sun added the comment: >> Try changing EnterNonRecursiveMutex() to break out of the loop in >> this case > > This does work, but unfortunately a little too well - in a single > test I saw several instances where that approach returned > _earlier_ than the timeout. It's documented that a timeout between N and N+1 ticks can be satisfied anywhere in that range. In practice I see a wider range. In the kernel, variations in wait time could depend on when the due time is calculated in the interrupt cycle, when the next interrupt occurs and the interrupt time is updated, and when the thread is dispatched. A benefit of using a high-resolution external deadline is that waiting will never return early, but it may return later than it otherwise would, e.g. if re-waiting for a remaining 1 ms actually takes 20 ms. There are many unrelated WaitForSingleObject and WaitForMultipleObjects in the interpreter, extension modules, and code that uses _winapi.WaitForSingleObject and _winapi.WaitForMultipleObjects. For example, time.sleep() allows WAIT_TIMEOUT to override the deadline. I suggest measuring the performance-counter interval for time.sleep(0.001) on both the main thread (Sleep based) and a new thread (WaitForSingleObjectEx based). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:13:24 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 21:13:24 +0000 Subject: [issue44421] random.uniform() hangs will eating up all available RAM In-Reply-To: <1623696423.1.0.630569105584.issue44421@roundup.psfhosted.org> Message-ID: <1623705204.38.0.623980471395.issue44421@roundup.psfhosted.org> Raymond Hettinger added the comment: I concur with Jack. There is no evidence of a bug in Python itself and it is not reasonable to ask us the study and debug your obfuscated code. I just ran random.uniform() in a tight loop for several minutes and observed no deleterious effects. Am marking this as closed as not being a bug. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:16:11 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 14 Jun 2021 21:16:11 +0000 Subject: [issue44421] random.uniform() hangs will eating up all available RAM In-Reply-To: <1623696423.1.0.630569105584.issue44421@roundup.psfhosted.org> Message-ID: <1623705371.76.0.33659603299.issue44421@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:26:28 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 21:26:28 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs Message-ID: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> New submission from STINNER Victor : The threading.enumerate() code is simple: --- # Active thread administration _active_limbo_lock = _allocate_lock() _active = {} # maps thread id to Thread object _limbo = {} def enumerate(): with _active_limbo_lock: return list(_active.values()) + list(_limbo.values()) --- values(), list() and list+list operations can call trigger a GC collection depending on the GC thresholds, created Python objects, etc. During a GC collection, a Python object destructor (__del__) can again call threading.enumerate(). Problem: _active_limbo_lock is not re-entrant lock and so the second call hangs. In practice, this issue was seen in OpenStack which uses eventlet, when a destructor uses the logging module. The logging module uses threading.current_thread(), but this function is monkey-patched by the eventlet module. Extract of the eventlet function: --- def current_thread(): ... found = [th for th in __patched_enumerate() if th.ident == g_id] ... --- https://github.com/eventlet/eventlet/blob/master/eventlet/green/threading.py Attached PR makes _active_limbo_lock re-entrant to avoid this issue. I'm not sure if it's ok or not, I would appreciate to get a review and your feedback ;-) Attached file triggers the threading.enumerate() hang on re-entrant call. ---------- components: Library (Lib) files: rec_threading.py messages: 395851 nosy: vstinner priority: normal severity: normal status: open title: threading.enumerate(): reentrant call during a GC collection hangs versions: Python 3.10, Python 3.11, Python 3.9 Added file: https://bugs.python.org/file50110/rec_threading.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:29:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 21:29:15 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623706155.95.0.315175518273.issue44422@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25317 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26727 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:53:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 14 Jun 2021 21:53:33 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623707613.91.0.281785888592.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: There are different ways to fix this issue: * (A) Rewrite threading.enumerate() in C with code which cannot trigger a GC collection * (B) Disable temporarily the GC * (C) Use a reentrant lock (PR 26727) (A) The problem is that functions other than threading.enumerate() also rely on this lock, like threading.active_count(). I would prefer to not have to rewrite "half" of threading.py in C. Using a RLock is less intrusive. (B) This is a simple and reliable option. But gc.disable() is process-wide: it affects all Python threads, and so it might have surprising side effects. Some code might rely on the current exact GC behavior. I would prefer to not disable the GC temporarily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:53:41 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 14 Jun 2021 21:53:41 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1623707621.77.0.721876774601.issue41930@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25318 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26728 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 17:55:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 14 Jun 2021 21:55:20 +0000 Subject: [issue31643] test_uuid: test_getnode and test_windll_getnode fail if connected to the Internet via an Android phone In-Reply-To: <1506721038.97.0.213398074469.issue31643@psf.upfronthosting.co.za> Message-ID: <1623707720.39.0.419858539802.issue31643@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: -patch versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 18:05:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 14 Jun 2021 22:05:01 +0000 Subject: [issue41930] Wrap sqlite3_serialize API in sqlite3 module In-Reply-To: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org> Message-ID: <1623708301.95.0.900500950766.issue41930@roundup.psfhosted.org> Erlend E. Aasland added the comment: > What would be the use case for this? Quoting D. Richard Hipp, from the sqlite-users mailing list, 2018-03-18, FWIW: These APIs support the concept of using small databases (small enough to fit in memory) as a container for passing information around. For example: A client program might communicate with a server using an HTTP request and sending an SQLite database as the POST data. Or the server might send an SQLite database as the reply. [...] Advantages of using an SQLite database as a container: (1) It is easy to mix text and binary data without having to worry with encodings. (2) Applications can be easily enhanced and extended in backwards-compatible ways by adding new columns and/or tables. (3) Easy to manually view or modify the container content during testing and debugging. (JSON also has this property, but JSON does not work with binary data.) (4) No need to write encoder/decoder logic. (5) There is a high-level query language available to extract the content in an order that might be very different from the order it appears in the file. (6) No need to worry with big-endian vs. little-endian translation, nor UTF8 vs UTF16. The database handles that automatically. Using the serialise/deserialise API's to pickle an in-memory database to a data stream is an interesting thought. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 20:17:39 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 15 Jun 2021 00:17:39 +0000 Subject: [issue44421] random.uniform() hangs will eating up all available RAM In-Reply-To: <1623696423.1.0.630569105584.issue44421@roundup.psfhosted.org> Message-ID: <1623716259.9.0.46603964927.issue44421@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Christian, For future reference, here are some good guidelines for submitting bug reports and asking for help to debug your code: https://stackoverflow.com/help/minimal-reproducible-example http://www.sscce.org/ ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 20:21:39 2021 From: report at bugs.python.org (Douglas Thor) Date: Tue, 15 Jun 2021 00:21:39 +0000 Subject: [issue44420] Add CapWords classes to datetime module? In-Reply-To: <1623693651.24.0.820963890692.issue44420@roundup.psfhosted.org> Message-ID: <1623716499.64.0.16344360914.issue44420@roundup.psfhosted.org> Douglas Thor added the comment: Thanks for correcting the version selection. > the old names could never be removed ... it's not worth the hassle I had the same thought, so I spent a lot of time trying to come up with "Benefits", haha. I'm OK with this being closed as rejected. Is there a standard procedure for doing so? Eg: "keep things open for at least 24hrs so that multiple people can see things" or "only members of should close issues"? If not I'll just close it myself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 20:26:11 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 15 Jun 2021 00:26:11 +0000 Subject: [issue44420] Add CapWords classes to datetime module? In-Reply-To: <1623693651.24.0.820963890692.issue44420@roundup.psfhosted.org> Message-ID: <1623716771.26.0.331216801644.issue44420@roundup.psfhosted.org> Eric V. Smith added the comment: I suggest you close it. If you want some broader discussion, you should bring it up on the python-ideas mailing list, but I don't expect you'll get much support. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 20:47:23 2021 From: report at bugs.python.org (Douglas Thor) Date: Tue, 15 Jun 2021 00:47:23 +0000 Subject: [issue44420] Add CapWords classes to datetime module? In-Reply-To: <1623693651.24.0.820963890692.issue44420@roundup.psfhosted.org> Message-ID: <1623718043.72.0.635321624676.issue44420@roundup.psfhosted.org> Douglas Thor added the comment: Thanks for the info! Rejecting issue, as it would not be feasible to maintain going forward. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 14 22:16:17 2021 From: report at bugs.python.org (Keith Prussing) Date: Tue, 15 Jun 2021 02:16:17 +0000 Subject: [issue25682] __package__ not set to None under pdb in Python 3 In-Reply-To: <1448035339.32.0.969832659097.issue25682@psf.upfronthosting.co.za> Message-ID: <1623723377.82.0.476980977893.issue25682@roundup.psfhosted.org> Keith Prussing added the comment: Caveat: It's been a few years so I'm trying to recall what I was doing at the time and what my original problem was. I understand and expect pdb to populate __package__ and __main__ to be what it expects when run as a module with -m. However, I believe my expectation was for it to not alter the relevant __package__ or __main__ with respect to the script being debugged. This was the behavior in Python 2.7 which changed (unexpectedly to me) in Python 3.4 (or earlier. I obviously didn't look too hard). I must have been trying to debug a script that expected to run using the -m option but could be run as a script too. A few things have changed since the original report: 1. I have forgotten which script/tool I was working on so I wouldn't be able to find it if I tried. 2. I was trying to support Python 2.7 and Python 3 (which I have 0 interest in doing ever again), 3. This small gotcha apparently hasn't tripped up anyone else. At this point, I suspect this has been overcome by events and can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 00:33:25 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 15 Jun 2021 04:33:25 +0000 Subject: [issue37880] For argparse add_argument with action='store_const', const should default to None. In-Reply-To: <1566088875.45.0.199116489639.issue37880@roundup.psfhosted.org> Message-ID: <1623731605.73.0.143632600693.issue37880@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> vinay.sajip nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 00:48:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 04:48:49 +0000 Subject: [issue25682] __package__ not set to None under pdb in Python 3 In-Reply-To: <1448035339.32.0.969832659097.issue25682@psf.upfronthosting.co.za> Message-ID: <1623732529.73.0.705787412112.issue25682@roundup.psfhosted.org> Irit Katriel added the comment: Thanks Keith. Closing and we can look into it if someone else has an issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 00:58:25 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 15 Jun 2021 04:58:25 +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: <1623733105.09.0.18497282088.issue40521@roundup.psfhosted.org> Raymond Hettinger added the comment: [Victor Stinner] > My plan is to merge changes which have no significant > impact on performances FWIW, PyFloat_FromDouble() is the most performance critical function in floatobject.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 01:07:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 15 Jun 2021 05:07:56 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623733676.15.0.959920751451.issue44365@roundup.psfhosted.org> Andrei Kulakov added the comment: How about this example: @dataclass class Rect: x: int y: int r=Rect(5,2) @dataclass class HyperRect(Rect): z: int def __post_init__(self): self.vol = self.x*self.y*self.z hr=HyperRect(5,2,3) print("hr.vol", hr.vol) Hyper Rectangle: https://en.wikipedia.org/wiki/Hyperrectangle ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 01:52:25 2021 From: report at bugs.python.org (karl) Date: Tue, 15 Jun 2021 05:52:25 +0000 Subject: [issue44423] copy2 / sendfile fails on linux with large file Message-ID: <1623736345.91.0.29501439742.issue44423@roundup.psfhosted.org> New submission from karl : by copy a large file e.g. -rwxrwxr-x 1 1002 1001 5359338160 Feb 9 2019 xxx_file_xxx.mdx copy2 / sendfile / fastcopy fails with: Traceback (most recent call last): File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar return list(map(*args)) File "/usr/local/lib/python3.8/dist-packages/pybcpy/diff_bak_copy.py", line 212, in _init_copy_single shutil.copy2(f, dest_path) File "/usr/lib/python3.8/shutil.py", line 432, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib/python3.8/shutil.py", line 272, in copyfile _fastcopy_sendfile(fsrc, fdst) File "/usr/lib/python3.8/shutil.py", line 169, in _fastcopy_sendfile raise err File "/usr/lib/python3.8/shutil.py", line 149, in _fastcopy_sendfile sent = os.sendfile(outfd, infd, offset, blocksize) OSError: [Errno 75] Value too large for defined data type: 'xxx_file_xxx.mdx' -> 'dest/xxx_file_xxx.mdx' """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.8/dist-packages/pybcpy/__main__.py", line 433, in main_func() File "/usr/local/lib/python3.8/dist-packages/pybcpy/__main__.py", line 425, in main_func args.func(args) File "/usr/local/lib/python3.8/dist-packages/pybcpy/__main__.py", line 75, in cmd_init ) = dbak.init_backup_repo(tarmode=args.tar) File "/usr/local/lib/python3.8/dist-packages/pybcpy/diff_bak_copy.py", line 231, in init_backup_repo files = p.map(self._init_copy_single, ifiles) File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get raise self._value OSError: [Errno 75] Value too large for defined data type: 'xxx_file_xxx.mdx' -> 'dest/xxx_file_xxx.mdx' reference to code: https://github.com/kr-g/pybcpy/blob/master/pybcpy/diff_bak_copy.py ---------- messages: 395862 nosy: kr-g priority: normal severity: normal status: open title: copy2 / sendfile fails on linux with large file type: crash versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 02:28:14 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 15 Jun 2021 06:28:14 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623738494.75.0.329500973592.issue44392@roundup.psfhosted.org> Ronald Oussoren added the comment: Why should this be deprecated at all? The API is a convenient way to add ``__class_getitem__`` in a way that is consistent with the implementation for builtin types and the stdlib. I noticed the lack of documentation when I worked on implementing this for PyObjC (an easy first step towards adding type stubs to that project). For me the alternative to using Py_GenericAlias would be a dummy implementation of ``__class_getitem__`` that just returns self. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 02:52:56 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 15 Jun 2021 06:52:56 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623739976.52.0.402519423855.issue44310@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +25319 pull_request: https://github.com/python/cpython/pull/26731 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 05:12:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 09:12:04 +0000 Subject: [issue30260] sock_dealloc() may call __repr__ when socket class is already collected by GC In-Reply-To: <1493829842.08.0.612214340964.issue30260@psf.upfronthosting.co.za> Message-ID: <1623748324.17.0.377347762457.issue30260@roundup.psfhosted.org> Irit Katriel added the comment: Since this is fixed in 3.6 and it?s too late for 3.5, I think this issue can be closed. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 06:25:57 2021 From: report at bugs.python.org (Carlos Franzreb) Date: Tue, 15 Jun 2021 10:25:57 +0000 Subject: [issue44424] Decompress streaming bz2 file Message-ID: <1623752757.23.0.263493527636.issue44424@roundup.psfhosted.org> Change by Carlos Franzreb : ---------- components: Library (Lib) nosy: carlosfranzreb priority: normal severity: normal status: open title: Decompress streaming bz2 file type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 06:26:57 2021 From: report at bugs.python.org (Carlos Franzreb) Date: Tue, 15 Jun 2021 10:26:57 +0000 Subject: [issue44424] Decompress streaming bz2 file Message-ID: <1623752817.02.0.343634449589.issue44424@roundup.psfhosted.org> New submission from Carlos Franzreb : I am trying to lazily load items from a compressed file that resides in Zenodo. My goal is to iteratively yield the items without storing the file in my computer. My problem is that an EOFerror occurs right after the first non-empty line is read. How can I overcome this issue? Here is my code: import requests as req import json from bz2 import BZ2Decompressor def lazy_load(file_url): dec = BZ2Decompressor() with req.get(file_url, stream=True) as res: for chunk in res.iter_content(chunk_size=1024): data = dec.decompress(chunk).decode('utf-8') # do something with 'data' if __name__ == "__main__": creds = json.load(open('credentials.json')) url = 'https://zenodo.org/api/records/' id = '4617285' filename = '10.Papers.nt.bz2' res = req.get(f'{url}{id}', params={'access_token': creds['zenodo_token']}) for file in res.json()['files']: if file['key'] == filename: for item in lazy_load(file['links']['self']): # do something with 'item' The error I become is the following: Traceback (most recent call last): File ".\mag_loader.py", line 51, in for item in lazy_load(file['links']['self']): File ".\mag_loader.py", line 18, in lazy_load data = dec.decompress(chunk) EOFError: End of stream already reache To run the code you need a Zenodo access token, for which you need an account. Once you have logged in, you can create the token here: https://zenodo.org/account/settings/applications/tokens/new/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 06:27:55 2021 From: report at bugs.python.org (Mark Final) Date: Tue, 15 Jun 2021 10:27:55 +0000 Subject: [issue44425] 'dirty' added to sys.version on Linux and Mac source builds depending on git version Message-ID: <1623752875.9.0.718456041412.issue44425@roundup.psfhosted.org> New submission from Mark Final : Hi, We build Python 3.7 from source in-house for Windows, Linux and macOSX. It's been noticed that 'dirty' has been appended to sys.version in our builds, even though the source tree has not been modified from a git clone. This only happens for Linux and macOSX. I traced this to the following commands (which are unchanged in main): https://github.com/python/cpython/blob/main/configure#L2833 https://github.com/python/cpython/blob/main/configure.ac#L50 > GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty" I further traced it to behaviours of different versions of git. In particular, when git is invoked outside of the working tree, and --git-dir is used alone, 'dirty' is always appended. It's been noticed in a number of places online, including https://www.reddit.com/r/git/comments/4edtlx/git_describe_in_makefile_always_dirty/ Additionally using --work-tree does avoid the 'dirty' flag for a clean source tree, for git v2.21.0+. I believe that this was this fix https://github.com/git/git/commit/a1e19004e11dcbc0ceebd92c425ceb1770e52d0b However, since we do have usage of older versions of git, we've had to go with a different solution, which was to use git -C, i.e. GITTAG="git -C \$(srcdir) describe --all --always --dirty" so that git's working directory is changed to $(srcdir). The other git commands in the code linked to do not seem to have the same issue, but we haven't changed them. I'm writing this up in case anyone else has seen the issue, and offer the solution we found if it is useful. Many thanks, Mark ---------- components: Build messages: 395866 nosy: mark.final priority: normal severity: normal status: open title: 'dirty' added to sys.version on Linux and Mac source builds depending on git version type: enhancement versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:17:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 11:17:22 +0000 Subject: [issue32322] Heap type with Py_TPFLAGS_HAVE_GC leads to segfault due to not incrementing type object refcout in PyObject_GC_New In-Reply-To: <1513262648.0.0.213398074469.issue32322@psf.upfronthosting.co.za> Message-ID: <1623755842.22.0.197575550819.issue32322@roundup.psfhosted.org> Irit Katriel added the comment: Are you sure? It seems to me that they both incref the type object in _PyObject_Init: https://github.com/python/cpython/blob/689a84475e7b1da79d5ae82df67ab8897316f98c/Include/internal/pycore_object.h#L43 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:18:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 11:18:28 +0000 Subject: [issue32322] Heap type with Py_TPFLAGS_HAVE_GC leads to segfault due to not incrementing type object refcout in PyObject_GC_New In-Reply-To: <1513262648.0.0.213398074469.issue32322@psf.upfronthosting.co.za> Message-ID: <1623755908.53.0.101924730779.issue32322@roundup.psfhosted.org> Irit Katriel added the comment: Do you still have the code that created the crash? It would help to understand what you are/were seeing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:30:26 2021 From: report at bugs.python.org (hai shi) Date: Tue, 15 Jun 2021 11:30:26 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1623756626.35.0.0843980415753.issue37224@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +25320 pull_request: https://github.com/python/cpython/pull/26733 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:31:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 11:31:21 +0000 Subject: [issue39217] GC of a ctypes object causes application crash In-Reply-To: <1578189599.82.0.182987253345.issue39217@roundup.psfhosted.org> Message-ID: <1623756681.7.0.936174367681.issue39217@roundup.psfhosted.org> Irit Katriel added the comment: As Terry suggested, it would be better to establish whether this is a python bug by asking on python-list, where more people are likely to see your question. A complete script reproducing the crash is *always* better than a verbal description that we may or may not understand correctly. Please reopen this or create a new issue if you are still seeing this issue on a recent (3.9+) version and you can provide a complete script that reproduces it. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:38:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 11:38:48 +0000 Subject: [issue40240] Expose public spelling of _PyGC_FINALIZED and _PyGC_SET_FINALIZED? In-Reply-To: <1586444432.56.0.946879588514.issue40240@roundup.psfhosted.org> Message-ID: <1623757128.3.0.448275239813.issue40240@roundup.psfhosted.org> Irit Katriel added the comment: Can this be closed now? It seems that the query API was added and the set API was rejected. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 07:52:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 11:52:11 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1623757931.46.0.929414189057.issue42972@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25321 pull_request: https://github.com/python/cpython/pull/26734 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:06:55 2021 From: report at bugs.python.org (Rostislav Kondratenko) Date: Tue, 15 Jun 2021 12:06:55 +0000 Subject: [issue32322] Heap type with Py_TPFLAGS_HAVE_GC leads to segfault due to not incrementing type object refcout in PyObject_GC_New In-Reply-To: <1623755908.53.0.101924730779.issue32322@roundup.psfhosted.org> Message-ID: Rostislav Kondratenko added the comment: Hello, I don't have that code, as I worked around that issue at the time. I checked with my project, using PyObject_GC_New works fine. It seems that since then the issue has been fixed at some point since 2017. Either that or I misinterpreted what was going on back then. I think we can safely close this issue. On Tue, 15 Jun 2021 at 14:18, Irit Katriel wrote: > > Irit Katriel added the comment: > > Do you still have the code that created the crash? It would help to > understand what you are/were seeing. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:20:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 12:20:57 +0000 Subject: [issue32322] Heap type with Py_TPFLAGS_HAVE_GC leads to segfault due to not incrementing type object refcout in PyObject_GC_New In-Reply-To: <1513262648.0.0.213398074469.issue32322@psf.upfronthosting.co.za> Message-ID: <1623759657.42.0.803967920905.issue32322@roundup.psfhosted.org> Irit Katriel added the comment: Thanks! ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:37:04 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 15 Jun 2021 12:37:04 +0000 Subject: [issue44351] distutils.sysconfig.parse_makefile() regression in Python 3.10 In-Reply-To: <1623178801.93.0.611041567501.issue44351@roundup.psfhosted.org> Message-ID: <1623760624.74.0.293476410652.issue44351@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 2f2ea96c4429b81f491aa1cdc4219ef2fd6d37fb by Miss Islington (bot) in branch '3.10': bpo-44351: Restore back parse_makefile in distutils.sysconfig (GH-26637) (GH-26673) https://github.com/python/cpython/commit/2f2ea96c4429b81f491aa1cdc4219ef2fd6d37fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:42:29 2021 From: report at bugs.python.org (Karolina Surma) Date: Tue, 15 Jun 2021 12:42:29 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration Message-ID: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> New submission from Karolina Surma : Hello all, I want to build Python 3.10~b2 documentation using Sphinx 4.0.2 (released in May 2021) as RPM in Fedora with aim to ship it in Fedora 35. The build fails with the following error: Warning, treated as error: /builddir/build/BUILD/Python-3.10.0b2/Doc/c-api/complex.rst:49:Error in declarator or parameters Error in declarator or parameters Invalid C declaration: Expected identifier, got keyword: complex [error at 39] Py_complex _Py_c_neg(Py_complex complex) ---------------------------------------^ make: *** [Makefile:51: build] Error 2 The Sphinx changelog mentions in Bug fixes in https://www.sphinx-doc.org/en/master/changes.html#id21 the likely cause: C, properly reject function declarations when a keyword is used as parameter name. ---------- assignee: docs at python components: Documentation messages: 395874 nosy: docs at python, ksurma priority: normal severity: normal status: open title: Docs fail to build with Sphinx 4 due to Invalid C declaration type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:46:03 2021 From: report at bugs.python.org (Malte Kliemann) Date: Tue, 15 Jun 2021 12:46:03 +0000 Subject: [issue44427] File extension for scripts on windows is unclear Message-ID: <1623761163.14.0.147390138108.issue44427@roundup.psfhosted.org> New submission from Malte Kliemann : It is common practice to use no extension for python scripts on UNIX. In 3.8.1.4., it is hinted that a script with a shebang line can be executed on windows only if the file extension of the script is associated with the python launcher. I'm not sure where the right place is, but I suggest clearly stating that this is a critical requirement. As scripts on UNIX usually don't use file extensions, using these scripts without further modification is not possible cross-platform. ---------- assignee: docs at python components: Documentation messages: 395875 nosy: docs at python, maltekliemann priority: normal severity: normal status: open title: File extension for scripts on windows is unclear type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:47:41 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 15 Jun 2021 12:47:41 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1623761261.59.0.604291495313.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 10a5c806d4dec6c342dcc9888fbe4fa1fa9b7a1f by Erlend Egeberg Aasland in branch 'main': bpo-42064: Move sqlite3 types to global state (GH-26537) https://github.com/python/cpython/commit/10a5c806d4dec6c342dcc9888fbe4fa1fa9b7a1f ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:51:26 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 12:51:26 +0000 Subject: [issue40240] Expose public spelling of _PyGC_FINALIZED and _PyGC_SET_FINALIZED? In-Reply-To: <1586444432.56.0.946879588514.issue40240@roundup.psfhosted.org> Message-ID: <1623761486.17.0.854918020443.issue40240@roundup.psfhosted.org> STINNER Victor added the comment: Pablo: "That is out of contract and goes against the guarantees on the GC and can (will) cause the finalizer of the object to be executed more than once. I don't think is a good idea to expose an API that allows breaking the guarantees that we give: every object is finalized once." I concur with Pablo. We must not expose an API to "unfinalize" an object. Irit Katriel: "Can this be closed now? It seems that the query API was added and the set API was rejected." Right. I close the issue as rejected. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 08:57:36 2021 From: report at bugs.python.org (asterite) Date: Tue, 15 Jun 2021 12:57:36 +0000 Subject: [issue30260] sock_dealloc() may call __repr__ when socket class is already collected by GC In-Reply-To: <1493829842.08.0.612214340964.issue30260@psf.upfronthosting.co.za> Message-ID: <1623761856.43.0.898721769864.issue30260@roundup.psfhosted.org> Change by asterite : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 09:09:37 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 13:09:37 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1623762577.63.0.17575138615.issue42972@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25322 pull_request: https://github.com/python/cpython/pull/26735 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 09:09:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 13:09:32 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1623762572.56.0.463491649539.issue42972@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 1cd3d859a49b047dd08abb6f44f0539564d3525a by Victor Stinner in branch 'main': bpo-42972: _thread.RLock implements the GH protocol (GH-26734) https://github.com/python/cpython/commit/1cd3d859a49b047dd08abb6f44f0539564d3525a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 09:29:51 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 13:29:51 +0000 Subject: [issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol In-Reply-To: <1611093266.11.0.721387186389.issue42972@roundup.psfhosted.org> Message-ID: <1623763791.53.0.933930422496.issue42972@roundup.psfhosted.org> miss-islington added the comment: New changeset e30fe27dabbc6b48736c3c17d57f6fa542376e8f by Miss Islington (bot) in branch '3.10': bpo-42972: _thread.RLock implements the GH protocol (GH-26734) https://github.com/python/cpython/commit/e30fe27dabbc6b48736c3c17d57f6fa542376e8f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:14:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 14:14:31 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623766471.79.0.591621997369.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 243fd01047ddce1a7eb0f99a49732d123e942c63 by Victor Stinner in branch 'main': bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) https://github.com/python/cpython/commit/243fd01047ddce1a7eb0f99a49732d123e942c63 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:14:33 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 14:14:33 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623766473.93.0.499787247321.issue44422@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25323 pull_request: https://github.com/python/cpython/pull/26737 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:14:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 14:14:40 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623766479.99.0.941248934073.issue44422@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25324 pull_request: https://github.com/python/cpython/pull/26738 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:26:19 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 15 Jun 2021 14:26:19 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623767179.19.0.513113956047.issue44392@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25325 pull_request: https://github.com/python/cpython/pull/26739 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:34:50 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 14:34:50 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623767690.7.0.237544433236.issue44422@roundup.psfhosted.org> miss-islington added the comment: New changeset c3b776f83b4c765da6d7b8854e844e07bd33c375 by Miss Islington (bot) in branch '3.10': bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) https://github.com/python/cpython/commit/c3b776f83b4c765da6d7b8854e844e07bd33c375 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:39:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 15 Jun 2021 14:39:52 +0000 Subject: [issue44407] A "Coroutines and Tasks" code example needs "asyncio.run(main())" In-Reply-To: <1623561463.56.0.048465518238.issue44407@roundup.psfhosted.org> Message-ID: <1623767992.23.0.456712269063.issue44407@roundup.psfhosted.org> Andrei Kulakov added the comment: I think it's clear that the modification of previous example is limited to `main()` because `say_after()` is also omitted. This is very common in Python code examples, - it seems to me this change is not needed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 10:52:31 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 15 Jun 2021 14:52:31 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623768751.84.0.0656787127332.issue43795@roundup.psfhosted.org> Change by Petr Viktorin : ---------- pull_requests: +25326 pull_request: https://github.com/python/cpython/pull/26740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 11:14:21 2021 From: report at bugs.python.org (4-launchpad-kalvdans-no-ip-org) Date: Tue, 15 Jun 2021 15:14:21 +0000 Subject: [issue38401] Make dataclass attribute docstrings accessible In-Reply-To: <1570494293.05.0.934356434949.issue38401@roundup.psfhosted.org> Message-ID: <1623770061.56.0.119404307884.issue38401@roundup.psfhosted.org> Change by 4-launchpad-kalvdans-no-ip-org : ---------- nosy: +4-launchpad-kalvdans-no-ip-org _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 12:30:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 16:30:35 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623774635.87.0.950396209255.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 8fe57aacc7bf9d9af84803b69dbb1d66597934c6 by Miss Islington (bot) in branch '3.9': bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) (GH-26738) https://github.com/python/cpython/commit/8fe57aacc7bf9d9af84803b69dbb1d66597934c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 12:31:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 16:31:27 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623774687.64.0.949993270059.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: Ok, the deadlock on reentrant call to threading.enumerate() is now fixed in 3.9, 3.10 and main (future 3.11) branches. I close the issue. Thanks for the reviews, as usual :-) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 12:37:34 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 16:37:34 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623775054.02.0.73842371575.issue44422@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25327 pull_request: https://github.com/python/cpython/pull/26741 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 12:43:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 15 Jun 2021 16:43:07 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623775387.96.0.606915760039.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I reopen the issue for PR 26741. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 12:58:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 16:58:00 +0000 Subject: [issue23035] python -c: Line causing exception not shown for exceptions other than SyntaxErrors In-Reply-To: <1418348647.52.0.502974463654.issue23035@psf.upfronthosting.co.za> Message-ID: <1623776280.7.0.616807333847.issue23035@roundup.psfhosted.org> Change by Irit Katriel : ---------- type: -> enhancement versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 13:26:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 17:26:34 +0000 Subject: [issue29126] Fix comments about _PyThreadState_Current In-Reply-To: <1483226717.62.0.229510209962.issue29126@psf.upfronthosting.co.za> Message-ID: <1623777994.9.0.932671488578.issue29126@roundup.psfhosted.org> Irit Katriel added the comment: These comments have been removed in the meantime, here: https://github.com/python/cpython/commit/59d3dce69b0a4f6ee17578ae68037cc7ae90936f ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 13:37:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 17:37:28 +0000 Subject: [issue27607] Importing the main module twice leads to two incompatible instances In-Reply-To: <1469375177.67.0.287991264427.issue27607@psf.upfronthosting.co.za> Message-ID: <1623778648.94.0.694775671882.issue27607@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 13:50:41 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 15 Jun 2021 17:50:41 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623779441.49.0.162988803672.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: See PR 26731 for a draft FAQ entry. Let me know what you think. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:05:19 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 18:05:19 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623780319.52.0.0814323876239.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: Hmm. It's probably not the best name, and we can certainly change it. But I'm a bit confused by the error message: `complex` isn't a keyword in either C or C++, so I'm not sure why Sphinx thinks it is. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:14:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 18:14:40 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623780880.75.0.47352477206.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: As a test, gcc and clang both seem happy to treat this as valid C. I think Sphinx is wrong to reject this. mdickinson at mirzakhani Desktop % cat test.c typedef struct { double real; double imag; } Py_complex; Py_complex _Py_c_neg(Py_complex complex); mdickinson at mirzakhani Desktop % gcc -Wall -Wextra -std=c17 -c test.c mdickinson at mirzakhani Desktop % clang -Wall -Wextra -std=c17 -c test.c mdickinson at mirzakhani Desktop % ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:15:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 15 Jun 2021 18:15:23 +0000 Subject: [issue44037] Broad performance regression from 3.10a7 to 3.10b2 with python.org macOS binaries In-Reply-To: <1620152354.35.0.099245224395.issue44037@roundup.psfhosted.org> Message-ID: <1623780923.1.0.600441867937.issue44037@roundup.psfhosted.org> Raymond Hettinger added the comment: The problem is still present in Python 3.10b2. ---------- title: Broad performance regression from 3.10a7 to 3.10b1 with python.org macOS binaries -> Broad performance regression from 3.10a7 to 3.10b2 with python.org macOS binaries _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:46:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 18:46:19 +0000 Subject: [issue16663] Poor documentation for METH_KEYWORDS In-Reply-To: <1355242591.45.0.999993608815.issue16663@psf.upfronthosting.co.za> Message-ID: <1623782779.38.0.00190686159555.issue16663@roundup.psfhosted.org> Irit Katriel added the comment: This part of the documentation was reworded in issue28805, making this issue out of date. ---------- nosy: +iritkatriel resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add documentation for METH_FASTCALL and _PyObject_FastCall*() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:48:44 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 18:48:44 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623782924.19.0.375084503783.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 1d10bf0bb9409a406c56b0de8870df998637fd0f by Mark Dickinson in branch 'main': bpo-43475: Add what's new entry for NaN hash changes (GH-26725) https://github.com/python/cpython/commit/1d10bf0bb9409a406c56b0de8870df998637fd0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:50:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 18:50:50 +0000 Subject: [issue4277] asynchat's handle_error inconsistency In-Reply-To: <1226060153.34.0.769481825348.issue4277@psf.upfronthosting.co.za> Message-ID: <1623783050.95.0.0915854204357.issue4277@roundup.psfhosted.org> Irit Katriel added the comment: asynchat has been deprecated for a long time, it's unlikely we will do anything with it now. ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 14:51:36 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 18:51:36 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623783096.16.0.833935503573.issue43475@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +25328 pull_request: https://github.com/python/cpython/pull/26743 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 15:04:42 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 19:04:42 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623783882.43.0.260096192109.issue44426@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +patch pull_requests: +25329 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 15:13:17 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 15 Jun 2021 19:13:17 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623784397.56.0.13618699061.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 8d0b2ca493e236fcad8709a622c1ac8ad29c372d by Mark Dickinson in branch '3.10': [3.10] bpo-43475: Add what's new entry for NaN hash changes (GH-26725) (GH-26743) https://github.com/python/cpython/commit/8d0b2ca493e236fcad8709a622c1ac8ad29c372d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 15:37:12 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Jun 2021 19:37:12 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1623785832.64.0.992665822503.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25330 pull_request: https://github.com/python/cpython/pull/26745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 16:28:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 20:28:46 +0000 Subject: [issue29153] Test test.test_asynchat.TestAsynchat / test.test_asynchat.TestAsynchat_WithPoll fail test_close_when_done In-Reply-To: <1483537854.64.0.339355431872.issue29153@psf.upfronthosting.co.za> Message-ID: <1623788926.34.0.510791078987.issue29153@roundup.psfhosted.org> Irit Katriel added the comment: asynchat is deprecated since version 3.6 so there won't be any more development related to it. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 16:43:57 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 15 Jun 2021 20:43:57 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623789837.6.0.850277680875.issue44342@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25331 pull_request: https://github.com/python/cpython/pull/26746 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 17:00:19 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 15 Jun 2021 21:00:19 +0000 Subject: [issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes Message-ID: <1623790819.66.0.954991188371.issue44428@roundup.psfhosted.org> New submission from Thomas Grainger : demo program: import asyncio import socket import threading async def amain(): family = socket.AddressFamily.AF_INET sock = socket.socket(family, socket.SOCK_STREAM) sock.settimeout(1) sock.bind(('localhost', 0)) sock.listen() host, port = sock.getsockname()[:2] event = threading.Event() def serve(): client, _ = sock.accept() with client: client.recv(1) event.wait() t = threading.Thread(target=serve, daemon=True) t.start() reader, writer = await asyncio.open_connection(host=host, port=port) try: while True: writer.write(b"\x00" * 4096 * 682 * 2) await asyncio.wait_for(writer.drain(), 2) print("wrote") except asyncio.TimeoutError: print("timed out") writer.close() await asyncio.sleep(0) writer.transport.abort() print("waiting close") await writer.wait_closed() # never finishes on ProactorEventLoop print("closed") event.set() t.join() asyncio.run(amain()) it looks like it was fixed for the selector eventloop in https://github.com/python/cpython/commit/2546a177650264205e8a52b6836bc5b8c48bf085 but not for the proactor https://github.com/python/cpython/blame/8fe57aacc7bf9d9af84803b69dbb1d66597934c6/Lib/asyncio/proactor_events.py#L140 ---------- components: asyncio messages: 395896 nosy: asvetlov, graingert, yselivanov priority: normal severity: normal status: open title: _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 17:07:26 2021 From: report at bugs.python.org (Edward Yang) Date: Tue, 15 Jun 2021 21:07:26 +0000 Subject: [issue12458] Tracebacks should contain the first line of continuation lines In-Reply-To: <1309499207.17.0.676241559437.issue12458@psf.upfronthosting.co.za> Message-ID: <1623791246.87.0.19722121355.issue12458@roundup.psfhosted.org> Edward Yang added the comment: Supposing I like the old behavior (line number of the end of the statement), is there any way to recover that line number from the traceback after this change? ---------- nosy: +ezyang _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 17:07:57 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 15 Jun 2021 21:07:57 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623791277.3.0.339575326786.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 0f99324f61d5a2edd8729be5eed6f172c892af24 by Miss Islington (bot) in branch '3.10': bpo-44342: [Enum] fix data type search (GH-26667) https://github.com/python/cpython/commit/0f99324f61d5a2edd8729be5eed6f172c892af24 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 17:23:31 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 15 Jun 2021 21:23:31 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623792211.9.0.846634323486.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25332 pull_request: https://github.com/python/cpython/pull/26747 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 17:45:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 15 Jun 2021 21:45:43 +0000 Subject: [issue8772] sysconfig: _get_default_scheme can be made public? In-Reply-To: <1274315831.51.0.95937905223.issue8772@psf.upfronthosting.co.za> Message-ID: <1623793543.26.0.393002543852.issue8772@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 18:35:33 2021 From: report at bugs.python.org (Eric Snow) Date: Tue, 15 Jun 2021 22:35:33 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623796533.88.0.105098076203.issue43693@roundup.psfhosted.org> Eric Snow added the comment: New changeset ac38a9f2dfbba95f5d4338eb11a0221d38ef9328 by Eric Snow in branch 'main': bpo-43693: Eliminate unused "fast locals". (gh-26587) https://github.com/python/cpython/commit/ac38a9f2dfbba95f5d4338eb11a0221d38ef9328 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 19:09:33 2021 From: report at bugs.python.org (Gary Davenport) Date: Tue, 15 Jun 2021 23:09:33 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager Message-ID: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> New submission from Gary Davenport : Hi there. I love Python and Tkinter. I know that there are geometry managers pack, place, and grid. I think there should be a flow type management available, like what is done in Java or html/css. This is more important as responsive GUI design is needed with different screen sizes. I initially addressed this by inheriting from the Frame in tkinter to a 'FlowFrame' object and anything in that Frame would have flow geometry. But this is a little awkward because the syntax is widget.pack() or widget.grid(), etc, so the method is linked to the widget. So I altered the tkinter __init__.py wrapper to add the .flow method so you can use widget.flow() syntax. The flow geometry manager uses the grid managers methods. The changes are straight-forward and I have 3 related projects on github: 1) https://github.com/garydavenport73/tkinterFlow - there are only 2 versions so history will demonstrate the relatively simple changes. 2) https://github.com/garydavenport73/FlowFrame - a related project, FlowFrame object 3) https://github.com/garydavenport73/cpython the formal changes to the most recent https://github.com/python/cpython/blob/3.9/Lib/tkinter/__init__.py file. ---------- components: Tkinter hgrepos: 405 messages: 395900 nosy: Gary73 priority: normal severity: normal status: open title: Tkinter Flow Geometry Manager versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 19:22:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Jun 2021 23:22:29 +0000 Subject: [issue44430] [sqlite3] refactor threading tests Message-ID: <1623799349.31.0.598300171565.issue44430@roundup.psfhosted.org> New submission from Erlend E. Aasland : The threading tests (ThreadTests) in Lib/sqlite3/test/dbapi.py has a lot of code duplication, and none of the test methods use the test.support.threading_helper.reap_threads helper. Also, some branches are not covered by this test class. Suggesting the following: 1. Rewrite ThreadTests with a _run_test() helper method that does the heavy lifting 2. Add test.support.threading_helper.reap_threads to _run_test() 3. Use _run_test() in all threading tests 4. Add test case for sqlite3.Connection.set_trace_callback 5. Add test case for sqlite3.Connection.create_collation ---------- assignee: erlendaasland components: Tests messages: 395901 nosy: erlendaasland, pablogsal priority: low severity: normal status: open title: [sqlite3] refactor threading tests type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 19:23:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 15 Jun 2021 23:23:42 +0000 Subject: [issue44430] [sqlite3] refactor threading tests In-Reply-To: <1623799349.31.0.598300171565.issue44430@roundup.psfhosted.org> Message-ID: <1623799422.75.0.0114362979471.issue44430@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25333 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26748 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 19:23:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 15 Jun 2021 23:23:44 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623799424.12.0.812461543246.issue43693@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: +25334 pull_request: https://github.com/python/cpython/pull/26749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 20:13:34 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Jun 2021 00:13:34 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623802414.46.0.591463867529.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25335 pull_request: https://github.com/python/cpython/pull/26750 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 21:01:50 2021 From: report at bugs.python.org (Ned Deily) Date: Wed, 16 Jun 2021 01:01:50 +0000 Subject: [issue44425] 'dirty' added to sys.version on Linux and Mac source builds depending on git version In-Reply-To: <1623752875.9.0.718456041412.issue44425@roundup.psfhosted.org> Message-ID: <1623805310.11.0.765259586117.issue44425@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 21:51:26 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Jun 2021 01:51:26 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623808286.61.0.00585825576827.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 741b8ae1cfc507902eb57e20f003487af13e40c0 by Ethan Furman in branch 'main': bpo-44342: [Enum] sync current docs to 3.10 (GH-26750) https://github.com/python/cpython/commit/741b8ae1cfc507902eb57e20f003487af13e40c0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 21:51:12 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Jun 2021 01:51:12 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1623808272.58.0.167496770625.issue44342@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 41c2a4a727d3d559632598759433e0ec1bf594f5 by Ethan Furman in branch '3.10': [3.10] bpo-44342: [Enum] improve test, add andrei kulakov to ACKS (GH-26726) https://github.com/python/cpython/commit/41c2a4a727d3d559632598759433e0ec1bf594f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 22:43:07 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Jun 2021 02:43:07 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1623811387.49.0.753743907568.issue43945@roundup.psfhosted.org> Ethan Furman added the comment: Thinking about this some more I am partially reversing course. The idea behind `IntEnum` and `IntFlag` is to be, as close as possible, drop-in replacements for existing integer-based constants. If the format() of those two change then they become much less attractive. So it won't. Instead, any user-mixed enumerations will get the new behavior: class Grades(int, Enum): A = 5 F = 0 will emit a DeprecationWarning now, and in 3.12 `format(Grades.A)` will product 'A' instead of '5'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 15 22:44:44 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 16 Jun 2021 02:44:44 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager In-Reply-To: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> Message-ID: <1623811484.81.0.942580902703.issue44429@roundup.psfhosted.org> Zachary Ware added the comment: Hi Gary. This sounds interesting. However, Tkinter generally tries to be a pretty thin wrapper around Tcl/Tk; is there something like this already in Tk that could be used instead, or existing discussion to add such to Tk? We certainly would not want to wind up in the situation of conflicting with Tcl/Tk if they later add something in the same vein :) Also, the ship has long sailed for adding this to 3.9; 3.11 is the earliest this could happen at this point; I've adjusted the issue metadata accordingly. ---------- nosy: +gpolo, serhiy.storchaka, zach.ware type: -> enhancement versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 00:14:46 2021 From: report at bugs.python.org (Eric Phenix) Date: Wed, 16 Jun 2021 04:14:46 +0000 Subject: [issue44431] Add command-line functionality to uuid module Message-ID: <1623816886.43.0.954667545648.issue44431@roundup.psfhosted.org> New submission from Eric Phenix : Suggested functionality: > python -m uuid > b9aa5a06-e2cd-4c26-b26b-1590f01ea996 ---------- messages: 395906 nosy: ephenix priority: normal severity: normal status: open title: Add command-line functionality to uuid module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 00:20:41 2021 From: report at bugs.python.org (Eric Phenix) Date: Wed, 16 Jun 2021 04:20:41 +0000 Subject: [issue44431] Add command-line functionality to uuid module In-Reply-To: <1623816886.43.0.954667545648.issue44431@roundup.psfhosted.org> Message-ID: <1623817241.61.0.238202459242.issue44431@roundup.psfhosted.org> Change by Eric Phenix : ---------- keywords: +patch pull_requests: +25336 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26751 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 00:31:25 2021 From: report at bugs.python.org (Ethan Furman) Date: Wed, 16 Jun 2021 04:31:25 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1623817885.35.0.307964210314.issue43945@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25337 pull_request: https://github.com/python/cpython/pull/26752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 02:43:07 2021 From: report at bugs.python.org (Rajeev Chaurasia) Date: Wed, 16 Jun 2021 06:43:07 +0000 Subject: [issue44415] sys.stdout.flush and print() hanging In-Reply-To: <1623645412.68.0.708640835339.issue44415@roundup.psfhosted.org> Message-ID: <1623825787.19.0.124908041395.issue44415@roundup.psfhosted.org> Rajeev Chaurasia added the comment: Thanks a lot Serhiy. Your suggested fix resolved the issue. -Rajeev ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 02:44:26 2021 From: report at bugs.python.org (Andrew Johnson) Date: Wed, 16 Jun 2021 06:44:26 +0000 Subject: [issue44432] SourceFileLoader.load_module() is mixing content of previosly loaded files Message-ID: <1623825866.63.0.177432261124.issue44432@roundup.psfhosted.org> New submission from Andrew Johnson : Hi, I'm loading multiple files in same convention - same filename, as a part of creating a build system. I can compare the case to the loading multple configuration files for various plugins in the application, the file contents of multiple files from different directories are mixed together which looks dangerous. Here is a reproducible case for Python 3.9.4 (running on Arch Linux) https://github.com/blackandred/python-bug-sourcefileloader ---------- hgrepos: 406 messages: 395908 nosy: blackandred priority: normal severity: normal status: open title: SourceFileLoader.load_module() is mixing content of previosly loaded files versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 03:16:43 2021 From: report at bugs.python.org (Rajeev Chaurasia) Date: Wed, 16 Jun 2021 07:16:43 +0000 Subject: [issue44433] processes created by subprocess.Popen is not terminating Message-ID: <1623827803.93.0.311738638951.issue44433@roundup.psfhosted.org> New submission from Rajeev Chaurasia : I am using Linux OS and using multiprocessing in my application. The child process execution get completed but the processes are not terminating. childprocess = "/opt/oracle.ahf/exachk/exachk -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly -sudo_remoterun 0" session = subprocess.Popen(childprocess, shell = True) session.communicate() >From the log I can see execution of childprocess scripts(exachk and exachk.py) is completed successfully but the process remains alive forever. Also the parent process from where I am using subprocess.Popen that also remains alive. ---------------------------------------------------- # ps -ef|grep exachk (P1) 278988 247699 0 18:46 ? 00:00:00 sh /opt/oracle.ahf/exachk/exachk -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly -sudo_remoterun 0 (P2) 279873 278988 39 18:46 ? 00:12:51 /opt/oracle.ahf/python/bin/python /opt/oracle.ahf/exachk/exachk.py -silentforce -showpass -dball -nocvu -autorun_id DEFAULT -localonly ---------------------------------------------------- Please help! -Rajeev ---------- components: Library (Lib) messages: 395909 nosy: rajeevkchaurasia priority: normal severity: normal status: open title: processes created by subprocess.Popen is not terminating versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 03:50:42 2021 From: report at bugs.python.org (Dmitry Kulazhenko) Date: Wed, 16 Jun 2021 07:50:42 +0000 Subject: [issue39679] functools: singledispatchmethod doesn't work with classmethod In-Reply-To: <1582053375.25.0.178240077179.issue39679@roundup.psfhosted.org> Message-ID: <1623829842.06.0.925257571912.issue39679@roundup.psfhosted.org> Dmitry Kulazhenko added the comment: Based on what I've read, workaround: from functools import singledispatchmethod def _register(self, cls, method=None): if hasattr(cls, "__func__"): setattr(cls, "__annotations__", cls.__func__.__annotations__) return self.dispatcher.register(cls, func=method) singledispatchmethod.register = _register ---------- nosy: +dmkulazhenko -EugenePY, FFY00, Viktor Roytman, glyph, levkivskyi, lukasz.langa, markgrandi, mental, ncoghlan, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 03:51:46 2021 From: report at bugs.python.org (Dmitry Kulazhenko) Date: Wed, 16 Jun 2021 07:51:46 +0000 Subject: [issue39679] functools: singledispatchmethod doesn't work with classmethod In-Reply-To: <1582053375.25.0.178240077179.issue39679@roundup.psfhosted.org> Message-ID: <1623829906.23.0.280778683413.issue39679@roundup.psfhosted.org> Change by Dmitry Kulazhenko : ---------- nosy: +EugenePY, FFY00, Viktor Roytman, glyph, levkivskyi, lukasz.langa, markgrandi, mental, ncoghlan, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 04:12:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Jun 2021 08:12:32 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager In-Reply-To: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> Message-ID: <1623831152.71.0.584685011068.issue44429@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Zachary. If the flow geometry manager be added in Tk we will add its support in Tkinter. We can even add pure Python implementation for older Tk versions. But we do not want to risk conflicting with Tk. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 04:58:33 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Wed, 16 Jun 2021 08:58:33 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623833913.37.0.000232279880753.issue44310@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: PR 26731 looks very good to me. My only comment, which I am not sure is worthy of adding/is a general lru_cache thing, that "instances are kept alive until they age out of the cache or until the cache is cleared", if you are creating instances and calling this method all the time, will lead to an infinite memory leak. Not sure whether that's too specific to the problem we encountered and we are all consenting adults and should infer this or it is helpful: leave it up to your/other people's judgement. P.S. In the programming.rst there is also the "Why are default values shared between objects?" section which actually uses default values to make its own poor version of a cache. It should probably at least mention lru_cache could be used (unless you particularly need callers to be able to pass their own cache). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 05:22:52 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 09:22:52 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623835372.89.0.191817559925.issue43795@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25338 pull_request: https://github.com/python/cpython/pull/26753 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 05:22:53 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 16 Jun 2021 09:22:53 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623835373.85.0.800362378433.issue43795@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 7cad9cb51bdae2144cbab330f13a607ba3471742 by Petr Viktorin in branch 'main': bpo-43795: Don't list private names in the limited API (GH-26740) https://github.com/python/cpython/commit/7cad9cb51bdae2144cbab330f13a607ba3471742 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 05:41:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 09:41:39 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623836499.14.0.0449214751442.issue44422@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 0729694246174a5c2f0ae197f2e0dbea61b90c9f by Victor Stinner in branch 'main': bpo-44422: threading.Thread reuses the _delete() method (GH-26741) https://github.com/python/cpython/commit/0729694246174a5c2f0ae197f2e0dbea61b90c9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 05:44:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 09:44:01 +0000 Subject: [issue44422] threading.enumerate(): reentrant call during a GC collection hangs In-Reply-To: <1623705988.63.0.204635618533.issue44422@roundup.psfhosted.org> Message-ID: <1623836641.52.0.619877521616.issue44422@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 05:53:24 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 09:53:24 +0000 Subject: [issue43795] Implement PEP 652 -- Maintaining the Stable ABI In-Reply-To: <1617983030.95.0.501839301811.issue43795@roundup.psfhosted.org> Message-ID: <1623837204.41.0.799284447057.issue43795@roundup.psfhosted.org> miss-islington added the comment: New changeset 7fd40101b7130016fc98f05ce34746fed68ab542 by Miss Islington (bot) in branch '3.10': bpo-43795: Don't list private names in the limited API (GH-26740) https://github.com/python/cpython/commit/7fd40101b7130016fc98f05ce34746fed68ab542 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 06:43:40 2021 From: report at bugs.python.org (E. Paine) Date: Wed, 16 Jun 2021 10:43:40 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager In-Reply-To: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> Message-ID: <1623840220.65.0.664717350661.issue44429@roundup.psfhosted.org> E. Paine added the comment: > But we do not want to risk conflicting with Tk. I think it's worth noting that tkinter does already have some 'extra' functionality over just what Tk offers (such as the ttk extension widgets `LabeledScale` and `OptionMenu`). While this would (IMO) be a useful addition, it may be better suited as a third-party library. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 07:13:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 11:13:01 +0000 Subject: [issue14445] Providing more fine-grained control over assert statements In-Reply-To: <1333040831.85.0.92124341394.issue14445@psf.upfronthosting.co.za> Message-ID: <1623841981.81.0.12167303199.issue14445@roundup.psfhosted.org> Irit Katriel added the comment: I am closing this because there was no followup for over 9 years. If you are still interested in pursuing this, please raise it for discussion on python-ideas and open a new issue once there is agreement on how to proceed. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 07:36:54 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 11:36:54 +0000 Subject: [issue43475] Worst-case behaviour of hash collision with float NaN In-Reply-To: <1615474533.28.0.166606930148.issue43475@roundup.psfhosted.org> Message-ID: <1623843414.8.0.685807546132.issue43475@roundup.psfhosted.org> Mark Dickinson added the comment: I think this can be closed now. ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 08:21:53 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 12:21:53 +0000 Subject: [issue44357] Add math.cbrt() function: Cube Root In-Reply-To: <1623225510.26.0.80047204907.issue44357@roundup.psfhosted.org> Message-ID: <1623846113.43.0.024895014422.issue44357@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 08:59:46 2021 From: report at bugs.python.org (ueJone) Date: Wed, 16 Jun 2021 12:59:46 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1623848386.47.0.517941489061.issue44107@roundup.psfhosted.org> ueJone <775844993 at qq.com> added the comment: Sorry, I've been busy with other things recently. I think that the problem is't caused by OS, because the other TCP servers were disconnected normally and TCP client can access to these servers. My question is how to make the client connect to the server normally every time, instead of why the abnormal disconnect. The attachment: Capture packets of wireshark(HTTPServer listen on port 20245) ---------- resolution: not a bug -> later status: closed -> open Added file: https://bugs.python.org/file50111/tcpPort_20245.pcapng _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 09:02:34 2021 From: report at bugs.python.org (Josh Jiang) Date: Wed, 16 Jun 2021 13:02:34 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623848554.74.0.762502785159.issue44389@roundup.psfhosted.org> Change by Josh Jiang : ---------- nosy: +johnj nosy_count: 5.0 -> 6.0 pull_requests: +25339 pull_request: https://github.com/python/cpython/pull/26754 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 09:04:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 16 Jun 2021 13:04:46 +0000 Subject: [issue38211] clean up type_init() In-Reply-To: <1568794289.26.0.422992703771.issue38211@roundup.psfhosted.org> Message-ID: <1623848686.93.0.577349139965.issue38211@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ab030d6f9d73e7f6c2213c2e308d1ceb04761485 by Sergey Fedoseev in branch 'main': bpo-38211: Clean up type_init() (GH-16257) https://github.com/python/cpython/commit/ab030d6f9d73e7f6c2213c2e308d1ceb04761485 ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 09:12:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 16 Jun 2021 13:12:34 +0000 Subject: [issue44107] HTTPServer can't close http client completely In-Reply-To: <1620727659.65.0.182288383134.issue44107@roundup.psfhosted.org> Message-ID: <1623849154.27.0.74455369838.issue44107@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: later -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 09:19:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 13:19:28 +0000 Subject: [issue14879] invalid docs for subprocess exceptions with shell=True In-Reply-To: <1337666994.08.0.287605633225.issue14879@psf.upfronthosting.co.za> Message-ID: <1623849568.43.0.227120052463.issue14879@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 09:52:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 13:52:10 +0000 Subject: [issue16437] issubclass doc improvement In-Reply-To: <1352383480.96.0.515607744563.issue16437@psf.upfronthosting.co.za> Message-ID: <1623851530.8.0.923859875932.issue16437@roundup.psfhosted.org> Irit Katriel added the comment: Whether the recursive nature of the check should be documented or not, it seems inconsistent that it's documented for isinstance but not for issubclass. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:03:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 14:03:07 +0000 Subject: [issue14879] invalid docs for subprocess exceptions with shell=True In-Reply-To: <1337666994.08.0.287605633225.issue14879@psf.upfronthosting.co.za> Message-ID: <1623852187.96.0.499365982605.issue14879@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 6.0 -> 7.0 pull_requests: +25340 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26755 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:12:33 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 16 Jun 2021 14:12:33 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623852753.5.0.144236373856.issue44392@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 6773c3eaa735b5061b4a97f2c730703a32d8c9ff by Ken Jin in branch 'main': bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) https://github.com/python/cpython/commit/6773c3eaa735b5061b4a97f2c730703a32d8c9ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:12:39 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 14:12:39 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623852759.28.0.620798615644.issue44392@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25341 pull_request: https://github.com/python/cpython/pull/26756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:15:10 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 16 Jun 2021 14:15:10 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623852910.51.0.288746837471.issue44392@roundup.psfhosted.org> Guido van Rossum added the comment: Does it need a backport to 3.9 too, since GenericAlias was introduced there? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:19:29 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 14:19:29 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623853169.94.0.619258120166.issue44434@roundup.psfhosted.org> Change by STINNER Victor : Added file: https://bugs.python.org/file50113/pthread_cancel_emfile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:19:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 14:19:11 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work Message-ID: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> New submission from STINNER Victor : The glibc pthread_exit() functions loads an unwind function from libgcc_s.so.1 using dlopen(). dlopen() can fail to open libgcc_s.so.1 file to various reasons, but the most likely seems to be that the process is out of available file descriptor (EMFILE error). If the glibc pthread_exit() fails to open libgcc_s.so.1, it aborts the process. Extract of pthread_cancel(): /* Trigger an error if libgcc_s cannot be loaded. */ { struct unwind_link *unwind_link = __libc_unwind_link_get (); if (unwind_link == NULL) __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n"); } Sometimes, libgcc_s.so.1 library is loaded early in Python startup. Sometimes, it only loaded when the first Python thread exits. Hitting in a multithreaded real world application, dlopen() failing with EMFILE is not deterministic. It depends on precise timing and in which order threads are running. It is unlikely in a small application, but it is more likely on a network server which has thousands of open sockets (file descriptors). -- Attached scripts reproduces the issue. You may need to run the scripts (especially pthread_cancel_emfile.py) multiple times to trigger the issue. Sometimes libgcc_s library is loaded early for an unknown reason, it works around the issue. (1) pthread_cancel_bug.py $ python3.10 pthread_cancel_bug.py libgcc_s.so.1 must be installed for pthread_cancel to work Abandon (core dumped) (2) pthread_cancel_emfile.py: $ python3.10 ~/pthread_cancel_emfile.py spawn thread os.open failed: OSError(24, 'Too many open files') FDs open by the thread: 2 (max FD: 4) fd 0 valid? True fd 1 valid? True fd 2 valid? True fd 3 valid? True fd 4 valid? True libgcc_s.so.1 must be installed for pthread_cancel to work Abandon (core dumped) -- Example of real world issue on RHEL8: https://bugzilla.redhat.com/show_bug.cgi?id=1972293 The RHEL reproducer uses a very low RLIMIT_NOFILE (5 file descriptors) to trigger the bug faster. It simulates a busy server application. -- There are different options: (*) Modify thread_run() of Modules/_threadmodule.c to remove the *redundant* PyThread_exit_thread() call. This is the most simple option and it sounds perfectly safe to me. I'm not sure why PyThread_exit_thread() is called explicitly. We don't pass any parameter to the function. (*) Link the Python _thread extension on libgcc_s.so if Python it built with the glibc. Checking if Python is linked to the glibc is non trivial and we have hardcode the "libgcc_s" library name. I expect painful maintenance burden with this option. (*) Load explicitly the libgcc_s.so library in _thread.start_new_thread(): when the first thread is created. We need to detect that we are running the glibc at runtime, by calling confstr('CS_GNU_LIBC_VERSION') for example. The problem is that "libgcc_s.so.1" filename may change depending on the Linux distribution. It will likely have a different filename on macOS (".dynlib"). In short, it's tricky to get it right. (*) Fix the glibc! I discussed with glibc developers who explained me that there are good reasons to keep the unwind code in the compiler (GCC), and so load it dynamically in the glibc. In short, this is not going to change. -- Attached PR implements the most straightforward option: remove the redundant PyThread_exit_thread() call in thread_run(). ---------- components: Library (Lib) files: pthread_cancel_bug.py messages: 395924 nosy: vstinner priority: normal severity: normal status: open title: _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work versions: Python 3.11 Added file: https://bugs.python.org/file50112/pthread_cancel_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:27:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 14:27:04 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623853624.79.0.301868958873.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-18748 "io.IOBase destructor silence I/O error on close() by default" which was caused by a bug in an application, the application closed the libgcc_s file descriptor by mistake. It closed the same file decriptor twice, whereas the FD was reused by dlopen() in the meanwhile. But the result was the same, the process aborted with this error message: "libgcc_s.so.1 must be installed for pthread_cancel to work" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:27:14 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 16 Jun 2021 14:27:14 +0000 Subject: [issue28937] str.split(): allow removing empty strings (when sep is not None) In-Reply-To: <1481469102.15.0.255147638686.issue28937@psf.upfronthosting.co.za> Message-ID: <1623853634.21.0.108900308599.issue28937@roundup.psfhosted.org> Andrei Kulakov added the comment: Just to sum up the current state the way I see it, as well as the history of the discussion, I think there were 2 initial requests based on experience and one additional, more theoretical "nice to have": A. ''.split() => [''] B. ''.split(sep) => [] # where sep!=None C. a way to get the current semantics of sep=None, but with specific whitespace separators like just spaces or just tabs. 'a b'.split(' ') => ['a','b'] The idea was to cover all 3 enhancements with the current patch. As I pointed out in the comments above, current patch does not "cleanly" cover case B, potentially leading to confusion and/or bugs. My suggestion was to cover cases A and B, and leave out C, potentially for some future patch. If we go with the current patch, there will be no practical way to fix the issue with B later, other than adding a new `str.split2`. Conversely, it would be possible to add a new flag to handle C in the future. This leads to a few questions: - will the issue I brought up not really be a problem in practice? - what's more important, B or C? - if both B and C are important, can we leave C for a future patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:34:53 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 14:34:53 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623854093.4.0.19348372208.issue44392@roundup.psfhosted.org> miss-islington added the comment: New changeset 84ce737f73136c1de7c4dc92bc096ed6c963e42d by Miss Islington (bot) in branch '3.10': bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) https://github.com/python/cpython/commit/84ce737f73136c1de7c4dc92bc096ed6c963e42d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:38:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 14:38:04 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1623854284.21.0.364406323815.issue20115@roundup.psfhosted.org> Irit Katriel added the comment: This is still the same in 3.11. I added another line to the example's file, which shows more clearly what's happening: >>> open('x.py', 'wb').write(b'#\x00\na\nb\n') % ./python.exe x.py Traceback (most recent call last): File "x.py", line 2, in a NameError: name 'b' is not defined ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:38:28 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 16 Jun 2021 14:38:28 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623854308.15.0.876579473111.issue44392@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25342 pull_request: https://github.com/python/cpython/pull/26757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 10:54:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 14:54:14 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623855254.46.0.689254338013.issue44434@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25343 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26758 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:04:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 16 Jun 2021 15:04:29 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1623855869.7.0.947287854131.issue44337@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25344 pull_request: https://github.com/python/cpython/pull/26759 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:07:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 15:07:47 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623856067.91.0.64959723897.issue23316@roundup.psfhosted.org> Irit Katriel added the comment: I don't think this is true anymore: >>> def a(): ... print('a') ... return (1,2) ... >>> def b(): ... print('b') ... return (3,4) ... >>> def f(*args, b=None): ... print('f') ... >>> f(*a(), b=b()) a b f >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:11:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:11:08 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623856268.21.0.375741727442.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: PyThread_exit_thread() was modified in 2011 to fix daemon threads: commit 0d5e52d3469a310001afe50689f77ddba6d554d1 Author: Antoine Pitrou Date: Wed May 4 20:02:30 2011 +0200 Issue #1856: Avoid crashes and lockups when daemon threads run while the interpreter is shutting down; instead, these threads are now killed when they try to take the GIL. PyThread_exit_thread(void) { dprintf(("PyThread_exit_thread called\n")); - if (!initialized) { + if (!initialized) exit(0); - } + pthread_exit(0); } This change remains important for Python/ceval.c. When a daemon thread tries to acquire the GIL, it calls PyThread_exit_thread() if Python already exited to exit immediately the thread. Example from take_gil(): if (tstate_must_exit(tstate)) { /* bpo-39877: If Py_Finalize() has been called and tstate is not the thread which called Py_Finalize(), exit immediately the thread. This code path can be reached by a daemon thread after Py_Finalize() completes. In this case, tstate is a dangling pointer: points to PyThreadState freed memory. */ PyThread_exit_thread(); } See also my articles on daemon threads fixes: * https://vstinner.github.io/gil-bugfixes-daemon-threads-python39.html * https://vstinner.github.io/daemon-threads-python-finalization-python32.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:14:52 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:14:52 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623856492.52.0.00612312298531.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: _thread.start_new_thread() always called "exit thread", since the function was added to Python: commit 1984f1e1c6306d4e8073c28d2395638f80ea509b Author: Guido van Rossum Date: Tue Aug 4 12:41:02 1992 +0000 * Makefile adapted to changes below. * split pythonmain.c in two: most stuff goes to pythonrun.c, in the library. * new optional built-in threadmodule.c, build upon Sjoerd's thread.{c,h}. * new module from Sjoerd: mmmodule.c (dynamically loaded). * new module from Sjoerd: sv (svgen.py, svmodule.c.proto). * new files thread.{c,h} (from Sjoerd). * new xxmodule.c (example only). * myselect.h: bzero -> memset * select.c: bzero -> memset; removed global variable static void t_bootstrap(args_raw) void *args_raw; { object *args = (object *) args_raw; object *func, *arg, *res; restore_thread((void *)NULL); func = gettupleitem(args, 0); arg = gettupleitem(args, 1); res = call_object(func, arg); DECREF(arg); /* Matches the INCREF(arg) in thread_start_new_thread */ if (res == NULL) { fprintf(stderr, "Unhandled exception in thread:\n"); print_error(); /* From pythonmain.c */ fprintf(stderr, "Exiting the entire program\n"); goaway(1); } (void) save_thread(); exit_thread(); } exit_thread() was partially replaced with PyThread_exit_thread() in: commit bcc207484a0f8f27a684e11194e7430c0710f66d Author: Guido van Rossum Date: Tue Aug 4 22:53:56 1998 +0000 Changes for BeOS, QNX and long long, by Chris Herborth. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:16:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Jun 2021 15:16:18 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1623856578.73.0.656801418393.issue20115@roundup.psfhosted.org> Terry J. Reedy added the comment: https://docs.python.org/3/reference/toplevel_components.html#file-input says that file input and exec input (should) have the same grammar. This implies that the divergence is a bug. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:21:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 15:21:24 +0000 Subject: [issue23394] No garbage collection at end of main thread In-Reply-To: <1423086136.45.0.600991266786.issue23394@psf.upfronthosting.co.za> Message-ID: <1623856884.03.0.304372182703.issue23394@roundup.psfhosted.org> Irit Katriel added the comment: For the use case you describe, you could add a close() function to your library so that callers can make shutdown explicit, or if you want it to remain implicit you could use daemon threads which terminate when the main thread exits. Relying on GC to release objects which then close non-daemonic threads from __del__ doesn't sound like a robust design to me. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:27:27 2021 From: report at bugs.python.org (Gary Davenport) Date: Wed, 16 Jun 2021 15:27:27 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager In-Reply-To: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> Message-ID: <1623857247.05.0.957138647147.issue44429@roundup.psfhosted.org> Gary Davenport added the comment: Thank you so much for the kind words and help in giving me some direction with these projects. I am relatively new to Python, object oriented programming and open source collaboration. I think the 3rd party module probably makes the most sense, because this is how I am currently using it. The beginning of my code typically looks like this: from tkinter import * from tkinterFlow import * But I will have to look at how to make or publish a module and so forth. Then I would maintain the module with new releases. I am also going to study Tk more. I am fairly certain I can add the flow manager at that level. Really the flow geometry manager as I have made isn't really a manager on its own. It uses the grid managers methods. (it could use the place instead of grid, but I chose grid). The main question I suppose would be does the community want a .flow method added to the Widgets in Tk or a 3rd party module? I think I could make either one, given some time and study. For now I will look into making the 3rd party module. This is a skill I need to develop notwithstanding this flow manager project. My main goal is just to make it easy for someone to implement flow behaviour. Thanks again to everyone for your time and direction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:29:31 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 15:29:31 +0000 Subject: [issue44435] There is no description of PY_SSIZE_T_CLEAN in docs Message-ID: <1623857371.31.0.735487801609.issue44435@roundup.psfhosted.org> New submission from Jack DeVries : In the intro to the C API (https://docs.python.org/3/c-api/intro.html#include-files), it says, "see Parsing arguments and building values for a description of this macro." There is a link which leads to ``arg.rst``, but there is no description of the macro there, just a note to include the macro like elsewhere. I propose to remove this sentence from the docs, since it is my understanding that there is no need to document the details of why this macro must be defined, only to ensure that users define it. Alternatively, add a description of the macro in the appropriate place in the C API docs, and fix the link in this blurb. I'm happy to submit a documentation patch, but I'd need someone to advise on which of these options are more desired. ---------- messages: 395935 nosy: jack__d priority: normal severity: normal status: open title: There is no description of PY_SSIZE_T_CLEAN in docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:31:41 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 15:31:41 +0000 Subject: [issue44435] There is no description of PY_SSIZE_T_CLEAN in docs In-Reply-To: <1623857371.31.0.735487801609.issue44435@roundup.psfhosted.org> Message-ID: <1623857501.91.0.56843195169.issue44435@roundup.psfhosted.org> Change by Jack DeVries : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:35:00 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 15:35:00 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623857700.08.0.737015745519.issue44392@roundup.psfhosted.org> miss-islington added the comment: New changeset c7e95715ec2f2a16eace7aa35a1eb2f18e8d06ed by Ken Jin in branch '3.9': [3.9] bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) (GH-26757) https://github.com/python/cpython/commit/c7e95715ec2f2a16eace7aa35a1eb2f18e8d06ed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:37:59 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:37:59 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623857879.21.0.257957486978.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: Unix pthread_create() manual page. https://man7.org/linux/man-pages/man3/pthread_create.3.html The new thread terminates in one of the following ways: (...) * It returns from start_routine(). This is equivalent to calling pthread_exit(3) with the value supplied in the return statement. (...) Calling pthread_exit(0) is optional. -- MSDN _beginthreadex() documentation: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/beginthread-beginthreadex?view=msvc-160 "When the thread returns from that routine, it is terminated automatically." Calling _endthreadex(0) is optional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:38:36 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 16 Jun 2021 15:38:36 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1623857916.03.0.860928506376.issue20115@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, null bytes should just be rejected. If someone comes up with a fix for this we'll accept it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:43:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:43:23 +0000 Subject: [issue44436] [Windows] _thread.start_new_thread() should close the thread handle Message-ID: <1623858203.56.0.613282344713.issue44436@roundup.psfhosted.org> New submission from STINNER Victor : _thread.start_new_thread() is implemented by calling _beginthreadex(). Currently, when the thread completes: PyThread_exit_thread() is called which calls "_endthreadex(0)" on Windows. I proposed to no longer call it explicitly in bpo-44434. _endthreadex() documentation says that the thread handle must be closed explicitly (with CloseHandle()), same applies for ExitThread(). "Unlike _endthread, the _endthreadex function does not close the thread handle, thereby allowing other threads to block on this one without fear that the handle will be freed out from under the system." _endthread() closes the thread handle, but Python uses _endthreadex(). Should Python be modified to close explicitly the thread handle once the thread terminated? _endthread() and _endthreadex() documentation: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/endthread-endthreadex?view=msvc-160 Example closing the thread handle in the thread which created the thread: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/beginthread-beginthreadex?view=msvc-160 Simplified code: --- hThread = (HANDLE)_beginthreadex( NULL, 0, &SecondThreadFunc, NULL, 0, &threadID ); WaitForSingleObject( hThread, INFINITE ); CloseHandle( hThread ); --- Would it be safe to close the handle just after PyThread_start_new_thread() success? Or should it be done in the C function thread_run(), just before existing, CloseHandle(GetCurrentThread())? To debug this issue, GetHandleInformation() can be used to check if the handle is still open or not. For example, call os.get_handle_inheritable(handle) in Python. ---------- components: Windows messages: 395939 nosy: eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: [Windows] _thread.start_new_thread() should close the thread handle versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:43:52 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 16 Jun 2021 15:43:52 +0000 Subject: [issue44392] Py_GenericAlias is not documented In-Reply-To: <1623403115.39.0.360289172902.issue44392@roundup.psfhosted.org> Message-ID: <1623858232.51.0.337842396315.issue44392@roundup.psfhosted.org> Ken Jin added the comment: I'm closing this issue as all the relevant PRs have landed. Thanks everyone! @Ronald > Why should this be deprecated at all? I can't speak for others, but personally I think it's here to stay (for the many reasons raised in the previous messages). Thanks for catching and reporting this. Improving docs is always fun :). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:44:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:44:14 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623858254.93.0.296654874697.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44436 "[Windows] _thread.start_new_thread() should close the thread handle". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:49:57 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 16 Jun 2021 15:49:57 +0000 Subject: [issue16437] issubclass doc improvement In-Reply-To: <1352383480.96.0.515607744563.issue16437@psf.upfronthosting.co.za> Message-ID: <1623858597.37.0.67113695288.issue16437@roundup.psfhosted.org> Ken Jin added the comment: @irit, you may be interested in issue44135, there's an open PR there and it seems to fix what this issue describes. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:54:29 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 16 Jun 2021 15:54:29 +0000 Subject: [issue44430] [sqlite3] refactor threading tests In-Reply-To: <1623799349.31.0.598300171565.issue44430@roundup.psfhosted.org> Message-ID: <1623858869.25.0.862089038731.issue44430@roundup.psfhosted.org> Erlend E. Aasland added the comment: The current code duplication has several negative impacts, IMO: - Readability Currently the ThreadTests class spans 173 lines. Refactored, it spans 51 lines (should fit in a screenful), making it easy to see what's actually being tested. Currently, the tests differ by only one line; the remaining 15 lines are boilerplate code. That's 15 lines of boilerplate code per test method. - Maintainability Currently, if the boilerplate code needs tuning (or bugfixing), we must adjust it in _all_ the test methods. For example, adding the @threading_helper.reap_threads decorator to every single test. After refactoring, the boilerplate code is refactored out; adding the reap threads decorator needs only be done in one place; modifying the boilerplate code needs only be done in one place. - Fewer lines of code; improved maintainability diff stat: 1 file changed, 37 insertions(+), 140 deletions(-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:55:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 16 Jun 2021 15:55:46 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1623858946.1.0.620832248459.issue44434@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:56:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 16 Jun 2021 15:56:25 +0000 Subject: [issue44436] [Windows] _thread.start_new_thread() should close the thread handle In-Reply-To: <1623858203.56.0.613282344713.issue44436@roundup.psfhosted.org> Message-ID: <1623858985.99.0.634973811141.issue44436@roundup.psfhosted.org> Eryk Sun added the comment: > Would it be safe to close the handle just after PyThread_start_new_thread() > success? We already close the handle in PyThread_start_new_thread() in Python/thread_nt.h: if (hThread == 0) { // ... } else { dprintf(("%lu: PyThread_start_new_thread succeeded: %p\n", PyThread_get_thread_ident(), (void*)hThread)); CloseHandle(hThread); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 11:57:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 15:57:50 +0000 Subject: [issue44436] [Windows] _thread.start_new_thread() should close the thread handle In-Reply-To: <1623858203.56.0.613282344713.issue44436@roundup.psfhosted.org> Message-ID: <1623859070.0.0.638208806668.issue44436@roundup.psfhosted.org> STINNER Victor added the comment: > CloseHandle(GetCurrentThread()) This is useless. GetCurrentThread() returns a pseudo handle. The GetCurrentThread() documentation says: "The pseudo handle need not be closed when it is no longer needed. Calling the CloseHandle function with this handle has no effect." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:00:26 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 16 Jun 2021 16:00:26 +0000 Subject: [issue44433] processes created by subprocess.Popen is not terminating In-Reply-To: <1623827803.93.0.311738638951.issue44433@roundup.psfhosted.org> Message-ID: <1623859226.95.0.545532143592.issue44433@roundup.psfhosted.org> Eric V. Smith added the comment: This is probably not a python bug. But if you can demonstrate it without needing to install the Oracle software, we can take a look at it. You've also not explained how you're using multiprocessing. We need an complete, short, working example program to determine if it's a python bug. I suggest you ask this question on Stack Overflow. Also, I'd suggest subprocess.run instead of .communicate, if you can. ---------- nosy: +eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:01:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 16:01:21 +0000 Subject: [issue44436] [Windows] _thread.start_new_thread() should close the thread handle In-Reply-To: <1623858203.56.0.613282344713.issue44436@roundup.psfhosted.org> Message-ID: <1623859281.05.0.668102747164.issue44436@roundup.psfhosted.org> STINNER Victor added the comment: > [Windows] _thread.start_new_thread() should close the thread handle So far, I'm not convinced that Python must be changed. I modified my Python locally so thread_run() writes GetCurrentThread() to stderr. Example: --- SLEEP = 5 import ctypes import _thread import time import os HANDLE = ctypes.c_voidp DWORD = ctypes.c_ulong ResumeThread = ctypes.windll.kernel32.ResumeThread ResumeThread.argtypes = (HANDLE,) ResumeThread.restype = DWORD SuspendThread = ctypes.windll.kernel32.SuspendThread SuspendThread.argtypes = (HANDLE,) SuspendThread.restype = DWORD def func(): time.sleep(SLEEP) print("--thread exit--") def check_handle(handle): x = SuspendThread(handle) print(f"SuspendThread({handle}) -> {x}") x = ResumeThread(handle) print(f"ResumeThread({handle}) -> {x}") handle = _thread.start_new_thread(func, ()) print(f"start_new_thread() -> {handle}") check_handle(handle) time.sleep(SLEEP+1) check_handle(handle) --- Output: --- start_new_thread() -> 2436 SuspendThread(2436) -> 4294967295 ResumeThread(2436) -> 4294967295 thread_run: GetCurrentThread() -> -2 --thread exit-- SuspendThread(2436) -> 4294967295 ResumeThread(2436) -> 4294967295 --- It seems like the handle returned by _beginthreadex() cannot be used with SuspendThread() or ResumeThread(): both fail. GetHandleInformation() also fails on this handle (I tried os.get_handle_inheritable()). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:03:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 16 Jun 2021 16:03:07 +0000 Subject: [issue44436] [Windows] _thread.start_new_thread() should close the thread handle In-Reply-To: <1623858203.56.0.613282344713.issue44436@roundup.psfhosted.org> Message-ID: <1623859387.25.0.911980019539.issue44436@roundup.psfhosted.org> STINNER Victor added the comment: Eryk: > We already close the handle in PyThread_start_new_thread() in Python/thread_nt.h Oh right! I completely missed this call. Thanks for double checking the issue ;-) I close the issue as "not a bug". ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:26:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 16:26:07 +0000 Subject: [issue44411] regrtests fail with segfault after failing calls to malloc In-Reply-To: <1623597670.2.0.418457748374.issue44411@roundup.psfhosted.org> Message-ID: <1623860767.54.0.197356049944.issue44411@roundup.psfhosted.org> Change by Jack DeVries : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:25:58 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 16:25:58 +0000 Subject: [issue44411] regrtests fail with segfault after failing calls to malloc In-Reply-To: <1623597670.2.0.418457748374.issue44411@roundup.psfhosted.org> Message-ID: <1623860758.25.0.826400590054.issue44411@roundup.psfhosted.org> Jack DeVries added the comment: I'm closing this because I have the sense that this is a problem with my system, but I'm continuing to investigate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 12:28:10 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 16 Jun 2021 16:28:10 +0000 Subject: [issue44433] processes created by subprocess.Popen is not terminating In-Reply-To: <1623827803.93.0.311738638951.issue44433@roundup.psfhosted.org> Message-ID: <1623860890.2.0.756606320956.issue44433@roundup.psfhosted.org> Jack DeVries added the comment: For future reference, here are some good guidelines for submitting bug reports and asking for help to debug your code: https://stackoverflow.com/help/minimal-reproducible-example http://www.sscce.org/ ---------- nosy: +jack__d status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 13:24:01 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Jun 2021 17:24:01 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623864241.99.0.366129759764.issue23316@roundup.psfhosted.org> Terry J. Reedy added the comment: The particular example of left-to-right function evaluation in https://docs.python.org/3/reference/expressions.html#evaluation-order is "expr1(expr2, expr3, *expr4, **expr5)". Joshua's claim, without evidence, that "'f(*a(), b=b())' will evaluate b() before a()" was false, as shown by Neil with dis and is now, as shown by Irit with a code example. But Neil also showed, again with dis, that a revised discrepancy claim, ""'f(b=b(), *a())' will evaluate a() before b()", is true, because reversing the order of these particular arguments does not reverse the evaluation order. The dis today is equivalent to the one 7 years ago, with CALL_FUNCTION_VAR expanded to two operations. dis.dis('f(b=b(), *a())') 1 0 LOAD_NAME 0 (f) 2 LOAD_NAME 1 (a) 4 CALL_FUNCTION 0 6 LOAD_CONST 0 ('b') 8 LOAD_NAME 2 (b) 10 CALL_FUNCTION 0 12 BUILD_MAP 1 14 CALL_FUNCTION_EX 1 16 RETURN_VALUE Irit's example, carried one step further confirms this. >>> f(b=b(), *a()) a b f Although I considered SilentGhost's reading of https://docs.python.org/3/reference/expressions.html#calls as too 'loose' (evaluation order of function argument *is* defined in general), that section address this exact case. "A consequence of this is that although the *expression syntax may appear after explicit keyword arguments, it is processed before the keyword arguments ..." I read this as an acknowledgement that this order violates the general rule. I do wonder whether exception is specific to using a stack machine and implementation convenience or whether *all* implementations must follow this order. If C-Python specific, it should be labelled as such. The doc continues with an example call, for a different 'f', where, unlike Irit's 'f', the result is "TypeError: f() got multiple values for keyword argument 'a'". It concludes "It is unusual for both keyword arguments and the *expression syntax to be used in the same call, so in practice this confusion does not arise." The problem with mixing unpacking and named values might be even clearer if "f(b=1, *(2,1))" were added to the example box. Perhaps *exp after x=exp should be prohibited. If the exception is not removed from the implementation, then perhaps it should be added to the evaluation order section. Something like "The one exception is in function calls with *expression after a keyword argument: f(x=expr2, *expr1)." ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 13:43:57 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 17:43:57 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623865437.39.0.609313540536.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 7247f6f433846c6e37308a550e8e5eb6be379856 by Mark Dickinson in branch 'main': bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) https://github.com/python/cpython/commit/7247f6f433846c6e37308a550e8e5eb6be379856 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 13:44:02 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 17:44:02 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623865442.24.0.202082894935.issue44426@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25345 pull_request: https://github.com/python/cpython/pull/26760 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 13:44:08 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 16 Jun 2021 17:44:08 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623865448.12.0.891983657434.issue44426@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25346 pull_request: https://github.com/python/cpython/pull/26761 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 14:17:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 16 Jun 2021 18:17:22 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623867442.92.0.678645759595.issue23316@roundup.psfhosted.org> Guido van Rossum added the comment: > "The one exception is in function calls with *expression after a keyword argument: f(x=expr2, *expr1)." So the question before us is whether to add this phrase to the docs, or to tweak the compiler to fix it. It is certainly convenient to update the docs rather than expend the resources to change the compiler for what looks like a rare corner case. How certain are we that this is truly the only exception? Can someone read the compiler source code related to argument order, or experiment with all the different permutations of positional args, keyword args, *args, and **kwargs? (Fortunately the evaluation order is independent from the function definition, so it's really just all permutations of those four things.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:12:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 19:12:53 +0000 Subject: [issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error In-Reply-To: <1427377647.96.0.0955568014503.issue23786@psf.upfronthosting.co.za> Message-ID: <1623870773.19.0.398328459124.issue23786@roundup.psfhosted.org> Irit Katriel added the comment: Can this be close (as third party?) or is there anything left to do? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:13:56 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 19:13:56 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623870836.72.0.94063084724.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 686c6f303a6e9e54b50401be0ae3dc6aa2fcf05a by Miss Islington (bot) in branch '3.9': bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) (GH-26761) https://github.com/python/cpython/commit/686c6f303a6e9e54b50401be0ae3dc6aa2fcf05a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:13:54 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 19:13:54 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623870834.79.0.575706986229.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset c689e0a7e2a25621da82f22cc64d089eae05e753 by Miss Islington (bot) in branch '3.10': bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) (GH-26760) https://github.com/python/cpython/commit/c689e0a7e2a25621da82f22cc64d089eae05e753 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:15:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 16 Jun 2021 19:15:15 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623870915.21.0.411439520594.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: > and we can certainly change it Done. Closing here, but I've opened a Sphinx issue at https://github.com/sphinx-doc/sphinx/issues/9354 ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:23:02 2021 From: report at bugs.python.org (Ryan Rudes) Date: Wed, 16 Jun 2021 19:23:02 +0000 Subject: [issue44437] Add multimap() function similar to map(), but with multiprocessing functionality to the multiprocessing module Message-ID: <1623871382.47.0.596035925697.issue44437@roundup.psfhosted.org> Change by Ryan Rudes : ---------- components: Tkinter nosy: Ryan-Rudes priority: normal severity: normal status: open title: Add multimap() function similar to map(), but with multiprocessing functionality to the multiprocessing module type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:31:10 2021 From: report at bugs.python.org (Ryan Rudes) Date: Wed, 16 Jun 2021 19:31:10 +0000 Subject: [issue44437] Add multimap() function similar to map(), but with multiprocessing functionality to the multiprocessing module Message-ID: <1623871870.18.0.829239115474.issue44437@roundup.psfhosted.org> Change by Ryan Rudes : ---------- keywords: +patch pull_requests: +25347 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26762 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 15:38:29 2021 From: report at bugs.python.org (Ryan Rudes) Date: Wed, 16 Jun 2021 19:38:29 +0000 Subject: [issue44437] Add multimap() function similar to map(), but with multiprocessing functionality to the multiprocessing module Message-ID: <1623872309.89.0.00644333233938.issue44437@roundup.psfhosted.org> Change by Ryan Rudes : ---------- components: +Library (Lib) -Tkinter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 16:30:58 2021 From: report at bugs.python.org (Peter) Date: Wed, 16 Jun 2021 20:30:58 +0000 Subject: [issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error In-Reply-To: <1427377647.96.0.0955568014503.issue23786@psf.upfronthosting.co.za> Message-ID: <1623875458.66.0.351556707381.issue23786@roundup.psfhosted.org> Peter added the comment: We've migrated our python process off Solaris. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 16:49:44 2021 From: report at bugs.python.org (Francis Charette Migneault) Date: Wed, 16 Jun 2021 20:49:44 +0000 Subject: [issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group In-Reply-To: <1613701721.93.0.742004676065.issue43259@roundup.psfhosted.org> Message-ID: <1623876584.49.0.650656767392.issue43259@roundup.psfhosted.org> Francis Charette Migneault added the comment: I have found that the only thing argparse is actually missing is to forward the actions to the generated mutually exclusive group in _add_container_actions method. class SubArgumentParserFixedMutExtGroups(argparse.ArgumentParser): def _add_container_actions(self, container): groups = container._mutually_exclusive_groups container._mutually_exclusive_groups = [] # temporary override just so it is not processed super(SubArgumentParserFixedMutexGroups, self)._add_container_actions(container) # same as original loop, but with extra append of actions in created mutex for group in groups: mutex_group = self.add_mutually_exclusive_group(required=group.required) for action in group._group_actions: mutex_group._group_actions.append(action) When printing help, this resolves correctly. The actions can be found because they are already added when parsing the group of the parent parser that contains the mutex. Snippet below. # same as other comment examples parser = argparse.ArgumentParser() parser_group = parser.add_argument_group("INPUT OPTIONS") parser_group_mutually_exclusive = parser_group.add_mutually_exclusive_group(required=False) parser_group_mutually_exclusive.add_argument("--from-args") parser_group_mutually_exclusive.add_argument("--from-files") parser_group_mutually_exclusive.add_argument("--from-stdin") parser_group.add_argument("-0", help="null delimited pathnames") parser.print_help() usage: pydevconsole.py [-h] [--from-args FROM_ARGS | --from-files FROM_FILES | --from-stdin FROM_STDIN] [-0 0] optional arguments: -h, --help show this help message and exit INPUT OPTIONS: --from-args FROM_ARGS --from-files FROM_FILES --from-stdin FROM_STDIN -0 0 null delimited pathnames # now add the subparser with tweaked ArgumentParser parent = SubArgumentParserFixedMutexGroups() subpar = parent.add_subparsers() subpar.add_parser("test", add_help=False, parents=[parser]) parent.parse_args(["test", "--help"]) usage: pydevconsole.py test [-h] [--from-args FROM_ARGS | --from-files FROM_FILES | --from-stdin FROM_STDIN] [-0 0] optional arguments: -h, --help show this help message and exit INPUT OPTIONS: --from-args FROM_ARGS --from-files FROM_FILES --from-stdin FROM_STDIN -0 0 null delimited pathnames ---------- nosy: +fmigneault _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:02:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 21:02:38 +0000 Subject: [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds In-Reply-To: <1507815780.34.0.213398074469.issue31772@psf.upfronthosting.co.za> Message-ID: <1623877358.68.0.392236987376.issue31772@roundup.psfhosted.org> Irit Katriel added the comment: Looks like this was merged here: https://github.com/akvadrako/cpython/commit/fe9b43a0928a5ef80a4daf3a50af300e5eaeda9a Can we close? ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:12:20 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 16 Jun 2021 21:12:20 +0000 Subject: [issue44437] Add multimap() function similar to map(), but with multiprocessing functionality to the multiprocessing module Message-ID: <1623877940.27.0.441556984374.issue44437@roundup.psfhosted.org> New submission from Raymond Hettinger : Marking as closed for the reasons mentioned in the PR. I you want to go forward, consider starting a thread on python-ideas. ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:23:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 16 Jun 2021 21:23:58 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623878638.34.0.630164828833.issue23316@roundup.psfhosted.org> Terry J. Reedy added the comment: The following does not consider keyword-only args with or without defaults. My understanding is the the compiler does not know or considered the signature of the function when evaluating the args. from dis import dis from itertools import permutations as pm # My first use of this. for a1, a2, a3, a4 in pm(('a', 'b=b', '*g', '**k')): s = f"e({a1}, {a2}, {a3}, {a4})" print(s) try: cd = compile(s, '', 'eval') except SyntaxError as e: print(e) continue dis(cd) Since positional arg cannot follow keyword arg or keyword arg unpacking and positional arg unpacking cannot follow keyword arg unpacking, only 5 orders of 'a', 'b=b', '*g', and '**k' are legal. e(a, b=b, *g, **k) g before b e(a, *g, b=b, **k) normal e(a, *g, **k, b=b) normal e(*g, a, b=b, **k) normal e(*g, a, **k, b=b) normal For whatever reason, the byte code is more complicated without function arguments. e(a, b=b, *g, **k) 1 0 LOAD_NAME 0 (e) 2 LOAD_NAME 1 (a) 4 BUILD_LIST 1 6 LOAD_NAME 2 (g) 8 LIST_EXTEND 1 10 LIST_TO_TUPLE 12 LOAD_CONST 0 ('b') 14 LOAD_NAME 3 (b) 16 BUILD_MAP 1 18 LOAD_NAME 4 (k) 20 DICT_MERGE 1 22 CALL_FUNCTION_EX 1 24 RETURN_VALUE The exceptional case essentially says that positional arg unpacking cannot follow keyword args. This is consistent with the other 3 prohibitions. Arguments passed by position form one group, those passed by name another. The nice, simple, and consistent rule is that positional args (and unpacking thereof) cannot follow keyword args (and unpacking there). But in this one case, instead of raising SyntaxError like the other 3 prohibited orders, the compiler in effect rewrites* the code in a legal order -- and then compiles as if written that way. How often does it rewrite code to make it correct? I think it would have been better to have stuck with 'positional before keyword'. Can we consider deprecating something rare and easy to get wrong? Thinking more, I might prefer leaving the Evaluation Order section alone, as it is correct with respect to the internal rewrite, and revise the explanation of the quirk in the function doc. We could deprecate the mis-ordering at least in the doc. * After writing this, I notice Neil's suggestion that PEP 8 'prohibit' named params before iterable (positional) unpacking, so that a fixer program could literally rewrite in the correct order. I am suggesting that it is useful to take the viewpoint that the compiler is doing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:26:12 2021 From: report at bugs.python.org (Arman Sargsyan) Date: Wed, 16 Jun 2021 21:26:12 +0000 Subject: [issue44438] argparser documentation error Message-ID: <1623878772.88.0.230451377939.issue44438@roundup.psfhosted.org> New submission from Arman Sargsyan : URL - https://docs.python.org/3/howto/argparse.html The following code will return a type error: import argparse parser = argparse.ArgumentParser() parser.add_argument("square", help="display a square of a given number") args = parser.parse_args() print(args.square**2) This should be changed to: import argparse parser = argparse.ArgumentParser() parser.add_argument("square", help="display a square of a given number") args = parser.parse_args() print(int(args.square)**2) ---------- components: Parser messages: 395963 nosy: arsar7, lys.nikolaou, pablogsal priority: normal pull_requests: 25349 severity: normal status: open title: argparser documentation error type: resource usage 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 Jun 16 17:30:27 2021 From: report at bugs.python.org (Arman Sargsyan) Date: Wed, 16 Jun 2021 21:30:27 +0000 Subject: [issue44438] argparser documentation error In-Reply-To: <1623878772.88.0.230451377939.issue44438@roundup.psfhosted.org> Message-ID: <1623879027.71.0.0042012192215.issue44438@roundup.psfhosted.org> Arman Sargsyan added the comment: I have signed the CLA ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:47:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 16 Jun 2021 21:47:17 +0000 Subject: [issue23394] No garbage collection at end of main thread In-Reply-To: <1423086136.45.0.600991266786.issue23394@psf.upfronthosting.co.za> Message-ID: <1623880037.29.0.590706870564.issue23394@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:47:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Jun 2021 21:47:24 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623880044.31.0.304870439688.issue23316@roundup.psfhosted.org> Serhiy Storchaka added the comment: See also thread "Order of positional and keyword arguments" on the Python-Dev mailing list (https://mail.python.org/archives/list/python-dev at python.org/thread/I6AUYV6DVEMP7XVYVDWC62N6PK6FHX3H/). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:50:35 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 16 Jun 2021 21:50:35 +0000 Subject: [issue44438] argparser documentation error In-Reply-To: <1623878772.88.0.230451377939.issue44438@roundup.psfhosted.org> Message-ID: <1623880235.08.0.19590006951.issue44438@roundup.psfhosted.org> Raymond Hettinger added the comment: If you read the text afterwards, you'll see that raising a TypeError was the intended purpose of this example. Just afterward, it shows how to use *type* to make the code correct. ---------- assignee: -> rhettinger nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 17:56:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 16 Jun 2021 21:56:42 +0000 Subject: [issue44431] Add command-line functionality to uuid module In-Reply-To: <1623816886.43.0.954667545648.issue44431@roundup.psfhosted.org> Message-ID: <1623880602.25.0.673088684424.issue44431@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think it would be a useful feature. But would not be better to make interface similar to interface of standard Linux command uuidgen? In any case it should support the -h or --help options. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 18:06:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 16 Jun 2021 22:06:09 +0000 Subject: [issue44431] Add command-line functionality to uuid module In-Reply-To: <1623816886.43.0.954667545648.issue44431@roundup.psfhosted.org> Message-ID: <1623881169.46.0.229619566466.issue44431@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 18:39:52 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 16 Jun 2021 22:39:52 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623883192.62.0.409640927255.issue23316@roundup.psfhosted.org> Guido van Rossum added the comment: Well, it seems we're stuck -- we can't make the grammar more restrictive (at least, I don't think we should, since it is a backwards incompatibility), so we'll have to live with the exception. Since it is now clear what the rule is, we can update the docs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 16 23:05:17 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 17 Jun 2021 03:05:17 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1623899117.42.0.756609549505.issue44318@roundup.psfhosted.org> Andrei Kulakov added the comment: Bluenix, can you describe your use case in more detail? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:01:58 2021 From: report at bugs.python.org (Neil Girdhar) Date: Thu, 17 Jun 2021 05:01:58 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623906118.28.0.950298483105.issue23316@roundup.psfhosted.org> Neil Girdhar added the comment: FYI: https://github.com/PyCQA/pylint/issues/4586 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:05:24 2021 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Jun 2021 05:05:24 +0000 Subject: [issue44439] PickleBuffer doesn't have __len__ method Message-ID: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> New submission from Ma Lin : If run this code, it will raise an exception: import pickle import lzma import pandas as pd with lzma.open("test.xz", "wb") as file: pickle.dump(pd.DataFrame(range(1_000_000)), file, protocol=5) The exception: Traceback (most recent call last): File "E:\testlen.py", line 7, in pickle.dump(pd.DataFrame(range(1_000_000)), file, protocol=5) File "D:\Python39\lib\lzma.py", line 234, in write self._pos += len(data) TypeError: object of type 'pickle.PickleBuffer' has no len() The exception is raised in lzma.LZMAFile.write() method: https://github.com/python/cpython/blob/v3.10.0b2/Lib/lzma.py#L238 PickleBuffer doesn't have .__len__ method, is it intended? ---------- messages: 395971 nosy: malin, pitrou priority: normal severity: normal status: open title: PickleBuffer doesn't have __len__ method _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:13:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Jun 2021 05:13:04 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623906784.62.0.330586679415.issue23316@roundup.psfhosted.org> Serhiy Storchaka added the comment: Would not be be better in long term to get rid of irregularities? It would make the grammar simpler and the documentation clearer. The only use case of such syntax in wrappers, but they always can be rewritten in other style, with natural order of arguments evaluation. def wrapper(*args, **kw): return wrapped_fn(*args, some_arg=1, **kw) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:13:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Jun 2021 05:13:15 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623906795.56.0.256802305072.issue23316@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:36:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 17 Jun 2021 05:36:11 +0000 Subject: [issue44439] PickleBuffer doesn't have __len__ method In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1623908171.23.0.144706559847.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: Oh, LZMAFile.write() should not use len() directly on input data because it does not always work correctly with memoryview and other objects supporting the buffer protocol. It should use memoryview(data).nbytes or data = memoryview(data).cast('B') if other byte-oriented operations (indexing, slicing) are used. See for example Lib/gzip.py, Lib/_pyio.py, Lib/_compression.py, Lib/ssl.py, Lib/socketserver.py, Lib/wave.py. ---------- nosy: +nadeem.vawda, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 01:55:47 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 17 Jun 2021 05:55:47 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623909347.38.0.676347737269.issue23316@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: -serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 02:12:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 06:12:45 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623910365.63.0.150938578638.issue23316@roundup.psfhosted.org> Irit Katriel added the comment: It should be possible to make the compiler emit code that evaluates the arg values left to right in all cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 02:15:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 17 Jun 2021 06:15:05 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623910505.04.0.821950478298.issue23316@roundup.psfhosted.org> Guido van Rossum added the comment: Looks like Terry accidentally removed Serhiy. Adding him back. ---------- nosy: +Guido.van.Rossum, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 02:26:03 2021 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Jun 2021 06:26:03 +0000 Subject: [issue44439] PickleBuffer doesn't have __len__ method In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1623911163.55.0.887104739231.issue44439@roundup.psfhosted.org> Ma Lin added the comment: Ok, I'm working on a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 03:24:51 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 17 Jun 2021 07:24:51 +0000 Subject: [issue38211] clean up type_init() In-Reply-To: <1568794289.26.0.422992703771.issue38211@roundup.psfhosted.org> Message-ID: <1623914691.5.0.718592023469.issue38211@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'm marking this as closed/fixed. Mark, please reopen if you disagree :) ---------- nosy: +erlendaasland resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 03:39:57 2021 From: report at bugs.python.org (Ma Lin) Date: Thu, 17 Jun 2021 07:39:57 +0000 Subject: [issue44439] PickleBuffer doesn't have __len__ method In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1623915597.49.0.790242610888.issue44439@roundup.psfhosted.org> Change by Ma Lin : ---------- keywords: +patch pull_requests: +25350 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26764 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 04:05:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 17 Jun 2021 08:05:54 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623917154.4.0.0226143993385.issue23316@roundup.psfhosted.org> Terry J. Reedy added the comment: (The nosy list change was an accident of my local copy not being complete refreshed before posting.) If (b=b, *c) were evaluated in order, then the byte code for b=b and any subsequent keyword arguments would have to be put aside, such as in a separate buffer, until it was known that there would be no following *exp. Without lookahead, this is known when either **kw or closing ) is reached. At that point, the keyword buffer would be copied to the main buffer. It might actually be easier to remove all order restrictions and compile all keyword values to a side buffer, to be copied to the main buffer when the closing ) is reached. One version of the question I am raising is this: given that f(a, b=b) and f(*(a,), b=b) have the same effect (are alternate spellings of the same instruction(s)), why should f(b=b, a) and f(b=b, *(a,)) *not* have the same effect, with one spelling being prohibited and the other not? The meaning of '*expression' is defined as having the same effect as an equivalent sequence of positional argument expression in the same place as the expression. "If the syntax *expression appears in the function call, expression must evaluate to an iterable. Elements from these iterables are treated as if they were additional positional arguments. For the call f(x1, x2, *y, x3, x4), if y evaluates to a sequence y1, ?, yM, this is equivalent to a call with M+4 positional arguments x1, x2, y1, ?, yM, x3, x4." The first sentence of the next paragrapsh, allowing only *exp to follow b=exp, contradicts the last line above. I am sorry I did not read these paregraphs carefully until now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 04:36:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 08:36:23 +0000 Subject: [issue16437] issubclass doc improvement In-Reply-To: <1352383480.96.0.515607744563.issue16437@psf.upfronthosting.co.za> Message-ID: <1623918983.02.0.974768625197.issue16437@roundup.psfhosted.org> Irit Katriel added the comment: @Ken - not quite. This issue is about isinstance containing "(or recursively, other such tuples)" which is not there for issubclass. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 05:12:39 2021 From: report at bugs.python.org (Karolina Surma) Date: Thu, 17 Jun 2021 09:12:39 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623921159.88.0.111293851088.issue44426@roundup.psfhosted.org> Karolina Surma added the comment: Thanks for the fix, this indeed worked. Documentation however still doesn't build successfully, this time with a traceback: Warning, treated as error: /builddir/build/BUILD/Python-3.10.0b2/Doc/c-api/object.rst:314:Error in declarator or parameters Error in declarator or parameters Invalid C declaration: Expected identifier, got keyword: default [error at 62] Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t default) --------------------------------------------------------------^ make: *** [Makefile:51: build] Error 2 I'm afraid there will be more on the way as this item is resolved. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 05:40:05 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 09:40:05 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623922805.59.0.496412643534.issue44389@roundup.psfhosted.org> miss-islington added the comment: New changeset c544393b89f9b3e2b1a22588fc9ae58019314879 by Joe in branch 'main': bpo-44389: Fix typo in ssl deprecation warning message (GH-26754) https://github.com/python/cpython/commit/c544393b89f9b3e2b1a22588fc9ae58019314879 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 05:40:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 09:40:17 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623922817.48.0.0519075017825.issue44389@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25351 pull_request: https://github.com/python/cpython/pull/26765 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:01:15 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 10:01:15 +0000 Subject: [issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2' In-Reply-To: <1623399838.97.0.436743234737.issue44389@roundup.psfhosted.org> Message-ID: <1623924075.81.0.1064319145.issue44389@roundup.psfhosted.org> miss-islington added the comment: New changeset 08f2b9dedea13d2e9d11c189914387db3a66e2ca by Miss Islington (bot) in branch '3.10': bpo-44389: Fix typo in ssl deprecation warning message (GH-26754) https://github.com/python/cpython/commit/08f2b9dedea13d2e9d11c189914387db3a66e2ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:06:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Jun 2021 10:06:16 +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: <1623924376.84.0.221696714725.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 00710e6346fd2394aa020b2dfae170093effac98 by Erlend Egeberg Aasland in branch 'main': bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351) https://github.com/python/cpython/commit/00710e6346fd2394aa020b2dfae170093effac98 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:06:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 10:06:17 +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: <1623924377.99.0.615983368107.issue43908@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25352 pull_request: https://github.com/python/cpython/pull/26766 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:10:19 2021 From: report at bugs.python.org (Alexander Dietz) Date: Thu, 17 Jun 2021 10:10:19 +0000 Subject: [issue44440] logging does not work as documented (setLevel) Message-ID: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> New submission from Alexander Dietz : Using python 3.8.10 and the documentation https://docs.python.org/3.8/library/logging.html it seems that either the documentation is incorrect/unclear, or that the logging module does not work as described. Reading on the Logger Object and the setLevel method I created the attached python code, which does not work as expected. As I set the level to "DEBUG", and the documentation clearly says " Logging messages which are less severe than level will be ignored". But having set the level to DEBUG, even the more "severe" info message is ignored. That is clearly contradicting the documentation! ---------- assignee: docs at python components: Documentation files: problem.py messages: 395984 nosy: alex4200, docs at python priority: normal severity: normal status: open title: logging does not work as documented (setLevel) type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50114/problem.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:14:12 2021 From: report at bugs.python.org (kryheb) Date: Thu, 17 Jun 2021 10:14:12 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization Message-ID: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> New submission from kryheb : Hi all, I observed misbehavior trying to embed the Python interpreter into a C app. It seems that after re-initialization, PyImport_Inittab is malformed and points to the memory freed _PyImport_Fini2. Steps to reproduce: 1. Append embedded module 2. Initialize Python from config with run_filename 3. Run main with an infinite loop 4. Interrupt script execution with async call 5. Finalize Python 6. Repeat all above Observed behavior: The script is executed at first iteration, but re-initialization fails with an error: " Traceback (most recent call last): File "", line 1187, in _install_external_importers ModuleNotFoundError: No module named 'posix' Error: external importer setup failed " Head of modules list at fist run: ------ Modules: ------ #0 'posix' #1 'errno' #2 'pwd' ---------------------- and after re-initialization: ------ Modules: ------ #0 'P '' #1 'errno' #2 'pwd' ---------------------- An issue discovered on: Fedora 33 gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1) python3-devel.x86_64 3.9.5-2.fc33 Issue still exists on the latest main and on the rc 3.10 Source code to reproduce an issue in attachment. Best regards, Krystian Heberlein ---------- components: C API, Library (Lib) files: inittab-bug.c messages: 395985 nosy: kryheb priority: normal severity: normal status: open title: Malformed PyImport_Inittab after re-initialization versions: Python 3.10, Python 3.9 Added file: https://bugs.python.org/file50115/inittab-bug.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:16:29 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 17 Jun 2021 10:16:29 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623924989.61.0.485398734236.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks. That one's a genuine keyword. Looks like what we probably need to do is get a list of all these errors, so that they can all be fixed at once. Presumably running without the "-W" flag would make that easier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:19:39 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 10:19:39 +0000 Subject: [issue44440] logging does not work as documented (setLevel) In-Reply-To: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> Message-ID: <1623925179.55.0.0719412965502.issue44440@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: Logging can be quite tricky. There are filters at multiple levels. In this case, you didn't set up the "global logging" and I am guessing, by default, it only shows WARNING and above. You can fix your problem by doing: logging.basicConfig(level=logging.DEBUG) ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:19:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 17 Jun 2021 10:19:47 +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: <1623925187.8.0.309365216088.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7297d74251de3b1c02dcdb9ca281461cc7fb4535 by Miss Islington (bot) in branch '3.10': bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351) (GH-26766) https://github.com/python/cpython/commit/7297d74251de3b1c02dcdb9ca281461cc7fb4535 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:21:12 2021 From: report at bugs.python.org (kryheb) Date: Thu, 17 Jun 2021 10:21:12 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1623925272.32.0.118409813635.issue44441@roundup.psfhosted.org> Change by kryheb : ---------- keywords: +patch pull_requests: +25353 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26767 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:29:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 10:29:15 +0000 Subject: [issue16376] wrong type for wintypes.BYTE In-Reply-To: <1351702975.6.0.783969996516.issue16376@psf.upfronthosting.co.za> Message-ID: <1623925755.38.0.21184112198.issue16376@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +amaury.forgeotdarc, belopolsky 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 Thu Jun 17 06:33:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 10:33:23 +0000 Subject: [issue20115] NUL bytes in commented lines In-Reply-To: <1388771953.42.0.332804570753.issue20115@psf.upfronthosting.co.za> Message-ID: <1623926003.29.0.247804408315.issue20115@roundup.psfhosted.org> Irit Katriel added the comment: See also issue1105770. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:37:21 2021 From: report at bugs.python.org (Bluenix) Date: Thu, 17 Jun 2021 10:37:21 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1623926241.17.0.00749392352928.issue44318@roundup.psfhosted.org> Bluenix added the comment: My exact use-case is that I am subclassing asyncio.Semaphore to change some functionality (override `release()` to do nothing and set up tasks to schedule calls to reset the counter). I am expecting *a lot* of these instances so (like Serhiy Storchaka nicely put it) I would like to reduce the memory footprint of these classes by using __slots__. The issue now becomes that asyncio.Semaphore (like most other asyncio classes) have not defined __slots__, this prohibits my subclass from taking advantage of __slots__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:39:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 10:39:48 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623926388.13.0.651638097825.issue43693@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: Mark.Shannon -> eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:45:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 10:45:46 +0000 Subject: [issue9102] pybench: Cannot compare 2.x and 3.x benchmarks In-Reply-To: <1277739722.07.0.677340784013.issue9102@psf.upfronthosting.co.za> Message-ID: <1623926746.22.0.899975250378.issue9102@roundup.psfhosted.org> Irit Katriel added the comment: Can we close this? I don't think we are still interested in performance comparisons with Python 2. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 06:50:02 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Thu, 17 Jun 2021 10:50:02 +0000 Subject: [issue9102] pybench: Cannot compare 2.x and 3.x benchmarks In-Reply-To: <1277739722.07.0.677340784013.issue9102@psf.upfronthosting.co.za> Message-ID: <1623927002.11.0.216046286908.issue9102@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: Yes, closing. ---------- stage: needs patch -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:05:05 2021 From: report at bugs.python.org (Alexander Dietz) Date: Thu, 17 Jun 2021 11:05:05 +0000 Subject: [issue44440] logging does not work as documented (setLevel) In-Reply-To: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> Message-ID: <1623927905.64.0.830243296432.issue44440@roundup.psfhosted.org> Alexander Dietz added the comment: I was not asking for a solution or a workaround. I simply wanted to submit this bug in either the code or the documentation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:06:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 11:06:25 +0000 Subject: [issue12600] Add example of using load_tests to parameterise Test Cases In-Reply-To: <1311226769.48.0.369455670372.issue12600@psf.upfronthosting.co.za> Message-ID: <1623927985.48.0.819148839189.issue12600@roundup.psfhosted.org> Irit Katriel added the comment: It remains to update the load_test doc along the lines of Michael's suggestion in msg140999. ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.11 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:14:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 11:14:29 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject Message-ID: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> New submission from Mark Shannon : When calling frame.clear(), the globals (and builtins) are cleared. This is not the case in 3.10. We should restore the 3.10 behavior, as there is no reason not to. Victor, you've mentioned this problem. Did you have a specific example I can add as a test? ---------- assignee: Mark.Shannon messages: 395995 nosy: Mark.Shannon, vstinner priority: normal severity: normal status: open title: Globals (and presumably builtins) are cleared premuturely in FrameObject type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:25:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 11:25:21 +0000 Subject: [issue10582] PyErr_PrintEx exits silently when passed SystemExit exception In-Reply-To: <1291056392.92.0.0604779345933.issue10582@psf.upfronthosting.co.za> Message-ID: <1623929121.74.0.130654243935.issue10582@roundup.psfhosted.org> Irit Katriel added the comment: This was removed in https://github.com/python/cpython/pull/13390. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:41:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 11:41:18 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1623930078.61.0.34482323155.issue44442@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25355 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26768 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:47:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 11:47:59 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1623930479.99.0.742529291147.issue43024@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:49:39 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Thu, 17 Jun 2021 11:49:39 +0000 Subject: [issue14322] More test coverage for hmac In-Reply-To: <1331831609.33.0.520236800519.issue14322@psf.upfronthosting.co.za> Message-ID: <1623930579.08.0.968750525672.issue14322@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:49:35 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Thu, 17 Jun 2021 11:49:35 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1623930575.03.0.994013612594.issue44405@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:50:32 2021 From: report at bugs.python.org (Karolina Surma) Date: Thu, 17 Jun 2021 11:50:32 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623930632.92.0.780000919757.issue44426@roundup.psfhosted.org> Karolina Surma added the comment: Thanks for the suggestion, I reran the build without -W option. Fortunately, the output shows that the reported errors shall be the only ones. Build logs from the test build for reference: https://download.copr.fedorainfracloud.org/results/ksurma/pygments-2.9.0/fedora-rawhide-x86_64/02257459-python3-docs/build.log.gz ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 07:51:33 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Thu, 17 Jun 2021 11:51:33 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623930693.2.0.922800832503.issue44324@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 08:09:05 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 12:09:05 +0000 Subject: [issue44440] logging does not work as documented (setLevel) In-Reply-To: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> Message-ID: <1623931745.29.0.845726024623.issue44440@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: The sentence within the doc should not be considered in isolation. The "Logger" object is *not* ignoring the message (in accordance with the documentation and your expectation), but the "Handler" is, see https://docs.python.org/3.8/library/logging.html#logging.Handler.setLevel and here: https://docs.python.org/3/howto/logging.html: "The default level is WARNING, which means that only events of this level and above will be tracked, unless the logging package is configured to do otherwise." Logging is quite complicated, and reading the API reference is not the best starting point, as is noted at the top of the page and links provided. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 08:22:06 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Jun 2021 12:22:06 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623932526.44.0.997093061472.issue44365@roundup.psfhosted.org> Eric V. Smith added the comment: I was thinking about something like: @dataclass class FtpHelper(ftplib.FTP): my_host: str my_user: str lookup_password: InitVar[Callable] def __post_init__(self, lookup_password): super().__init__(host=self.my_host, user=self.my_user, passwd=lookup_password()) def get_password(): return "a password" ftp = FtpHelper(hostname, username, get_password) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 08:34:23 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Jun 2021 12:34:23 +0000 Subject: [issue44443] dataclass looks up default on the class, not the classes __dict__ Message-ID: <1623933263.46.0.398257064207.issue44443@roundup.psfhosted.org> New submission from Eric V. Smith : Consider: class FtpHelper(ftplib.FTP): host: str baz: str = 'baz default' >>> FtpHelper.host '' >>> FtpHelper.baz 'baz default' >>> getattr(FtpHelper, "host") '' >>> getattr(FtpHelper, "baz") 'baz default' But: >>> FtpHelper.__dict__['host'] Traceback (most recent call last): File "", line 1, in KeyError: 'host' >>> FtpHelper.__dict__['baz'] 'baz default' Now make this a dataclass, without a default value for baz: @dataclass class FtpHelper(ftplib.FTP): host: str baz: str This gives an error: TypeError: non-default argument 'baz' follows default argument And this is because it's picking up a default value for host from the base class ftplib.FTP, and generating an __init__ like: def __init__(self, host='', baz): @dataclass uses getattr(cls, field_name, MISSING) to find the default value for the field, but in this case that's wrong. I think what should happen is that it should use getattr(cls.__dict__, field_name, MISSING). This would be consistent with other features where dataclasses does not look in base classes for various things, but only in the class itself (like __hash__). ---------- assignee: eric.smith components: Library (Lib) messages: 396000 nosy: eric.smith priority: normal severity: normal status: open title: dataclass looks up default on the class, not the classes __dict__ versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 08:46:21 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Jun 2021 12:46:21 +0000 Subject: [issue44443] dataclass looks up default on the class, not the class's __dict__ In-Reply-To: <1623933263.46.0.398257064207.issue44443@roundup.psfhosted.org> Message-ID: <1623933981.69.0.706208138322.issue44443@roundup.psfhosted.org> Change by Eric V. Smith : ---------- title: dataclass looks up default on the class, not the classes __dict__ -> dataclass looks up default on the class, not the class's __dict__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 08:46:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Jun 2021 12:46:32 +0000 Subject: [issue44443] dataclass looks up default on the class, not the class's __dict__ In-Reply-To: <1623933263.46.0.398257064207.issue44443@roundup.psfhosted.org> Message-ID: <1623933992.71.0.671448550565.issue44443@roundup.psfhosted.org> Change by Eric V. Smith : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:01:31 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 17 Jun 2021 13:01:31 +0000 Subject: [issue44324] add a "expected expression" syntax error In-Reply-To: <1623011923.67.0.14438904408.issue44324@roundup.psfhosted.org> Message-ID: <1623934891.43.0.168849384437.issue44324@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:05:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 13:05:26 +0000 Subject: [issue14995] PyLong_FromString documentation should state that the string must be null-terminated In-Reply-To: <1338769973.67.0.784454345332.issue14995@psf.upfronthosting.co.za> Message-ID: <1623935126.99.0.815013727971.issue14995@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:09:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 13:09:49 +0000 Subject: [issue38146] QVariant NULL returns anomalous values in equality statements In-Reply-To: <1568316344.45.0.265967787088.issue38146@roundup.psfhosted.org> Message-ID: <1623935389.78.0.762257036561.issue38146@roundup.psfhosted.org> Irit Katriel added the comment: This looks like an issue with the way QVariant is defined. I'm not sure why you are reporting it as a Python bug? ---------- nosy: +iritkatriel resolution: -> third party status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:37:54 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 13:37:54 +0000 Subject: [issue14995] PyLong_FromString documentation should state that the string must be null-terminated In-Reply-To: <1338769973.67.0.784454345332.issue14995@psf.upfronthosting.co.za> Message-ID: <1623937074.48.0.563486884382.issue14995@roundup.psfhosted.org> Change by Henk-Jaap Wagenaar : ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:43:42 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 17 Jun 2021 13:43:42 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1623937422.13.0.0534569207567.issue44441@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 09:51:33 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 17 Jun 2021 13:51:33 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1623937893.74.0.606914535834.issue38820@roundup.psfhosted.org> Change by Christian Heimes : ---------- pull_requests: +25356 pull_request: https://github.com/python/cpython/pull/26769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 10:07:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 17 Jun 2021 14:07:17 +0000 Subject: [issue44443] dataclass looks up field default value on the class, not the class's __dict__ In-Reply-To: <1623933263.46.0.398257064207.issue44443@roundup.psfhosted.org> Message-ID: <1623938837.55.0.132393586901.issue44443@roundup.psfhosted.org> Change by Eric V. Smith : ---------- title: dataclass looks up default on the class, not the class's __dict__ -> dataclass looks up field default value on the class, not the class's __dict__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 10:18:19 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 17 Jun 2021 14:18:19 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1623939499.94.0.959043056429.issue44442@roundup.psfhosted.org> STINNER Victor added the comment: > Victor, you've mentioned this problem. Did you have a specific example I can add as a test? Sorry, I didn't have any reproducer. I vaguely recall an error in the unittest module when getting globals from a frame. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 10:49:48 2021 From: report at bugs.python.org (fastway track) Date: Thu, 17 Jun 2021 14:49:48 +0000 Subject: [issue44444] How can track and trace your parcel live? Message-ID: <1623941388.28.0.28797105255.issue44444@roundup.psfhosted.org> New submission from fastway track : Do you feel worried about your parcel and also get bored collecting the parcel from depo? Fastway Tracking is the best service for tracking the parcel. You are looking for a service in which you can track your parcel and also get the parcel at home? Then this is the right page for the solution to your problem. And it also provides the service of delivery. https://fastwaytracking.com/ ---------- messages: 396003 nosy: fastwaytracking123 priority: normal severity: normal status: open title: How can track and trace your parcel live? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 10:53:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 17 Jun 2021 14:53:06 +0000 Subject: [issue44444] How can track and trace your parcel live? In-Reply-To: <1623941388.28.0.28797105255.issue44444@roundup.psfhosted.org> Message-ID: <1623941586.58.0.332544952065.issue44444@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:03:28 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 17 Jun 2021 15:03:28 +0000 Subject: [issue44445] Add `site-include` install scheme path in sysconfig Message-ID: <1623942208.43.0.621445516609.issue44445@roundup.psfhosted.org> New submission from Filipe La?ns : During the distutils deprecation, we have identified that there is no good replacement for the distutils `headers` install path. This path defines where packages are supposed to install headers on the system. The setuptools equivalent would be `include`/`platinclude`, but these paths depend on `installed_base`/`installed_platbase`, which makes them the same on virtual environments. For this reason, they are not very suitable as a `headers` replacement -- if a package installs to `include` on a virtual environment, those files will be available everywhere. { ... 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': '{installed_platbase}/include/python{py_version_short}{abiflags}', } I propose introducing two new paths, `site-include` and `site-platinclude`, as follows: { ... 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platinclude': '{installed_platbase}/include/python{py_version_short}{abiflags}', 'site-include': '{base}/include/python{py_version_short}{abiflags}-site', 'site-platinclude': '{platbase}/include/python{py_version_short}{abiflags}-site', } This would make them different paths on virtual environments and would allow us to install header files there instead of `include`/`platinclude`. Does anyone have a better idea? Or is there perhaps something I have missed? --- Hopefully, this could go into Python 3.10, so that users can easily replace distutils usages with sysconfig. I understand if that may be unlikely. --- Relevant links: https://discuss.python.org/t/clarification-on-a-wheels-header-data/9305 https://github.com/pypa/pip/issues/9617 ---------- messages: 396004 nosy: FFY00, dstufft, eric.araujo, jaraco, pablogsal, steve.dower, tarek priority: high severity: normal status: open title: Add `site-include` install scheme path in sysconfig versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:19:22 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 17 Jun 2021 15:19:22 +0000 Subject: [issue1105770] null source chars handled oddly by tokenize Message-ID: <1623943162.0.0.782209614828.issue1105770@roundup.psfhosted.org> Guido van Rossum added the comment: Closing in favor of issue20115. ---------- nosy: +gvanrossum resolution: -> duplicate stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:25:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 17 Jun 2021 15:25:53 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1623917154.4.0.0226143993385.issue23316@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I'm currently not very interested in philosophizing about why we allow one syntax but not the other. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:37:23 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 17 Jun 2021 15:37:23 +0000 Subject: [issue44444] Spam In-Reply-To: <1623941388.28.0.28797105255.issue44444@roundup.psfhosted.org> Message-ID: <1623944243.62.0.851839775533.issue44444@roundup.psfhosted.org> Zachary Ware added the comment: So disappointing that this issue number was taken by spam :( ---------- nosy: +zach.ware -fastwaytracking123 title: How can track and trace your parcel live? -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:37:40 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 17 Jun 2021 15:37:40 +0000 Subject: [issue44444] Spam In-Reply-To: <1623944243.62.0.851839775533.issue44444@roundup.psfhosted.org> Message-ID: <1623944260.78.0.513336233839.issue44444@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg396003 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:37:31 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 17 Jun 2021 15:37:31 +0000 Subject: [issue44444] Spam In-Reply-To: <1623941388.28.0.28797105255.issue44444@roundup.psfhosted.org> Message-ID: <1623944251.37.0.0631419160382.issue44444@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:40:11 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 15:40:11 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1623944411.55.0.370991432055.issue44442@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:40:00 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 15:40:00 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1623944400.51.0.196989071366.issue44442@roundup.psfhosted.org> Mark Shannon added the comment: No problem, I've added a simple test. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 11:42:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 17 Jun 2021 15:42:20 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1623944540.37.0.0339911961687.issue44032@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25357 pull_request: https://github.com/python/cpython/pull/26771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:08:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 17 Jun 2021 16:08:45 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1623946125.87.0.557371411938.issue23316@roundup.psfhosted.org> Terry J. Reedy added the comment: I was pointing out what to me is a second related contradiction in the doc, between one sentence and the next. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:11:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 16:11:46 +0000 Subject: [issue31299] Add "ignore_modules" option to TracebackException.format() In-Reply-To: <1503992745.47.0.33675937395.issue31299@psf.upfronthosting.co.za> Message-ID: <1623946306.51.0.220529267528.issue31299@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25358 pull_request: https://github.com/python/cpython/pull/26772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:14:37 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 16:14:37 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1623946477.7.0.067897264607.issue43024@roundup.psfhosted.org> miss-islington added the comment: New changeset f73377d57c5272390de63cccc3c292c44689310a by Irit Katriel in branch 'main': bpo-43024: improve signature (in help, etc) for functions taking sent? (GH-24331) https://github.com/python/cpython/commit/f73377d57c5272390de63cccc3c292c44689310a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:14:40 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 16:14:40 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1623946480.36.0.600041710283.issue43024@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25359 pull_request: https://github.com/python/cpython/pull/26773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:34:07 2021 From: report at bugs.python.org (E. Paine) Date: Thu, 17 Jun 2021 16:34:07 +0000 Subject: [issue44384] test_ttk_guionly: 2 tests fail once each on Pipelines Ubuntu In-Reply-To: <1623356113.96.0.920783829552.issue44384@roundup.psfhosted.org> Message-ID: <1623947647.24.0.963795707218.issue44384@roundup.psfhosted.org> Change by E. Paine : ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:42:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 16:42:04 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1623948124.58.0.0237975723061.issue43024@roundup.psfhosted.org> Irit Katriel added the comment: New changeset eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983 by Miss Islington (bot) in branch '3.10': bpo-43024: improve signature (in help, etc) for functions taking sent? (GH-24331) (GH-26773) https://github.com/python/cpython/commit/eb0a6801bef4f68eebf6fdb2b7a32c32a5b6c983 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 12:42:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 17 Jun 2021 16:42:40 +0000 Subject: [issue43024] improve signature (in help, etc) for functions taking sentinel defaults In-Reply-To: <1611587640.53.0.195201731083.issue43024@roundup.psfhosted.org> Message-ID: <1623948160.27.0.700224658012.issue43024@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 Jun 17 12:57:06 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 17 Jun 2021 16:57:06 +0000 Subject: [issue44445] Add `site-include` install scheme path in sysconfig In-Reply-To: <1623942208.43.0.621445516609.issue44445@roundup.psfhosted.org> Message-ID: <1623949026.71.0.815956333663.issue44445@roundup.psfhosted.org> Steve Dower added the comment: distutils.sysconfig doesn't expose the headers path either, it's only there as a default value for the install command (Lib/distutils/command/install.py). So it doesn't seem unreasonable to provide a recommendation on where to put shared header files and let installers do their own calculation. If an installer wants to install into _another_ environment, it can't rely on sysconfig anyway, so we need the spec as well as any implementation. And if we don't have the spec then people will have to reverse-engineer the implementation anyway, so we may as well start with the spec. Now, whether we actually need or want packages dumping all their headers in one directory is a different question. At least on some platforms they'll also need to import libraries too, and tools like Cython have different files yet again. Many existing project keep these files inside their package and offer the path on request (e.g. pybind11), so perhaps we actually want to standardise pkg-config-like metadata instead? (Also crossposting back to the discuss thread) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 13:07:14 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 17 Jun 2021 17:07:14 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1623949634.13.0.871765467135.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks; this looks like an easy fix, then. No time right now, but I'll aim to get to it at some point before the end of the weekend, if no-one beats me to it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 14:49:12 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 17 Jun 2021 18:49:12 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension Message-ID: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> New submission from Thomas Grainger : demo: import traceback import io async def foo(): yield 1 traceback.print_stack(file=io.StringIO()) yield 2 async def bar(): return [chunk async for chunk in foo()] next(bar().__await__(), None) print("working!") Traceback (most recent call last): File "/home/graingert/projects/anyio/foo.py", line 13, in next(bar().__await__(), None) File "/home/graingert/projects/anyio/foo.py", line 10, in bar return [chunk async for chunk in foo()] File "/home/graingert/projects/anyio/foo.py", line -1, in File "/home/graingert/projects/anyio/foo.py", line 6, in foo traceback.print_stack(file=io.StringIO()) File "/usr/lib/python3.10/traceback.py", line 203, in print_stack print_list(extract_stack(f, limit=limit), file=file) File "/usr/lib/python3.10/traceback.py", line 224, in extract_stack stack = StackSummary.extract(walk_stack(f), limit=limit) File "/usr/lib/python3.10/traceback.py", line 379, in extract f.line File "/usr/lib/python3.10/traceback.py", line 301, in line self._line = linecache.getline(self.filename, self.lineno).strip() File "/usr/lib/python3.10/linecache.py", line 31, in getline if 1 <= lineno <= len(lines): TypeError: '<=' not supported between instances of 'int' and 'NoneType' ---------- messages: 396014 nosy: graingert priority: normal severity: normal status: open title: linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 14:51:27 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 18:51:27 +0000 Subject: [issue14995] PyLong_FromString documentation should state that the string must be null-terminated In-Reply-To: <1338769973.67.0.784454345332.issue14995@psf.upfronthosting.co.za> Message-ID: <1623955887.28.0.654918792939.issue14995@roundup.psfhosted.org> Change by Henk-Jaap Wagenaar : ---------- nosy: +Cryvate nosy_count: 4.0 -> 5.0 pull_requests: +25360 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 14:51:41 2021 From: report at bugs.python.org (Eric Snow) Date: Thu, 17 Jun 2021 18:51:41 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1623955901.08.0.593361729384.issue43693@roundup.psfhosted.org> Eric Snow added the comment: FWIW, I've wrapped up the key parts that I wanted to get done here (co_localplusnames/kinds, MAKE_CELL, eliminate unused fast local for arg cells). I'm leaving this open for now as there are a few things I didn't do that seem part of the original intention of this issue: * fully interleave the cells with the locals in their "natural" order (rather than only interleaving arg cells) * update the compiler to track names/kinds rather than computing them after the fact during the assembler step (this will allow us to remove a decent amount of code) * track the specific arg kinds in localspluskinds (this should allow us to make _PyEval_MakeFrameVector() simpler and a bit more efficient) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:04:38 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 17 Jun 2021 19:04:38 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623956678.66.0.62967609252.issue44446@roundup.psfhosted.org> Change by Ned Batchelder : ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:07:58 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 17 Jun 2021 19:07:58 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623956878.12.0.927108245583.issue44446@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +Mark.Shannon -nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:08:23 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 17 Jun 2021 19:08:23 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623956903.05.0.186711917531.issue44446@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +nedbat _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:13:38 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Thu, 17 Jun 2021 19:13:38 +0000 Subject: [issue38193] http.client should be "runnable" like http.server In-Reply-To: <1568671328.34.0.971414028957.issue38193@roundup.psfhosted.org> Message-ID: <1623957218.24.0.20830580794.issue38193@roundup.psfhosted.org> Change by Jonathan Schweder : ---------- keywords: +patch nosy: +jaswdr nosy_count: 1.0 -> 2.0 pull_requests: +25361 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:43:21 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 19:43:21 +0000 Subject: [issue31538] mailbox does not treat external factories the same In-Reply-To: <1505957872.5.0.844551789506.issue31538@psf.upfronthosting.co.za> Message-ID: <1623959001.13.0.499790887885.issue31538@roundup.psfhosted.org> Change by Henk-Jaap Wagenaar : ---------- keywords: +patch nosy: +Cryvate nosy_count: 4.0 -> 5.0 pull_requests: +25362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 15:43:45 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 19:43:45 +0000 Subject: [issue31538] mailbox does not treat external factories the same In-Reply-To: <1505957872.5.0.844551789506.issue31538@psf.upfronthosting.co.za> Message-ID: <1623959025.13.0.193629470491.issue31538@roundup.psfhosted.org> Change by Henk-Jaap Wagenaar : ---------- versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:14:30 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 17 Jun 2021 20:14:30 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623960870.51.0.740371982293.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: > if you are creating instances and calling this method > all the time, will lead to an infinite memory leak. Your words aren't making any sense to me. The default lru_cache will never hold more than maxsize entries. The default maxsize is 128. How is that "infinite"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:28:07 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 20:28:07 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623961687.75.0.686663829398.issue44310@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: I clearly was missing some words there Raymond. I meant, if one has set maxsize=None. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:33:05 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Thu, 17 Jun 2021 20:33:05 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623961985.31.0.231715796748.issue44310@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: (but consenting adults, setting max_size=None for "efficiency", you better be sure what you are doing in a long running process and making sure it cannot grow unbounded.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:37:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 17 Jun 2021 20:37:23 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623962243.85.0.971932629433.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: > I meant, if one has set maxsize=None. The docs already say, "If maxsize is set to None, the LRU feature is disabled and the cache can grow without bound." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:39:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 17 Jun 2021 20:39:52 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623962392.79.0.680242232207.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 7f01f77f8fabcfd7ddb5d99f12d6fc99af9af384 by Raymond Hettinger in branch 'main': bpo-44310: Add a FAQ entry for caching method calls (GH-26731) https://github.com/python/cpython/commit/7f01f77f8fabcfd7ddb5d99f12d6fc99af9af384 ---------- message_count: 18.0 -> 19.0 pull_requests: +25363 pull_request: https://github.com/python/cpython/pull/26777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:39:56 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 20:39:56 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623962396.26.0.268334002314.issue44310@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25364 pull_request: https://github.com/python/cpython/pull/26778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:39:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 17 Jun 2021 20:39:51 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623962391.58.0.636959217895.issue44310@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25363 pull_request: https://github.com/python/cpython/pull/26777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:45:38 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 17 Jun 2021 20:45:38 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623962738.68.0.127834408417.issue44446@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 16:46:10 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 17 Jun 2021 20:46:10 +0000 Subject: [issue25251] Unknown MS Compiler version 1900 In-Reply-To: <1443392264.43.0.443478210283.issue25251@psf.upfronthosting.co.za> Message-ID: <1623962770.53.0.651854215014.issue25251@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 14.0 -> 15.0 pull_requests: +25365 pull_request: https://github.com/python/cpython/pull/26780 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 17:14:49 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 17 Jun 2021 21:14:49 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1623964489.96.0.264565263443.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 77eaf14d278882857e658f83681e5b9a52cf14ac by Miss Islington (bot) in branch '3.10': bpo-44310: Add a FAQ entry for caching method calls (GH-26731) (GH-26777) https://github.com/python/cpython/commit/77eaf14d278882857e658f83681e5b9a52cf14ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 17:41:31 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 17 Jun 2021 21:41:31 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623966091.99.0.591670615323.issue44446@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch nosy: +FFY00 nosy_count: 4.0 -> 5.0 pull_requests: +25366 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26781 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 17:43:42 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 17 Jun 2021 21:43:42 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623966222.98.0.153349655944.issue44446@roundup.psfhosted.org> Filipe La?ns added the comment: I bissected this to 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b and submitted a patch making traceback.FrameSummary take into consideration that lineno might be None, I believe this is probably the correct fix. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 18:36:13 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 17 Jun 2021 22:36:13 +0000 Subject: [issue44447] Syntax Error not as detailed as shown Message-ID: <1623969373.41.0.105437108016.issue44447@roundup.psfhosted.org> New submission from Eesa Ibrahim Khokhar : I was testing the new features for python 3.10 beta 3, and noticed the errors were not as detailed as shown in the docs. I have an image below: In the docs, it was said that the entire generator statement would be pointed out by carets. However, it only pointed out 'for', and the error was not as detailed as shown in the docs. ---------- components: Regular Expressions files: Untitled.png messages: 396023 nosy: ezio.melotti, khokhareesa.home, mrabarnett priority: normal severity: normal status: open title: Syntax Error not as detailed as shown type: performance versions: Python 3.10 Added file: https://bugs.python.org/file50116/Untitled.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 19:39:18 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 17 Jun 2021 23:39:18 +0000 Subject: [issue44447] Syntax Error not as detailed as shown In-Reply-To: <1623969373.41.0.105437108016.issue44447@roundup.psfhosted.org> Message-ID: <1623973158.7.0.528954450456.issue44447@roundup.psfhosted.org> Andre Roberge added the comment: Your example is different than the one in the documentation (What's new). >>> (x, x for x in range(7)) # Your example File "", line 1 (x, x for x in range(7)) ^^^ SyntaxError: invalid syntax >>> foo(x, x for x in range(7)) # Example similar to the docs File "", line 1 foo(x, x for x in range(7)) ^^^^^^^^^^^^^^^^^^^ SyntaxError: Generator expression must be parenthesized >>> [x, x for x in range(7)] # Yet a different example File "", line 1 [x, x for x in range(7)] ^^^^ SyntaxError: did you forget parentheses around the comprehension target? ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 19:52:26 2021 From: report at bugs.python.org (Brett Cannon) Date: Thu, 17 Jun 2021 23:52:26 +0000 Subject: [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds In-Reply-To: <1507815780.34.0.213398074469.issue31772@psf.upfronthosting.co.za> Message-ID: <1623973946.1.0.0760520761379.issue31772@roundup.psfhosted.org> Brett Cannon added the comment: Did you mean to link to a fork, Irit? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 20:02:59 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 18 Jun 2021 00:02:59 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623974579.33.0.959642144819.issue44446@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +25367 pull_request: https://github.com/python/cpython/pull/26782 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 20:03:13 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 18 Jun 2021 00:03:13 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1623974593.14.0.863810923606.issue44446@roundup.psfhosted.org> Filipe La?ns added the comment: Upon further investigation, there are actually two issues here. The first would be the one I identified already, traceback.FrameSummary not being prepared for lineno being None, but there is also a regression in lineno being invalid in this situation in the first place. With only GH-26781, the traceback will look like the following: File "/home/anubis/git/cpython/rep.py", line 13, in next(bar().__await__(), None) File "/home/anubis/git/cpython/rep.py", line 10, in bar return [chunk async for chunk in foo()] File "/home/anubis/git/cpython/rep.py", line None, in File "/home/anubis/git/cpython/rep.py", line 6, in foo traceback.print_stack() working! which is different from 3.9 File "/home/anubis/git/cpython/rep.py", line 13, in next(bar().__await__(), None) File "/home/anubis/git/cpython/rep.py", line 10, in bar return [chunk async for chunk in foo()] File "/home/anubis/git/cpython/rep.py", line 10, in return [chunk async for chunk in foo()] File "/home/anubis/git/cpython/rep.py", line 6, in foo traceback.print_stack() working! I bisected the second issue to b37181e69209746adc2119c471599a1ea5faa6c8 which moves generators to bytecode, and when doing so changes the behavior to set lineno to -1. I have opened a GH-26782 to fixing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 21:08:57 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 18 Jun 2021 01:08:57 +0000 Subject: [issue44448] Suggestion: change existing error message for invalid function name Message-ID: <1623978537.81.0.198253423262.issue44448@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following two examples with the latest beta release: Python 3.10.0b3 ... >>> def 3job(x): File "", line 1 def 3job(x): ^ SyntaxError: invalid imaginary literal >>> def 3ob(x): File "", line 1 def 3ob(x): ^ SyntaxError: invalid decimal literal In most situations, these error messages are fantastic improvements compared with what was done previously. Here however, as they are intended to be used as function names, perhaps they could be improved. **If** it is easy to check if those "invalid number literals" are preceded by "def" during the analysis, perhaps a better error message might be SyntaxError: invalid function name If such an analysis would be difficult to do, I would suggest to simply close this issue as these examples are probably almost never going to be seen in real-life situations. (One might also consider to change the error message in the cases of "invalid octal" and "invalid hexadecimal" when they are used as function names.) ---------- components: Parser messages: 396027 nosy: aroberge, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Suggestion: change existing error message for invalid function name versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 22:21:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 18 Jun 2021 02:21:12 +0000 Subject: [issue44433] processes created by subprocess.Popen is not terminating In-Reply-To: <1623827803.93.0.311738638951.issue44433@roundup.psfhosted.org> Message-ID: <1623982872.25.0.814230471673.issue44433@roundup.psfhosted.org> Eric V. Smith added the comment: I'm going to close this. If you can reproduce it with a smaller program that we can test, please attach the information and re-open this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 23:32:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 18 Jun 2021 03:32:46 +0000 Subject: [issue44365] Bad dataclass post-init example In-Reply-To: <1623252788.44.0.375918246935.issue44365@roundup.psfhosted.org> Message-ID: <1623987166.56.0.933078837583.issue44365@roundup.psfhosted.org> Andrei Kulakov added the comment: It's a good example, but some readers might only have a vague idea (if any) of what FTP is, so a self contained example might be easier to digest? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 23:46:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 18 Jun 2021 03:46:53 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1623988013.9.0.145219530871.issue44318@roundup.psfhosted.org> Andrei Kulakov added the comment: The size of an instance of Semaphore is 48, of an empty tuple is 40, of a small int is 28, of an instance of a normal class with a single slot in __slots__ is also 40, are you use 48 byte size will really be an issue for you? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 17 23:57:38 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 18 Jun 2021 03:57:38 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1623988658.33.0.65934140046.issue44318@roundup.psfhosted.org> Josh Rosenberg added the comment: Andrei: The size of an instance of Semaphore is 48 bytes + 104 more bytes for the __dict__ containing its three attributes (ignoring the cost of the attributes themselves). A slotted class with three attributes only needs 56 bytes of overhead per-instance (it has no __dict__, so the 56 is the total cost). Dropping overhead of the instances by >60% can make a difference if you're really making many thousands of them. Personally, I think Python level classes should generally default to using __slots__ unless the classes are explicitly not for subclassing; not using __slots__ means all subclasses have their hands tied by the decision of the parent class. Perhaps explicitly opting in to __weakref__ (which __slots__ removes by default) to allow weak referencing, but it's fairly rare a class *needs* to otherwise allow the creation of arbitrary attributes. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 00:13:42 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 18 Jun 2021 04:13:42 +0000 Subject: [issue14995] PyLong_FromString documentation should state that the string must be null-terminated In-Reply-To: <1338769973.67.0.784454345332.issue14995@psf.upfronthosting.co.za> Message-ID: <1623989622.01.0.348141554068.issue14995@roundup.psfhosted.org> Josh Rosenberg added the comment: The description is nonsensical as is; not sure the patch goes far enough. C-style strings are *defined* to end at the NUL terminator; if it really needs a NUL after the int, saying it "points to the first character which follows the representation of the number" is highly misleading; the NUL isn't logically a character in the C-string way of looking at things. The patch is also wrong; the digits need not end in a NUL byte (trailing whitespace is allowed). AFAICT, the function really uses pend for two purposes: 1. If it succeeds in parsing, then pend reports the end of the string, nothing else 2. If it fails, because the string is not a legal input (contains non-numeric, or non-leading/terminal whitespace or whatever), pend tells you where the first violation character that couldn't be massaged to meet the rules for int() occurred. #1 is a mostly useless bit of info (strlen would be equally informative, and if the value parsed, you rarely care how long it was anyway), so pend is, practically speaking, solely for error-checking/reporting. The rewrite should basically say what is allowed (making it clear anything beyond the single parsable integer value with optional leading/trailing whitespace is illegal), and making it clear that pend always points to the end of the string on success (not just after the representation of the number, it's after the trailing whitespace too), and on failure indicates where parsing failed. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 00:55:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 18 Jun 2021 04:55:40 +0000 Subject: [issue44318] Asyncio classes missing __slots__ In-Reply-To: <1622905132.97.0.599095697066.issue44318@roundup.psfhosted.org> Message-ID: <1623992140.48.0.351765246529.issue44318@roundup.psfhosted.org> Andrei Kulakov added the comment: My mistake, I forgot the size of the dict itself is not included in getsizeof(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 04:19:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 08:19:55 +0000 Subject: [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds In-Reply-To: <1507815780.34.0.213398074469.issue31772@psf.upfronthosting.co.za> Message-ID: <1624004395.98.0.928000183814.issue31772@roundup.psfhosted.org> Irit Katriel added the comment: No, sorry it wasn't merged. Should it be? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 04:41:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 08:41:12 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1624005672.09.0.969395777893.issue32696@roundup.psfhosted.org> Irit Katriel added the comment: This is still the same in 3.11: >>> import pickle >>> class CustomException(Exception): ... def __init__(self, arg1, arg2): ... msg = "Custom message {} {}".format(arg1, arg2) ... super().__init__(msg) ... >>> obj_dump = pickle.dumps(CustomException("arg1", "arg2")) >>> obj = pickle.loads(obj_dump) Traceback (most recent call last): File "", line 1, in TypeError: CustomException.__init__() missing 1 required positional argument: 'arg2' >>> ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 05:32:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 09:32:03 +0000 Subject: [issue32465] [urllib] proxy_bypass_registry - extra error handling required for ProxyOverride, Windows under proxy environment In-Reply-To: <1514728884.14.0.467229070634.issue32465@psf.upfronthosting.co.za> Message-ID: <1624008723.08.0.52233028286.issue32465@roundup.psfhosted.org> Irit Katriel added the comment: There are currently no unit tests for proxy_bypass_registry, proxy_bypass, and nothing much for proxy_open. Those should be added as part of this work. ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 05:51:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 09:51:08 +0000 Subject: [issue20803] doc: clarify that struct.pack_into writes 0x00 for pad bytes In-Reply-To: <1393579049.39.0.501282349647.issue20803@psf.upfronthosting.co.za> Message-ID: <1624009868.4.0.71933574388.issue20803@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation -Interpreter Core keywords: +easy nosy: +docs at python title: struct.pack_into writes 0x00 for pad bytes -> doc: clarify that struct.pack_into writes 0x00 for pad bytes versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:00:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 18 Jun 2021 10:00:49 +0000 Subject: [issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack In-Reply-To: <1620140071.36.0.488434643792.issue44032@roundup.psfhosted.org> Message-ID: <1624010449.48.0.126438120557.issue44032@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 0982ded179f280176868c1c4eccf77bf70687816 by Mark Shannon in branch 'main': bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771) https://github.com/python/cpython/commit/0982ded179f280176868c1c4eccf77bf70687816 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:07:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 10:07:22 +0000 Subject: [issue15066] make install error: ImportError: No module named _struct In-Reply-To: <1339684582.74.0.731857257466.issue15066@psf.upfronthosting.co.za> Message-ID: <1624010842.32.0.235180421732.issue15066@roundup.psfhosted.org> Irit Katriel added the comment: Lib/site.py has changed a lot in the meantime compared to the patch that Antonio mentioned. Unless you are currently seeing this issue with 3.9+ I suggest we close this and let a new issue be opened if someone does see this problem on a current version. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:14:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 10:14:36 +0000 Subject: [issue17246] inspect.getargvalues fails if arg name is not bound to a value In-Reply-To: <1361312556.73.0.83895942435.issue17246@psf.upfronthosting.co.za> Message-ID: <1624011276.34.0.149587218758.issue17246@roundup.psfhosted.org> Irit Katriel added the comment: Still the same in 3.11: >>> import inspect >>> def fun(x): ... del x ... return inspect.currentframe() ... >>> inspect.formatargvalues(*inspect.getargvalues(fun(10))) Traceback (most recent call last): File "", line 1, in File "C:\Users\User\src\cpython-dev\lib\inspect.py", line 1444, in formatargvalues specs.append(convert(args[i])) File "C:\Users\User\src\cpython-dev\lib\inspect.py", line 1441, in convert return formatarg(name) + formatvalue(locals[name]) KeyError: 'x' >>> ---------- nosy: +iritkatriel title: cgitb fails when frame arguments are deleted (due to inspect bug I think) -> inspect.getargvalues fails if arg name is not bound to a value versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:15:29 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Fri, 18 Jun 2021 10:15:29 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1624011329.6.0.956534251962.issue32696@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: It seems like the example in the OP now works (persist both arguments), but Irit's/Kirill's (create a msg) fails (I am running 3.9). ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:22:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 10:22:46 +0000 Subject: [issue19214] shutil.make_archive should recognize extensions in filenames In-Reply-To: <1381395037.28.0.850005234621.issue19214@psf.upfronthosting.co.za> Message-ID: <1624011766.72.0.757645118684.issue19214@roundup.psfhosted.org> Irit Katriel added the comment: I agree with William that it is better to do this in a helper function than to further complicate make_archive. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:27:10 2021 From: report at bugs.python.org (Duncan Grisby) Date: Fri, 18 Jun 2021 10:27:10 +0000 Subject: [issue44449] Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks Message-ID: <1624012030.73.0.910498447609.issue44449@roundup.psfhosted.org> New submission from Duncan Grisby : I am using Python 3.9.4 on CentOS 7. faulthandler is registered with SIGUSR1: faulthandler.register(signal.SIGUSR1) Sending SIGUSR1 normally correctly dumps the thread stacks, but occasionally it segfaults from the main thread instead: Thread 1 (Thread 0x7efe15e69740 (LWP 15201)): #0 _PyTrash_begin (tstate=tstate at entry=0x0, op=op at entry=0x757ece0) at Objects/object.c:2125 #1 0x00007efe156f05e5 in frame_dealloc (f=0x757ece0) at Objects/frameobject.c:578 #2 0x00007efe15898f88 in _Py_DECREF (op=0x757ece0) at Include/object.h:430 #3 dump_traceback (write_header=0, tstate=0x757e1a0, fd=2) at Python/traceback.c:821 #4 _Py_DumpTracebackThreads (fd=fd at entry=2, interp=, interp at entry=0x0, current_tstate=0xbe6a70) at Python/traceback.c:921 #5 0x00007efe1590be7d in faulthandler_dump_traceback (interp=, all_threads=1, fd=2) at Modules/faulthandler.c:243 #6 faulthandler_user (signum=10) at Modules/faulthandler.c:839 #7 #8 0x00007efe15243d2f in do_futex_wait () from /lib64/libpthread.so.0 #9 0x00007efe15243e07 in __new_sem_wait_slow () from /lib64/libpthread.so.0 #10 0x00007efe15243ea5 in sem_timedwait () from /lib64/libpthread.so.0 #11 0x00007efe15896d11 in PyThread_acquire_lock_timed (lock=lock at entry=0x7ea7080, microseconds=microseconds at entry=5000000, intr_flag=intr_flag at entry=1) at Python/thread_pthread.h :457 #12 0x00007efe158f35a4 in acquire_timed (timeout=5000000000, lock=0x7ea7080) at Modules/_threadmodule.c:63 #13 lock_PyThread_acquire_lock (self=0x7efdf4518750, args=, kwds=) at Modules/_threadmodule.c:146 #14 0x00007efe15749916 in method_vectorcall_VARARGS_KEYWORDS (func=0x7efe15e1b310, args=0x186d208, nargsf=, kwnames=) at Objects/descrobject.c:346 ... It has failed because tstate is null. tstate came from Py_TRASHCAN_BEGIN_CONDITION that calls PyThreadState_GET(), assuming it returns a valid pointer, but the comment on the _PyThreadState_GET macro says: Efficient macro reading directly the 'gilstate.tstate_current' atomic variable. The macro is unsafe: it does not check for error and it can return NULL. The only place I can see that tstate_current would be set to NULL is in _PyThreadState_DeleteCurrent(). I suspect that there has been a race with a thread exit. I'm not sure quite what to do about this. Perhaps faulthandler should check if tstate_current is NULL and set it suitably if so? ---------- components: Library (Lib) messages: 396042 nosy: dgrisby priority: normal severity: normal status: open title: Segfault in _PyTrash_begin when faulthandler tries to dump thread stacks type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:46:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 10:46:41 +0000 Subject: [issue9419] RUNSHARED needs LDFLAGS In-Reply-To: <1280423222.23.0.51081739049.issue9419@psf.upfronthosting.co.za> Message-ID: <1624013201.73.0.575660868017.issue9419@roundup.psfhosted.org> Irit Katriel added the comment: Closing as 2.7 is past EOL and distutils is deprecated. Please create a new issue, and include complete reproduction instructions, if you are seeing this problem on an up to date version (3.9+). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 06:57:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 10:57:13 +0000 Subject: [issue19832] XML version is ignored In-Reply-To: <1385731989.56.0.494206354245.issue19832@psf.upfronthosting.co.za> Message-ID: <1624013833.75.0.222075092147.issue19832@roundup.psfhosted.org> Irit Katriel added the comment: Reproduced in 3.11: >>> xml.sax.parseString("blah", xml.sax.ContentHandler()) >>> ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:02:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 11:02:51 +0000 Subject: [issue44448] Suggestion: change existing error message for invalid function name In-Reply-To: <1623978537.81.0.198253423262.issue44448@roundup.psfhosted.org> Message-ID: <1624014171.71.0.761205991507.issue44448@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately these are tokenizer errors and the tokenizer had no idea of what's a function, so introducing syntactic structure in the error is going to be quite error prone, as the tokenizer still sees whitespace and other stuff that the parser doesn't. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:03:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 11:03:00 +0000 Subject: [issue44448] Suggestion: change existing error message for invalid function name In-Reply-To: <1623978537.81.0.198253423262.issue44448@roundup.psfhosted.org> Message-ID: <1624014180.87.0.974600373912.issue44448@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: But thanks a lot for the proposal! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:07:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 11:07:14 +0000 Subject: [issue7464] circular reference in HTTPResponse by urllib2 In-Reply-To: <1260379633.84.0.693013946466.issue7464@psf.upfronthosting.co.za> Message-ID: <1624014434.51.0.65839747914.issue7464@roundup.psfhosted.org> Irit Katriel added the comment: > It doesn't appear to be an issue in py3k. I agree, I can't find this code anywhere. Closing. ---------- nosy: +iritkatriel resolution: -> out of date stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:21:16 2021 From: report at bugs.python.org (Stefan Behnel) Date: Fri, 18 Jun 2021 11:21:16 +0000 Subject: [issue19832] XML version is ignored In-Reply-To: <1385731989.56.0.494206354245.issue19832@psf.upfronthosting.co.za> Message-ID: <1624015276.86.0.375188903153.issue19832@roundup.psfhosted.org> Stefan Behnel added the comment: After reading up a bit, version "X" should probably be rejected, whereas "1.[0-9]+" is meant to be allowed also by a 1.0 parser, according to the spec: https://www.w3.org/TR/REC-xml/#sec-prolog-dtd """ When an XML 1.0 processor encounters a document that specifies a 1.x version number other than '1.0', it will process it as a 1.0 document. This means that an XML 1.0 processor will accept 1.x documents provided they do not use any non-1.0 features. """ However, this is not so much an issue with the SAX framework but with the underlying parser, which would be expat. Not sure why that doesn't care about the version. Personally, I don't really care. There are only two XML versions, 1.0 and 1.1, and an XML 1.x parser is supposed to deal with both of them nicely. Anyone who writes something different in their XML version probably does so deliberately and wrongly. As long as the rest is XML, I don't see a reason to reject such an input document. I'll close this as "won't fix", since there is no practical effect, it would need effort, and it doesn't look like anyone cared in almost 8 years. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:22:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 11:22:03 +0000 Subject: [issue25946] configure should pick /usr/bin/g++ automatically if present In-Reply-To: <1451017608.26.0.200778632077.issue25946@psf.upfronthosting.co.za> Message-ID: <1624015323.76.0.481246111687.issue25946@roundup.psfhosted.org> Irit Katriel added the comment: Closing as 2.7 is past EOL and distutils is deprecated. Please create a new issue if you have a current problem with this. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:50:04 2021 From: report at bugs.python.org (Ned Batchelder) Date: Fri, 18 Jun 2021 11:50:04 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac Message-ID: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> New submission from Ned Batchelder : Here is a trace involving generator expressions. Using 3.10.0b3 on Mac, there are "line" events within the expression. Those events are missing on Windows. --- 8< ------------------------------- 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 def doit(): o = ((1,2), (3,4)) o = (a for a in o) for tup in o: x = tup[0] y = tup[1] print(sys.version) sys.settrace(trace) doit() --------------------------------------- When run on Mac, it produces this output: 3.10.0b3 (default, Jun 18 2021, 06:43:38) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def doit(): line 11: o = ((1,2), (3,4)) line 12: o = (a for a in o) line 13: for tup in o: call 12: o = (a for a in o) line 12: o = (a for a in o) retu 12: o = (a for a in o) line 14: x = tup[0] line 15: y = tup[1] line 13: for tup in o: call 12: o = (a for a in o) line 12: o = (a for a in o) retu 12: o = (a for a in o) line 14: x = tup[0] line 15: y = tup[1] line 13: for tup in o: call 12: o = (a for a in o) retu 12: o = (a for a in o) retu 13: for tup in o: When run on Windows, it produces this output: 3.10.0b3 (tags/v3.10.0b3:865714a, Jun 17 2021, 20:39:25) [MSC v.1929 64 bit (AMD64)] call 10: def doit(): line 11: o = ((1,2), (3,4)) line 12: o = (a for a in o) line 13: for tup in o: call 12: o = (a for a in o) retu 12: o = (a for a in o) line 14: x = tup[0] line 15: y = tup[1] line 13: for tup in o: call 12: o = (a for a in o) retu 12: o = (a for a in o) line 14: x = tup[0] line 15: y = tup[1] line 13: for tup in o: call 12: o = (a for a in o) retu 12: o = (a for a in o) retu 13: for tup in o: On Windows, the "line 12" events are missing. ---------- components: Interpreter Core keywords: 3.10regression messages: 396050 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Generator expressions trace differently on Windows than on Mac versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 07:53:03 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 18 Jun 2021 11:53:03 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624017183.65.0.0863016871473.issue44426@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: docs at python -> mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:08:37 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 12:08:37 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 Message-ID: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> New submission from Miro Hron?ok : Hello. When we attempted to upgrade to Python 3.10.0b3 on Fedora 33 and 34, we see the following test failure: ====================================================================== ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) Prior versions of Distribution.entry_points would return a ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration ---------------------------------------------------------------------- Ran 1402 tests in 2.125s FAILED (errors=1, skipped=18, expected failures=1) I've reproduced it without any Fedora's patches: $ cd cpython $ git switch -d v3.10.0b3 # or the tip of 3.10 today, 77eaf14d27 $ ./configure --enable-shared && make $ LD_LIBRARY_PATH=. ./python -m test test_importlib 0:00:00 load avg: 13.59 Run tests sequentially 0:00:00 load avg: 13.59 [1/1] test_importlib test test_importlib failed -- Traceback (most recent call last): File "/home/churchyard/Dokumenty/RedHat/cpython/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration test_importlib failed == Tests result: FAILURE == 1 test failed: test_importlib Total duration: 11.0 sec Tests result: FAILURE ---------- components: Library (Lib) messages: 396051 nosy: hroncok, jaraco priority: normal severity: normal status: open title: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:10:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 12:10:33 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1624018233.91.0.291910180622.issue40928@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 4.0 -> 5.0 pull_requests: +25368 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26783 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:12:45 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 12:12:45 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624018365.15.0.349415947168.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: Also reproduced on the main branch. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:15:49 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 12:15:49 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1624018549.75.0.0741013369769.issue40928@roundup.psfhosted.org> Jack DeVries added the comment: >From my pr, "This is a bandaid to help people save time debugging this non-bug. I don't think this solution is very strong; I'm just hoping to move the discussion forward on the bpo, and hoping for a hint on how to suppress these warnings all together or come up with some other optimal solution. I applied the function in test_decimal because that test consistently generates these malloc warnings on my system." I'm still trying to find a true solution. Can anyone help to point me in a better direction? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:18:08 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 18 Jun 2021 12:18:08 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624018688.93.0.346851103218.issue44451@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems to have been reported also at https://bugs.python.org/issue44246#msg395202 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:21:51 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 12:21:51 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624018911.78.0.0765379058003.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: Also reproducible without --enable-shared. [cpython (main)]$ ./configure && make [cpython (main)]$ ./python --version Python 3.11.0a0 [cpython (main)]$ ./python -m test test_importlib 0:00:00 load avg: 5.40 Run tests sequentially 0:00:00 load avg: 5.40 [1/1] test_importlib test test_importlib failed -- Traceback (most recent call last): File "/home/churchyard/Dokumenty/RedHat/cpython/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration test_importlib failed == Tests result: FAILURE == 1 test failed: test_importlib Total duration: 3.5 sec Tests result: FAILURE ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:23:08 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 12:23:08 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1624018988.52.0.311991234988.issue44246@roundup.psfhosted.org> Miro Hron?ok added the comment: The test_entry_points_by_index test also fails on Fedora. See issue44451. ---------- nosy: +hroncok _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:36:13 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 12:36:13 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624019773.34.0.241918931961.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: I get the DeprecationWarning the tests assumes when not running via the test: $ cat distinfo_pkg-1.0.0.dist-info/entry_points.txt [entries] main = mod:main ns:sub = mod:main $ ./python Python 3.11.0a0 (heads/main:0982ded179, Jun 18 2021, 14:14:16) [GCC 10.3.1 20210422 (Red Hat 10.3.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import os, sys >>> sys.path.insert(0, os.path.abspath('.')) >>> from importlib.metadata import distribution >>> distribution('distinfo-pkg') >>> eps = distribution('distinfo-pkg').entry_points >>> eps[0] :1: DeprecationWarning: Accessing entry points by index is deprecated. Cast to tuple if needed. EntryPoint(name='main', value='mod:main', group='entries') Not sure why I don't get it in the test yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 08:58:26 2021 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Fri, 18 Jun 2021 12:58:26 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash Message-ID: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> New submission from Zbyszek J?drzejewski-Szmek : pathlib.Path.__truediv__(), i.e. pathlib.Path.joinpath() is surprising when the second argument starts with a slash. >>> pathlib.Path('/foo') / '/bar' >>> PosixPath('/bar') I know that this follows the precedent set by os.path.join(), and probably makes sense in some scenarios. But for the general operation of "concatenating paths", it doesn't fit very well. In particular, when concatenating multiple components this becomes even stranger: >>> pathlib.Path('/var/tmp/instroot') / '/some/path' / '/suffix' >>> PosixPath('/suffix') In my particular use case, I'm concatenating some user specified paths relative to some root. The paths may or may not be absolute. To avoid this pitfall, something like this is necessary: >>> pathlib.Path('/var/tmp/instroot') / p.lstrip('/') / q.lstrip('/') Please provide a way to do this natively. I think it'd be nice to use // or + for this: >>> pathlib.Path('/var/tmp/instroot') // '/some/path' // '/suffix' >>> PosixPath('/var/tmp/instroot/some/path/suffix') ---------- components: Library (Lib) messages: 396058 nosy: zbysz priority: normal severity: normal status: open title: Allow paths to be joined without worrying about a leading slash type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:10:24 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 13:10:24 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624021824.3.0.972772164336.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: I've added warnings.resetwarnings() to the test. it makes it pass. It says: Warning -- warnings.filters was modified by test_importlib Before: (140568295281984, [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)], [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)]) After: (140568295281984, [('default', None, , '__main__', 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0), ('ignore', None, , None, 0)], []) test_importlib failed (env changed) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:14:55 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 13:14:55 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624022095.53.0.22865789467.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: Adding the reset to the context manager: with warnings.catch_warnings(record=True) as caught: warnings.resetwarnings() eps[0] Or even better explicitly: with warnings.catch_warnings(record=True) as caught: warnings.filterwarnings("default", category=DeprecationWarning) eps[0] Makes it pass and makes the tests framework happy. I still don't understand why it is filtered, but other tests in the file (e.g. test_entry_points_dict_construction) already o this, so I will submit a pull request. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:16:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 13:16:19 +0000 Subject: [issue19402] AbstractBasicAuthHandler In-Reply-To: <1382752204.16.0.0164222061045.issue19402@psf.upfronthosting.co.za> Message-ID: <1624022179.6.0.113019936413.issue19402@roundup.psfhosted.org> Irit Katriel added the comment: I think Perry means HTTPBasicAuthHandler.http_error_401, which seems to still be missing a reset_retry_count() call. https://github.com/python/cpython/blob/0982ded179f280176868c1c4eccf77bf70687816/Lib/urllib/request.py#L1050 ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:17:48 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 13:17:48 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624022268.16.0.663911894843.issue44451@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- components: +Tests -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:20:21 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 13:20:21 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624022421.1.0.593983700471.issue44451@roundup.psfhosted.org> Change by Miro Hron?ok : ---------- keywords: +patch pull_requests: +25369 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26784 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:20:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 18 Jun 2021 13:20:44 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624022444.77.0.652939533717.issue44451@roundup.psfhosted.org> Jason R. Coombs added the comment: Other tests reset the filters? Good observation. I?d missed that detail. If it?s easier to submit a PR to importlib_metadata, feel free to do that as I?ll want the change in both places. ---------- components: +Library (Lib) -Tests stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:28:50 2021 From: report at bugs.python.org (=?utf-8?q?Miro_Hron=C4=8Dok?=) Date: Fri, 18 Jun 2021 13:28:50 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624022930.09.0.637589823562.issue44451@roundup.psfhosted.org> Miro Hron?ok added the comment: Submitted to both. https://github.com/python/cpython/pull/26784 https://github.com/python/importlib_metadata/pull/325 ---------- components: +Tests -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:38:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 13:38:09 +0000 Subject: [issue26231] HTTPResponse.close() should consume all remaining data in body if any In-Reply-To: <1453977797.39.0.133146806463.issue26231@psf.upfronthosting.co.za> Message-ID: <1624023489.67.0.760316681283.issue26231@roundup.psfhosted.org> Irit Katriel added the comment: > If close() does not consume the remaining data, the user would have to do it after invoking close(), regardless of how large the data is. Martin's point was that you can abandon the connection and create a new one if you choose not to consume all the data. > But how do do it, the HTTPResponse has been closed. Right, if you want to consume the data you should do it before calling close(). ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:39:19 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Jun 2021 13:39:19 +0000 Subject: [issue44453] Documented return type of sysconfig.get_path() is wrong Message-ID: <1624023559.66.0.0464260239119.issue44453@roundup.psfhosted.org> New submission from Jelle Zijlstra : https://docs.python.org/3/library/sysconfig.html#sysconfig.get_path says it returns None if the name is not found, but the implementation (https://github.com/python/cpython/blame/main/Lib/sysconfig.py) uses [] and will raise KeyError instead. Noticed by @srittau in https://github.com/python/typeshed/pull/5659. I will submit a PR. ---------- assignee: Jelle Zijlstra components: Documentation messages: 396065 nosy: Jelle Zijlstra priority: normal severity: normal status: open title: Documented return type of sysconfig.get_path() is wrong versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:46:45 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Jun 2021 13:46:45 +0000 Subject: [issue44453] Documented return type of sysconfig.get_path() is wrong In-Reply-To: <1624023559.66.0.0464260239119.issue44453@roundup.psfhosted.org> Message-ID: <1624024005.1.0.629488767573.issue44453@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- keywords: +patch pull_requests: +25370 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26785 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:57:46 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 13:57:46 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1624024666.46.0.0502079411802.issue40928@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25371 pull_request: https://github.com/python/cpython/pull/26786 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:59:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 13:59:04 +0000 Subject: [issue26236] urllib2 initiate irregular call to gethostbyaddr In-Reply-To: <1454038486.05.0.415307366057.issue26236@psf.upfronthosting.co.za> Message-ID: <1624024744.89.0.218571266995.issue26236@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 09:59:18 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 13:59:18 +0000 Subject: [issue40928] OS X: malloc(): set default diagnostics to DEBUG_WRITE_ON_CRASH In-Reply-To: <1591712621.72.0.447782390229.issue40928@roundup.psfhosted.org> Message-ID: <1624024758.54.0.438208731936.issue40928@roundup.psfhosted.org> Jack DeVries added the comment: Alternatively, my latest PR implements what @ronaldoussoren suggested: capping OS X memory allocations at 4TB. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 10:07:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 14:07:13 +0000 Subject: [issue27824] update ConfigParser docs regarding in-line comments In-Reply-To: <1471799232.17.0.640576355958.issue27824@psf.upfronthosting.co.za> Message-ID: <1624025233.64.0.405447006554.issue27824@roundup.psfhosted.org> Irit Katriel added the comment: This is explained in the example now, just above https://docs.python.org/3.10/library/configparser.html#interpolation-of-values It was changed here: https://github.com/python/cpython/commit/b25a791802a1915097e02bfba04e27a41ae55ebf ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 10:35:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 14:35:22 +0000 Subject: [issue26608] RLock undocumented behavior in case of multiple acquire In-Reply-To: <1458629798.26.0.210968234517.issue26608@psf.upfronthosting.co.za> Message-ID: <1624026922.25.0.0247104731079.issue26608@roundup.psfhosted.org> Irit Katriel added the comment: The RLock documentation is a bit more verbose than it needs to be (for instance, there is no reason to specify the "no args" case separately from the "blocking=True" case (since True is the default value of blocking). The issue of balancing acquire/release calls is mentioned as Josh says, but could perhaps be stated more simply as well. ---------- keywords: +easy nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 11:03:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 15:03:31 +0000 Subject: [issue32536] ast and tokenize disagree about line number In-Reply-To: <1515759409.32.0.467229070634.issue32536@psf.upfronthosting.co.za> Message-ID: <1624028611.64.0.856155097938.issue32536@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 11:14:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 15:14:33 +0000 Subject: [issue32581] A bug of the write funtion of ConfigParser.py In-Reply-To: <1516198308.88.0.467229070634.issue32581@psf.upfronthosting.co.za> Message-ID: <1624029273.05.0.373884761702.issue32581@roundup.psfhosted.org> Irit Katriel added the comment: I trued this on 3.11/Windows and 3.10/Linux and could not reproduce the issue. The Password remained "" in both cases. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 11:26:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 15:26:18 +0000 Subject: [issue28412] os.path.splitdrive documentation out of date In-Reply-To: <1476140266.77.0.441294579348.issue28412@psf.upfronthosting.co.za> Message-ID: <1624029978.21.0.646328167759.issue28412@roundup.psfhosted.org> Irit Katriel added the comment: This was updated in the Python 3 docs: https://docs.python.org/3/library/os.path.html#os.path.splitdrive The 2.7 docs are no longer maintained. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 11:33:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 15:33:53 +0000 Subject: [issue34773] sqlite3 module inconsistently returning only some rows from a table In-Reply-To: <1537679600.14.0.956365154283.issue34773@psf.upfronthosting.co.za> Message-ID: <1624030433.08.0.360134002662.issue34773@roundup.psfhosted.org> Irit Katriel added the comment: The python bug tracker is not the right place to ask for help debugging your application, it's for reporting bugs in python. If you have evidence of an issue in python, please create a new issue with full reproduction instructions so that we can look into it. ---------- nosy: +iritkatriel resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 11:47:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 15:47:46 +0000 Subject: [issue31398] TypeError: gdbm key must be string, not unicode In-Reply-To: <1504904097.33.0.298088172041.issue31398@psf.upfronthosting.co.za> Message-ID: <1624031266.08.0.862686598128.issue31398@roundup.psfhosted.org> Irit Katriel added the comment: This seems like a python 2-only issue, if nobody objects I will close it in a couple of weeks. ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 12:00:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 16:00:25 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1624032025.64.0.709305486297.issue27752@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python title: CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ',' as a separator. -> [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ',' as a separator. versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 12:02:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 16:02:54 +0000 Subject: [issue28877] Cannot compile _ssl.o on HP-UX In-Reply-To: <1480931920.31.0.868439629841.issue28877@psf.upfronthosting.co.za> Message-ID: <1624032174.24.0.102850310907.issue28877@roundup.psfhosted.org> Irit Katriel added the comment: Python 2.7 is past EOL. Please create a new issue if you are still having this problem on 3.9+. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 12:05:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Fri, 18 Jun 2021 16:05:51 +0000 Subject: [issue31398] TypeError: gdbm key must be string, not unicode In-Reply-To: <1504904097.33.0.298088172041.issue31398@psf.upfronthosting.co.za> Message-ID: <1624032351.82.0.480492546449.issue31398@roundup.psfhosted.org> STINNER Victor added the comment: IMO you can close it immediately. Fixing Python 2.7 is not going to happen ever. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 12:13:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 16:13:05 +0000 Subject: [issue30563] [Cygwin] multiprocessing module with pool object issue In-Reply-To: <1496559266.31.0.239393976491.issue30563@psf.upfronthosting.co.za> Message-ID: <1624032785.02.0.732604929916.issue30563@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 12:23:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 16:23:29 +0000 Subject: [issue31398] TypeError: gdbm key must be string, not unicode In-Reply-To: <1504904097.33.0.298088172041.issue31398@psf.upfronthosting.co.za> Message-ID: <1624033409.82.0.353743528495.issue31398@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 13:00:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 17:00:00 +0000 Subject: [issue33367] Multiprocessing Pool workers initiated with maxtasksperchild do not execute when sharing logging In-Reply-To: <1524756351.27.0.682650639539.issue33367@psf.upfronthosting.co.za> Message-ID: <1624035600.57.0.504025874787.issue33367@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this is a Python 2.7-only issue and 2.7 is no longer maintained. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 13:01:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 17:01:16 +0000 Subject: [issue34371] File reading gets stuck if you read at eof on macos In-Reply-To: <1533901394.11.0.56676864532.issue34371@psf.upfronthosting.co.za> Message-ID: <1624035676.39.0.19113912216.issue34371@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 13:37:11 2021 From: report at bugs.python.org (Paul Du Bois) Date: Fri, 18 Jun 2021 17:37:11 +0000 Subject: [issue31743] Proportional Width Font on Generated Python Docs PDFs In-Reply-To: <1507633217.5.0.213398074469.issue31743@psf.upfronthosting.co.za> Message-ID: <1624037831.67.0.715405960083.issue31743@roundup.psfhosted.org> Paul Du Bois added the comment: For what it's worth, I also see proportional-width fonts when looking at the docs in Android Chrome. For example, the binary tree in https://docs.python.org/3/library/heapq.html is mangled. ---------- nosy: +paul.dubois _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 13:38:08 2021 From: report at bugs.python.org (Paul Du Bois) Date: Fri, 18 Jun 2021 17:38:08 +0000 Subject: [issue31743] Proportional Width Font on Generated Python Docs PDFs and in mobile browser In-Reply-To: <1507633217.5.0.213398074469.issue31743@psf.upfronthosting.co.za> Message-ID: <1624037888.87.0.212311305247.issue31743@roundup.psfhosted.org> Change by Paul Du Bois : ---------- title: Proportional Width Font on Generated Python Docs PDFs -> Proportional Width Font on Generated Python Docs PDFs and in mobile browser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 14:56:38 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 18 Jun 2021 18:56:38 +0000 Subject: [issue44447] Syntax Error not as detailed as shown In-Reply-To: <1623969373.41.0.105437108016.issue44447@roundup.psfhosted.org> Message-ID: <1624042598.06.0.973012759295.issue44447@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- components: +Parser -Regular Expressions nosy: +lys.nikolaou, pablogsal type: performance -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 14:58:18 2021 From: report at bugs.python.org (fix offline printers) Date: Fri, 18 Jun 2021 18:58:18 +0000 Subject: [issue44454] How to find canon printer default wifi password Message-ID: <1624042698.69.0.686585289751.issue44454@roundup.psfhosted.org> New submission from fix offline printers : You cannot use the Canon Printer for printing purpose until and unless you do not have Canon Printer Password. However, Canon Printer password troubleshooting can be done in short span of time by following technical steps. Therefore, Canon Printer Default Password setup steps mentioned below and if you cannot fix it yourself then feel free to ask for help through our chat window and get help from experts. https://fixofflineprinters.com/how-to-find-canon-printer-default-wifi-password/ ---------- messages: 396077 nosy: fixofflineprinters priority: normal severity: normal status: open title: How to find canon printer default wifi password _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 14:59:38 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 18 Jun 2021 18:59:38 +0000 Subject: [issue44454] Spam In-Reply-To: <1624042698.69.0.686585289751.issue44454@roundup.psfhosted.org> Message-ID: <1624042778.76.0.780044226256.issue44454@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -fixofflineprinters resolution: -> not a bug stage: -> resolved status: open -> closed title: How to find canon printer default wifi password -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 14:59:48 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 18 Jun 2021 18:59:48 +0000 Subject: [issue44454] Spam Message-ID: <1624042788.4.0.093642729571.issue44454@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg396077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:03:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 19:03:19 +0000 Subject: [issue35714] Document that the null character '\0' terminates a struct format spec In-Reply-To: <1547160130.27.0.885629506261.issue35714@roundup.psfhosted.org> Message-ID: <1624042999.63.0.193626377806.issue35714@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can it be closed? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:05:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 19:05:46 +0000 Subject: [issue40412] [subinterpreters] inittab_copy not set to NULL after free, can lead to crashes when running multiple interpreters in a single process In-Reply-To: <1588035109.97.0.994346077967.issue40412@roundup.psfhosted.org> Message-ID: <1624043146.55.0.787884655303.issue40412@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:09:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 19:09:01 +0000 Subject: [issue44447] Syntax Error not as detailed as shown In-Reply-To: <1623969373.41.0.105437108016.issue44447@roundup.psfhosted.org> Message-ID: <1624043341.94.0.33099368304.issue44447@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Indeed, as Andre mentions your example is different because in you case the call is interpreted as a generator comprehension, not as a function call. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:11:26 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 18 Jun 2021 19:11:26 +0000 Subject: [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds In-Reply-To: <1507815780.34.0.213398074469.issue31772@psf.upfronthosting.co.za> Message-ID: <1624043486.62.0.299556847729.issue31772@roundup.psfhosted.org> Brett Cannon added the comment: No idea, I was just trying to understand what the link was meant to point at. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:19:56 2021 From: report at bugs.python.org (HEY GOOGLE) Date: Fri, 18 Jun 2021 19:19:56 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1624043996.72.0.764272642911.issue44246@roundup.psfhosted.org> HEY GOOGLE added the comment: Addes aggreement ---------- components: +Build nosy: +hectorizdaone type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:21:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 19:21:56 +0000 Subject: [issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1624044116.07.0.705498738429.issue39947@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +iritkatriel nosy_count: 4.0 -> 5.0 pull_requests: +25372 pull_request: https://github.com/python/cpython/pull/26788 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 15:27:32 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 18 Jun 2021 19:27:32 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1624044452.66.0.368556053838.issue44310@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- pull_requests: +25373 pull_request: https://github.com/python/cpython/pull/26789 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:02:53 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 18 Jun 2021 20:02:53 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624046573.46.0.164905294412.issue44451@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6 by Miro Hron?ok in branch 'main': bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index (GH-26784) https://github.com/python/cpython/commit/df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:02:56 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Jun 2021 20:02:56 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624046576.13.0.316990077209.issue44451@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25374 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26790 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:15:54 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 20:15:54 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1624047354.15.0.136911962171.issue43945@roundup.psfhosted.org> Ethan Furman added the comment: New changeset f60b07ab6c943fce084772c3c7731ab3bbd213ff by Ethan Furman in branch 'main': bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752) https://github.com/python/cpython/commit/f60b07ab6c943fce084772c3c7731ab3bbd213ff ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:21:53 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 20:21:53 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1624047713.49.0.710898801863.issue43945@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25375 pull_request: https://github.com/python/cpython/pull/26791 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:25:20 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 18 Jun 2021 20:25:20 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624047920.88.0.860931903857.issue44451@roundup.psfhosted.org> Jason R. Coombs added the comment: Big thanks Miro for the detailed work on this matter. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:31:09 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 18 Jun 2021 20:31:09 +0000 Subject: [issue44451] test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) fails on Fedora 33 and 34 In-Reply-To: <1624018117.88.0.819441595689.issue44451@roundup.psfhosted.org> Message-ID: <1624048269.78.0.397176899389.issue44451@roundup.psfhosted.org> miss-islington added the comment: New changeset bf55a799e0c19285b094d71f794c301c1afaa28d by Miss Islington (bot) in branch '3.10': bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index (GH-26784) https://github.com/python/cpython/commit/bf55a799e0c19285b094d71f794c301c1afaa28d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:55:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 20:55:26 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1624049726.23.0.239563367501.issue44368@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25376 pull_request: https://github.com/python/cpython/pull/26792 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:55:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 20:55:53 +0000 Subject: [issue31772] SourceLoader uses stale bytecode in case of equal mtime seconds In-Reply-To: <1507815780.34.0.213398074469.issue31772@psf.upfronthosting.co.za> Message-ID: <1624049753.78.0.190050744073.issue31772@roundup.psfhosted.org> Irit Katriel added the comment: The discussion is leading to yes, but the patch needs some more work on the test. (The link was pointing at me being past my bedtime when I pasted it :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 16:59:37 2021 From: report at bugs.python.org (Aaron Meurer) Date: Fri, 18 Jun 2021 20:59:37 +0000 Subject: [issue44455] compileall should exit nonzero for nonexistent directories Message-ID: <1624049977.61.0.207716246546.issue44455@roundup.psfhosted.org> New submission from Aaron Meurer : $ ./python.exe -m compileall doesntexist Listing 'doesntexist'... Can't list 'doesntexist' $ echo $? 0 It's standard for a command line tool that processes files to exit nonzero when given a directory that doesn't exist. ---------- messages: 396087 nosy: asmeurer priority: normal severity: normal status: open title: compileall should exit nonzero for nonexistent directories _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:05:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 21:05:40 +0000 Subject: [issue18182] xml.dom.createElement() does not take implicit namespaces into account In-Reply-To: <1370872753.13.0.359771001968.issue18182@psf.upfronthosting.co.za> Message-ID: <1624050340.93.0.444816845956.issue18182@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:07:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:07:47 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns Message-ID: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : This got me confused for a sec when doing some live demo: >>> match x: ... case A(y=1, foo): File "", line 2 case A(y=1, foo): ^ SyntaxError: invalid syntax I propose to improve this to: >>> match x: ... case A(y=1, foo): File "", line 2 case A(y=1, foo): ^^^ SyntaxError: cannot mix keyword patterns and positional patterns ---------- messages: 396088 nosy: brandtbucher, pablogsal priority: normal severity: normal status: open title: Improve syntax error for mixing keyword/positional in max patterns _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:09:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:09:02 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624050542.76.0.140439957921.issue44456@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25377 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26793 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:09:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 21:09:50 +0000 Subject: [issue20513] Python 2.7. Script interruption on logoff from 0 session under Win2003 and earlier In-Reply-To: <1391540608.89.0.389395011233.issue20513@psf.upfronthosting.co.za> Message-ID: <1624050590.86.0.462743007299.issue20513@roundup.psfhosted.org> Irit Katriel added the comment: The patch doesn't look anything like the current code. Is this issue still relevant? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:11:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:11:13 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624050673.17.0.676268932183.issue44456@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Btw, I noticed this is allowed: >>> match x: ... case A(foo, t=3): ... ... ... but this is not: >>> match x: ... case A(foo=3, t): Is that on pourpose? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:14:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:14:02 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624050842.73.0.719567553899.issue44456@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: If this is supposed to mirror function calls, maybe the error should be:: >>> match a: ... case A(foo=3, t): File "", line 2 case A(foo=3, t): ^ SyntaxError: positional patterns follow keyword patterns ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:16:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:16:02 +0000 Subject: [issue44368] Invalid mapping patterns give confusing SyntaxErrors In-Reply-To: <1623268055.49.0.141846106713.issue44368@roundup.psfhosted.org> Message-ID: <1624050962.2.0.45875375682.issue44368@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a8c418d5ed1103106db547aa576b82c6031985a4 by Pablo Galindo in branch '3.10': [3.10] bpo-44368: Improve syntax errors with invalid as pattern targets (GH-26632) (GH-26792) https://github.com/python/cpython/commit/a8c418d5ed1103106db547aa576b82c6031985a4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:16:24 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 21:16:24 +0000 Subject: [issue43329] Multiprocessing Manager Client Not Reconnecting In-Reply-To: <1614349902.25.0.128405443976.issue43329@roundup.psfhosted.org> Message-ID: <1624050984.25.0.217099189569.issue43329@roundup.psfhosted.org> Ethan Furman added the comment: Michael Boon wrote: ------------------- > The [above] issue is pretty serious and it is preventing me from using a > system I wrote on a larger scale. That statement suggests you were able to get this working on a small scale -- is that correct? What does the working small-scale code look like? ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:22:41 2021 From: report at bugs.python.org (Michael L. Boom) Date: Fri, 18 Jun 2021 21:22:41 +0000 Subject: [issue43329] Multiprocessing Manager Client Not Reconnecting In-Reply-To: <1624050984.25.0.217099189569.issue43329@roundup.psfhosted.org> Message-ID: Michael L. Boom added the comment: I don't think I even got this working on the small scale. The unit test in the bug report is about as small as it gets and it doesn't work. The issue still exists in Python 3.9.5. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:23:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Jun 2021 21:23:10 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624051390.77.0.821872586479.issue44404@roundup.psfhosted.org> Terry J. Reedy added the comment: The docstring for .after says the 2nd argument must be a 'function'. Whether this issue is a bugfix or enhancement request depends whether one interprets 'function' as 'callable' or something narrower that only includes objects that necessarily have __name__ attributes. The latter would exclude partials and instances of user classes with __call__ methods. While a one-time-use partial as in the example is superfluous, I think other uses and parameterized callback classes should be supported. So I agree with changing the tkinter code rather than qualifying 'function' with 'has a .__name__ attribute'. I think 'type(func).__name__' should be safe. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:25:50 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 21:25:50 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1624051550.77.0.72938570184.issue43945@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 1b4addf3cbd0ef424939681ee67c802328d567ba by Ethan Furman in branch '3.10': [3.10] bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752) https://github.com/python/cpython/commit/1b4addf3cbd0ef424939681ee67c802328d567ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:25:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 21:25:50 +0000 Subject: [issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit] In-Reply-To: <1242377349.19.0.984337506616.issue6029@psf.upfronthosting.co.za> Message-ID: <1624051550.04.0.883945380942.issue6029@roundup.psfhosted.org> Irit Katriel added the comment: The patch doesn't look anything like the current code. Is this issue still relevant? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:28:01 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 21:28:01 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1624051681.1.0.839437759826.issue43945@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:31:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 21:31:08 +0000 Subject: [issue37832] Python requires /dev/urandom on HURD: _Py_HashRandomization_Init: failed to get random numbers In-Reply-To: <1565607650.45.0.0402326097483.issue37832@roundup.psfhosted.org> Message-ID: <1624051868.3.0.34431962186.issue37832@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:33:33 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 21:33:33 +0000 Subject: [issue44457] Finish format() change started in issue43945 In-Reply-To: <1624052006.12.0.84955724933.issue44457@roundup.psfhosted.org> Message-ID: <1624052013.28.0.894846064081.issue44457@roundup.psfhosted.org> Change by Ethan Furman : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:33:26 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 18 Jun 2021 21:33:26 +0000 Subject: [issue44457] Finish format() change started in issue43945 Message-ID: <1624052006.12.0.84955724933.issue44457@roundup.psfhosted.org> New submission from Ethan Furman : Finish the work started in issue43945 -- in 3.12 `format()` now uses the enum member itself instead of its `value`; e.g.: >>> class Color(int, Enum): ... RED = 1 >>> f"{Color.RED}" 'RED' >>> f"{Color.RED:d}" '1' ---------- assignee: ethan.furman messages: 396098 nosy: ethan.furman priority: normal severity: normal status: open title: Finish format() change started in issue43945 type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:34:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 21:34:39 +0000 Subject: [issue30379] multiprocessing Array create for ctypes.c_char, TypeError unless 1 char string arg used In-Reply-To: <1494946731.18.0.80959187038.issue30379@psf.upfronthosting.co.za> Message-ID: <1624052079.13.0.753991319497.issue30379@roundup.psfhosted.org> Irit Katriel added the comment: I'm assuming Davin's alternative solved your problem. If not, please check that you're still seeing it version 3.9+ and create a new issue. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:40:03 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 18 Jun 2021 21:40:03 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624052403.11.0.0499304973971.issue44456@roundup.psfhosted.org> Brandt Bucher added the comment: Yep, it's intentional. And yep, I like the new error message better. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 17:59:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 21:59:35 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1624053575.48.0.759299687326.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Mark, can you take a look at this? ---------- nosy: +pablogsal versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:00:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 18 Jun 2021 22:00:31 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1624053631.44.0.754350424463.issue44446@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:04:11 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 22:04:11 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1624053851.62.0.0172112064377.issue27752@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +25378 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26795 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:05:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Jun 2021 22:05:24 +0000 Subject: [issue44413] OverflowError: mktime argument out of range after 2019 In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org> Message-ID: <1624053924.9.0.362684811111.issue44413@roundup.psfhosted.org> Terry J. Reedy added the comment: An exception is not a 'crash', as defined for this tracker. 3.8 only gets security fixes. A 3.9 or 3.10 test is needed and Windows does not have pytz. ---------- nosy: +belopolsky, lemburg, p-ganssle, terry.reedy type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:13:19 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 18 Jun 2021 22:13:19 +0000 Subject: [issue27752] [doc] CSV DictReader default dialect name 'excel' is misleading, as MS Excel doesn't actually use ', ' as a separator. In-Reply-To: <1471070996.16.0.75939310279.issue27752@psf.upfronthosting.co.za> Message-ID: <1624054399.07.0.831583368963.issue27752@roundup.psfhosted.org> Jack DeVries added the comment: If you need semicolon delimiters, can't you just pass ``delimiter=';'`` to the reader or writer? I don't think there's a need for a separate dialect class for that, since dialect classes should only provide a baseline for the most broad use cases. Users have plenty of options for extending or customizing behavior without adding more dialect classes. I also think the docs around dialects are confusing. I remember being confused by them when I was learning! I made quite a few changes to try to add clarity around dialects to the documentation. Let me know if anybody has feedback! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:17:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 22:17:37 +0000 Subject: [issue18961] Non-UTF8 encoding line In-Reply-To: <1378568149.13.0.824239204214.issue18961@psf.upfronthosting.co.za> Message-ID: <1624054657.8.0.426259767127.issue18961@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced the same in 3.11: > .\python.bat nonutf8_coding_line.py Running Release|x64 interpreter... > .\python.bat -m tokenize nonutf8_coding_line.py Running Release|x64 interpreter... nonutf8_coding_line.py: error: invalid or missing encoding declaration for 'nonutf8_coding_line.py' ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:34:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 22:34:41 +0000 Subject: [issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior In-Reply-To: <1477276611.77.0.31268131141.issue28516@psf.upfronthosting.co.za> Message-ID: <1624055681.73.0.170427405978.issue28516@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy -patch versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 18:40:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 18 Jun 2021 22:40:32 +0000 Subject: [issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit] In-Reply-To: <1242377349.19.0.984337506616.issue6029@psf.upfronthosting.co.za> Message-ID: <1624056032.56.0.588399239447.issue6029@roundup.psfhosted.org> Terry J. Reedy added the comment: The 2014 patch to our copies of libffi eefd521f19ce included patches from 2009 forward, including at least one about long double alignment on sparc. If there are any problems now on current Solaris, they are likely to be different, and someone will find and report them. ---------- nosy: +jcea resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 19:01:56 2021 From: report at bugs.python.org (Matej Cepl) Date: Fri, 18 Jun 2021 23:01:56 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624057316.86.0.579866778032.issue44426@roundup.psfhosted.org> Matej Cepl added the comment: Actually, for 3.8.10 I had to add one more keyword which confused Sphinx: default. ---------- nosy: +mcepl Added file: https://bugs.python.org/file50117/bpo44426-complex-keyword-sphinx.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 19:07:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 23:07:52 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1624057672.63.0.379569740454.issue24888@roundup.psfhosted.org> Irit Katriel added the comment: The FileNotFoundException exception is coming from the Popen call, and the docs for subprocess.check_call already mention that it delegates to Popen. There are quite a few different exceptions that Popen could raise, so I think David's general comment is valid, it would not make sense to mention just this one, or to try and list all of them. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 19:21:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 23:21:23 +0000 Subject: [issue16959] rlcompleter doesn't work if __main__ can't be imported In-Reply-To: <1358135943.75.0.97619198268.issue16959@psf.upfronthosting.co.za> Message-ID: <1624058483.68.0.18805938282.issue16959@roundup.psfhosted.org> Irit Katriel added the comment: Your traceback indicates you had this problem on Python 2.7. Are you still seeing it on a current version? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 19:26:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 23:26:27 +0000 Subject: [issue23565] local_clear walks the list of threads without holding head_lock. In-Reply-To: <1425325523.34.0.879276411027.issue23565@psf.upfronthosting.co.za> Message-ID: <1624058787.96.0.693619529807.issue23565@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +pitrou, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 19:31:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 18 Jun 2021 23:31:21 +0000 Subject: [issue6871] decimal.py: more format issues In-Reply-To: <1252512442.21.0.45305758987.issue6871@psf.upfronthosting.co.za> Message-ID: <1624059081.57.0.17117678089.issue6871@roundup.psfhosted.org> Irit Katriel added the comment: Issue #2 still exists in 3.11: >>> format(float(123), "00") '123.0' >>> format(Decimal(123), "00") Traceback (most recent call last): File "", line 1, in ValueError: invalid format string ---------- nosy: +iritkatriel versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 20:15:38 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 19 Jun 2021 00:15:38 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624061738.56.0.973443762406.issue44297@roundup.psfhosted.org> Anthony Sottile added the comment: this appears to have regressed in 3.10 as well according to some reports on pytest: https://github.com/pytest-dev/pytest/pull/8227#issuecomment-864327090 ---------- nosy: +Anthony Sottile, pablogsal versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 20:30:43 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 19 Jun 2021 00:30:43 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624062643.67.0.487578243944.issue44297@roundup.psfhosted.org> Anthony Sottile added the comment: here's the traceback pytest is trying to display and crashing: ``` Traceback (most recent call last): File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/runner.py", line 311, in from_call result: Optional[TResult] = func() File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/runner.py", line 341, in call = CallInfo.from_call(lambda: list(collector.collect()), "collect") File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/python.py", line 503, in collect self._inject_setup_module_fixture() File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/python.py", line 516, in _inject_setup_module_fixture self.obj, ("setUpModule", "setup_module") File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/python.py", line 291, in obj self._obj = obj = self._getobj() File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/python.py", line 500, in _getobj return self._importtestmodule() File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/python.py", line 578, in _importtestmodule mod = import_path(self.fspath, mode=importmode) File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/pathlib.py", line 524, in import_path importlib.import_module(module_name) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module exec(co, module.__dict__) File "/tmp/rinohtype/tests/test_attribute.py", line 11, in from rinoh.attribute import Attribute, Bool File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/__init__.py", line 41, in from . import resource File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", line 205, in from .template import DocumentTemplate File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/template.py", line 42, in from .stylesheets import sphinx File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/stylesheets/__init__.py", line 42, in .format(stylesheet.description, stylesheet)) File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/style.py", line 670, in __str__ for name, entry_point in self.installed_resources: File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", line 54, in installed_resources for entry_point in ilm.entry_points()[cls.entry_point_group]: File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 979, in entry_points return SelectableGroups.load(eps).select(**params) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 437, in load ordered = sorted(eps, key=by_group) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line -1, in File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 600, in _normalized_name return Prepared.normalize(self.name) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 841, in normalize return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') File "/home/asottile/workspace/cpython/prefix/lib/python3.10/re.py", line 187, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 20:41:55 2021 From: report at bugs.python.org (Aaron Meurer) Date: Sat, 19 Jun 2021 00:41:55 +0000 Subject: [issue16959] rlcompleter doesn't work if __main__ can't be imported In-Reply-To: <1358135943.75.0.97619198268.issue16959@psf.upfronthosting.co.za> Message-ID: <1624063315.91.0.876670843674.issue16959@roundup.psfhosted.org> Aaron Meurer added the comment: A quick glance at the source shows that it still imports __main__ at the top-level. I have no idea how legitimate it is that the App Engine (used to?) makes it so that __main__ can't be imported. ---------- nosy: +asmeurer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 21:01:58 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 19 Jun 2021 01:01:58 +0000 Subject: [issue29158] Possible glitch in the interaction of a thread and a multiprocessing manager In-Reply-To: <1483557543.41.0.26156873729.issue29158@psf.upfronthosting.co.za> Message-ID: <1624064518.11.0.0603527235408.issue29158@roundup.psfhosted.org> Change by Ethan Furman : ---------- nosy: +ethan.furman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 22:09:51 2021 From: report at bugs.python.org (Arjun) Date: Sat, 19 Jun 2021 02:09:51 +0000 Subject: [issue32536] ast and tokenize disagree about line number In-Reply-To: <1515759409.32.0.467229070634.issue32536@psf.upfronthosting.co.za> Message-ID: <1624068591.89.0.248649648824.issue32536@roundup.psfhosted.org> Arjun added the comment: the line numbers are different for me too (MacOS). it seems that tokenize module is off by +1 line ---------- nosy: +CCLDArjun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 23:24:49 2021 From: report at bugs.python.org (Russell Keith-Magee) Date: Sat, 19 Jun 2021 03:24:49 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules Message-ID: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> New submission from Russell Keith-Magee : BPO-41486 added _BlocksOutputBuffer for the bz2, lzma and zlib module. Part of this patch included a new header file, pycore_blocks_output_buffer.h, which defines a BUFFER_BLOCK_SIZE constant. If two or more of the bz2, lzma or zlib modules are compiled as statically linked modules (i.e., added to Lib/Setup.local), this results in a duplicate symbol error when the Python executable is linked: ``` duplicate symbol '_BUFFER_BLOCK_SIZE' in: libpython3.10.a(_bz2module.o) libpython3.10.a(_lzmamodule.o) duplicate symbol '_BUFFER_BLOCK_SIZE' in: libpython3.10.a(_bz2module.o) libpython3.10.a(zlibmodule.o) ``` ---------- components: Extension Modules messages: 396114 nosy: freakboy3742 priority: normal severity: normal status: open title: Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules type: compile error versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 18 23:59:23 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 19 Jun 2021 03:59:23 +0000 Subject: [issue43329] Multiprocessing Manager Client Not Reconnecting In-Reply-To: <1614349902.25.0.128405443976.issue43329@roundup.psfhosted.org> Message-ID: <1624075163.96.0.521286536631.issue43329@roundup.psfhosted.org> Ethan Furman added the comment: Here is the test, reduced and in a single script: --- 8< -------------------------------------------------------------------- import multiprocessing.managers, os, sys, time if __name__ == '__main__': address = ("127.0.0.1", 54321) class TestManager(multiprocessing.managers.BaseManager): pass if sys.argv[1] == 'server': class TestClass(object): def test_method(self): print("In test_method") return "TEST" TestManager.register("Test", TestClass) manager = TestManager(address = address, authkey = "1234".encode("utf-8")) print('waiting...') manager.get_server().serve_forever() else: TestManager.register("Test") manager = TestManager(address = address, authkey = "1234".encode("utf-8")) manager.connect() test_class = manager.Test() print(test_class.test_method()) print("Kill and restart the server and press return") sys.stdin.readline() try: print(test_class.test_method()) except EOFError: print('EOF received\n') # reestablish connection manager.connect() test_class = manager.Test() # trigger error print(test_class.test_method()) --- 8< -------------------------------------------------------------------- Running it in two terminals gives (only showing client side): --------------------------------------------------------------------------- $ ./python ~/test_mp client TEST Kill and restart the server and press return # hit EOF received Traceback (most recent call last): File "/home/ethan/test_mp", line 45, in print(test_class.test_method()) File "", line 2, in test_method File "/source/virtualenv/lib/python3.9/multiprocessing/managers.py", line 808, in _callmethod conn.send((self._id, methodname, args, kwds)) File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 211, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 416, in _send_bytes self._send(header + buf) File "/source/virtualenv/lib/python3.9/multiprocessing/connection.py", line 373, in _send n = write(self._handle, buf) BrokenPipeError: [Errno 32] Broken pipe --------------------------------------------------------------------------- The problem appears to be that the call to `manager.connect()` after the EOF is not getting a new connection, but is reusing the old one (?). This is as far as I can take this; hopefully somebody with more multiprocessing/socket skills can take it from here. ---------- nosy: +davin, pitrou, serhiy.storchaka versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 00:52:06 2021 From: report at bugs.python.org (Arjun) Date: Sat, 19 Jun 2021 04:52:06 +0000 Subject: [issue32536] ast and tokenize disagree about line number In-Reply-To: <1515759409.32.0.467229070634.issue32536@psf.upfronthosting.co.za> Message-ID: <1624078326.28.0.537376740781.issue32536@roundup.psfhosted.org> Arjun added the comment: Well actually, it depends on the platform? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 02:22:26 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 19 Jun 2021 06:22:26 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh Message-ID: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> New submission from Anthony Sottile : installed from git: ``` $ git remote -v origin https://github.com/brechtm/rinohtype.git (fetch) origin https://github.com/brechtm/rinohtype.git (push) $ git rev-parse HEAD 4054539bae53eaddd10291c8429a1a32aeeb4786 ``` working in 3.10 b2: ```console $ ./venv310/bin/python --version --version Python 3.10.0b2 (default, Jun 2 2021, 00:22:18) [GCC 9.3.0] $ ./venv310/bin/python -m rinoh usage: rinoh [-h] [-f FORMAT] [-o OPTION=VALUE] [-t NAME or FILENAME] [-s NAME or FILENAME] [-O FILENAME or DIRECTORY] [-p PAPER] [-i] [--list-templates] [--list-stylesheets] [--list-fonts [FILENAME]] [--list-formats] [--list-options FRONTEND] [--version] [--docs] [input] Render a structured document to PDF. positional arguments: input the document to render options: -h, --help show this help message and exit -f FORMAT, --format FORMAT the format of the input file (default: autodetect) -o OPTION=VALUE, --option OPTION=VALUE options to be passed to the input file reader -t NAME or FILENAME, --template NAME or FILENAME the document template or template configuration file to use (default: article) -s NAME or FILENAME, --stylesheet NAME or FILENAME the style sheet used to style the document elements (default: the template's default) -O FILENAME or DIRECTORY, --output FILENAME or DIRECTORY write the PDF output to FILENAME or to an existing DIRECTORY with a filename derived from the input filename (default: the current working directory) -p PAPER, --paper PAPER the paper size to render to (default: the template's default) -i, --install-resources automatically install missing resources (fonts, templates, style sheets) from PyPI --list-templates list the installed document templates and exit --list-stylesheets list the installed style sheets and exit --list-fonts [FILENAME] list the installed fonts or, if FILENAME is given, write a PDF file displaying all the fonts --list-formats list the supported input formats and exit --list-options FRONTEND list the options supported by the given frontend and exit --version show program's version number and exit --docs open the online documentation in the default browser ``` broken in 3.10 b3: ```console $ ./venv/bin/python --version --version Python 3.10.0b3+ (heads/3.10:1b4addf3cb, Jun 18 2021, 17:21:48) [GCC 9.3.0] $ ./venv/bin/python -m rinoh Traceback (most recent call last): File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 187, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 146, in _get_module_details return _get_module_details(pkg_main_name, error) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/runpy.py", line 110, in _get_module_details __import__(pkg_name) File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/__init__.py", line 41, in from . import resource File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", line 205, in from .template import DocumentTemplate File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/template.py", line 42, in from .stylesheets import sphinx File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/stylesheets/__init__.py", line 42, in .format(stylesheet.description, stylesheet)) File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/style.py", line 670, in __str__ for name, entry_point in self.installed_resources: File "/tmp/rinohtype/venv/lib/python3.10/site-packages/rinoh/resource.py", line 54, in installed_resources for entry_point in ilm.entry_points()[cls.entry_point_group]: File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 979, in entry_points return SelectableGroups.load(eps).select(**params) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 437, in load ordered = sorted(eps, key=by_group) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line -1, in File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 600, in _normalized_name return Prepared.normalize(self.name) File "/home/asottile/workspace/cpython/prefix/lib/python3.10/importlib/metadata/__init__.py", line 841, in normalize return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') File "/home/asottile/workspace/cpython/prefix/lib/python3.10/re.py", line 187, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object ``` ---------- components: Library (Lib) messages: 396117 nosy: Anthony Sottile, jaraco, pablogsal priority: normal severity: normal status: open title: 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 02:30:39 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 19 Jun 2021 06:30:39 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624084239.39.0.375254929959.issue44297@roundup.psfhosted.org> Anthony Sottile added the comment: here is a minimal reproduction: ```python def iterboom(): raise AssertionError yield 1 next(1 for x in iterboom()) ``` python 3.9: ``` $ python3.9 t.py Traceback (most recent call last): File "/tmp/rinohtype/t.py", line 5, in next(1 for x in iterboom()) File "/tmp/rinohtype/t.py", line 5, in next(1 for x in iterboom()) File "/tmp/rinohtype/t.py", line 2, in iterboom raise AssertionError AssertionError ``` ``` $ python3.10 t.py Traceback (most recent call last): File "/tmp/rinohtype/t.py", line 5, in next(1 for x in iterboom()) File "/tmp/rinohtype/t.py", line -1, in File "/tmp/rinohtype/t.py", line 2, in iterboom raise AssertionError AssertionError ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 04:50:01 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 08:50:01 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624092601.63.0.969390724399.issue44426@roundup.psfhosted.org> Change by Mark Dickinson : ---------- pull_requests: +25379 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26798 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:03:00 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 09:03:00 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624093380.57.0.359373253022.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: Fixed in GH-26798 (not yet merged). With that change, the documentation builds cleanly for me with Python 3.9.5 / Sphinx 4.0.2 / blurb 1.0.8 / python-docs-theme 2021.5, using the command $ python -m sphinx -b html -W . build/html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:08:48 2021 From: report at bugs.python.org (Christian Heimes) Date: Sat, 19 Jun 2021 09:08:48 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1624093728.15.0.687104607721.issue38820@roundup.psfhosted.org> Christian Heimes added the comment: New changeset 44fb55149934d8fb095edb6fc3f8167208035b96 by Christian Heimes in branch 'main': bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769) https://github.com/python/cpython/commit/44fb55149934d8fb095edb6fc3f8167208035b96 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:08:50 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 09:08:50 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1624093730.25.0.935915737332.issue38820@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25380 pull_request: https://github.com/python/cpython/pull/26799 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:17:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 09:17:15 +0000 Subject: [issue35714] Document that the null character '\0' terminates a struct format spec In-Reply-To: <1547160130.27.0.885629506261.issue35714@roundup.psfhosted.org> Message-ID: <1624094235.21.0.0677983249609.issue35714@roundup.psfhosted.org> Mark Dickinson added the comment: Yes, this looks closeable. Thank you! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:23:14 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 09:23:14 +0000 Subject: [issue6871] decimal.py: more format issues In-Reply-To: <1252512442.21.0.45305758987.issue6871@psf.upfronthosting.co.za> Message-ID: <1624094594.11.0.441572531073.issue6871@roundup.psfhosted.org> Mark Dickinson added the comment: Eric: any thoughts on this? It's looking like a "won't fix" to me. Regardless of what we think the "right" thing to do is, making the float behaviour stricter would be a backwards compatibility break, and relaxing the Decimal behaviour involves either diverging from the upstream libmpdec (and then having to maintain that divergence if we update to newer versions of libmpdec) or pushing changes back upstream. Both of those options seem like more effort than it's worth for something that apparently hasn't actually bothered anyone for several years. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 05:24:45 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 09:24:45 +0000 Subject: [issue29282] Fused multiply-add: proposal to add math.fma() In-Reply-To: <1484560897.19.0.0955404368118.issue29282@psf.upfronthosting.co.za> Message-ID: <1624094685.62.0.0681345150102.issue29282@roundup.psfhosted.org> Change by Mark Dickinson : ---------- assignee: mark.dickinson -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 06:45:09 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 10:45:09 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1624099509.89.0.0379808505165.issue38820@roundup.psfhosted.org> miss-islington added the comment: New changeset c6cd2ecdb64d16f640ff255e5a267b95974a8041 by Miss Islington (bot) in branch '3.10': [3.10] bpo-38820: Test with OpenSSL 3.0.0-beta1 (GH-26769) (GH-26799) https://github.com/python/cpython/commit/c6cd2ecdb64d16f640ff255e5a267b95974a8041 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 06:56:04 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 19 Jun 2021 10:56:04 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624100164.71.0.487326493997.issue43298@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +25381 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26800 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 06:57:49 2021 From: report at bugs.python.org (Andrey Brykin) Date: Sat, 19 Jun 2021 10:57:49 +0000 Subject: [issue44460] python crashes when pandas reading parquet Message-ID: <1624100269.18.0.472069850311.issue44460@roundup.psfhosted.org> New submission from Andrey Brykin : Python crashes when running this code (I attached the error message screenshot): import pandas as pd d = {'col1': [[0.] * 25] * 2560} df = pd.DataFrame(data=d) df.to_parquet('data.parquet') for j in range(15): table = pd.read_parquet('data.parquet') There is no error when running from python 3.9.5 with the same pandas version. So it doesn't relate to pandas. The error happening with the exact list size of 2560 - no error with 2561 or 2559. Another dimension is also important: there is no error if it is exceeding 25. I am running on Windows 10 2004. ---------- components: IO, Windows files: message.png messages: 396124 nosy: brand17, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: python crashes when pandas reading parquet type: crash versions: Python 3.6 Added file: https://bugs.python.org/file50118/message.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 06:59:25 2021 From: report at bugs.python.org (Andrey Brykin) Date: Sat, 19 Jun 2021 10:59:25 +0000 Subject: [issue44460] python crashes when pandas reading parquet In-Reply-To: <1624100269.18.0.472069850311.issue44460@roundup.psfhosted.org> Message-ID: <1624100365.32.0.162776391933.issue44460@roundup.psfhosted.org> Andrey Brykin added the comment: pandas version is 1.1.5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:01:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 19 Jun 2021 11:01:10 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624100470.87.0.0273860167624.issue44450@roundup.psfhosted.org> Mark Shannon added the comment: Ned, is this a regression (does 3.9 do the right thing on Windows) or an inconsistency between Mac and Windows? I suspect this might have something to do with the PREDICT macros. If that the were the case 3.9 should show the same inconsistency between Windows and the Mac. ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:21:57 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 19 Jun 2021 11:21:57 +0000 Subject: [issue44460] python crashes when pandas reading parquet In-Reply-To: <1624100269.18.0.472069850311.issue44460@roundup.psfhosted.org> Message-ID: <1624101717.05.0.549505431704.issue44460@roundup.psfhosted.org> Steve Dower added the comment: Python 3.6 is no longer supported by us, so unless this occurs with a newer version (which apparently it does not), we're not going to be able to look into it. If this is critical to you, you probably want to get in touch with Anaconda or ActiveState to see if they will provide you with support (or someone else, not sure who else is offering support like this right now... Quansight maybe?). ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:25:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 19 Jun 2021 11:25:35 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624101935.25.0.44146492479.issue44297@roundup.psfhosted.org> Mark Shannon added the comment: Thanks Anthony, that's a big help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:35:56 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sat, 19 Jun 2021 11:35:56 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624102556.74.0.462051360331.issue44450@roundup.psfhosted.org> Ned Batchelder added the comment: This happens with all the 3.10 betas, and does not happen in 3.9 and earlier: https://github.com/nedbat/coveragepy/runs/2864611225 (Sorry, other failures with earlier 3.10 betas obscured the mac/win difference.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:45:20 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 19 Jun 2021 11:45:20 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624103120.79.0.506601246657.issue44297@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25382 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26801 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 07:46:26 2021 From: report at bugs.python.org (HAK CG RAP) Date: Sat, 19 Jun 2021 11:46:26 +0000 Subject: =?utf-8?b?W2lzc3VlNDQ0NTBdIOGegeGfkuGemOGfguGemuGen+GelOGfi+Gem+GegA==?= =?utf-8?b?4Z+L4Z6R4Z+G4Z6T4Z634Z6J?= In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624103186.36.0.893816651881.issue44450@roundup.psfhosted.org> Change by HAK CG RAP : ---------- 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, habrecord22, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware title: Generator expressions trace differently on Windows than on Mac -> ???????????????? type: -> behavior Added file: https://bugs.python.org/file50119/setext (1).tgz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:11:04 2021 From: report at bugs.python.org (HAK CG Gang) Date: Sat, 19 Jun 2021 12:11:04 +0000 Subject: [issue22018] signal.set_wakeup_fd() should accept sockets on Windows In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624104664.92.0.49897561949.issue22018@roundup.psfhosted.org> Change by HAK CG Gang : ---------- nosy: +habrecord22 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:33:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 19 Jun 2021 12:33:09 +0000 Subject: [issue6871] decimal.py: more format issues In-Reply-To: <1252512442.21.0.45305758987.issue6871@psf.upfronthosting.co.za> Message-ID: <1624105989.22.0.434390823253.issue6871@roundup.psfhosted.org> Eric V. Smith added the comment: I tend to agree with Mark: any change would be disruptive, and it doesn't seem to be causing any real problem. Irit: did you come across this because it's causing a problem somewhere? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:45:25 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 12:45:25 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624106725.66.0.995729392558.issue43298@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25383 pull_request: https://github.com/python/cpython/pull/26802 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:45:32 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 19 Jun 2021 12:45:32 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624106732.54.0.117656771755.issue43298@roundup.psfhosted.org> Steve Dower added the comment: New changeset 80190b3e533097b55077becddc75423318ab2371 by Steve Dower in branch 'main': bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) https://github.com/python/cpython/commit/80190b3e533097b55077becddc75423318ab2371 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:45:30 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 12:45:30 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624106730.47.0.631502181595.issue43298@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25384 pull_request: https://github.com/python/cpython/pull/26803 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 08:50:16 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 19 Jun 2021 12:50:16 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624107016.56.0.534519942984.issue43298@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 09:10:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 13:10:01 +0000 Subject: [issue6871] decimal.py: more format issues In-Reply-To: <1252512442.21.0.45305758987.issue6871@psf.upfronthosting.co.za> Message-ID: <1624108201.28.0.627615739762.issue6871@roundup.psfhosted.org> Irit Katriel added the comment: No just trying to sort out the backlog. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:10:22 2021 From: report at bugs.python.org (HAK CG Gang) Date: Sat, 19 Jun 2021 14:10:22 +0000 Subject: =?utf-8?b?W2lzc3VlMjIwMThdIOGegeGfkuGemOGfguGemuGen+GelOGfi+Gem+GegA==?= =?utf-8?b?4Z+L4Z6R4Z+G4Z6T4Z634Z6J?= In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624111822.36.0.654440892615.issue22018@roundup.psfhosted.org> Change by HAK CG Gang : Added file: https://bugs.python.org/file50120/??????????????????????????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:10:08 2021 From: report at bugs.python.org (HAK CG Gang) Date: Sat, 19 Jun 2021 14:10:08 +0000 Subject: =?utf-8?b?W2lzc3VlMjIwMThdIOGegeGfkuGemOGfguGemuGen+GelOGfi+Gem+GegA==?= =?utf-8?b?4Z+L4Z6R4Z+G4Z6T4Z634Z6J?= In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624111808.01.0.117436050556.issue22018@roundup.psfhosted.org> Change by HAK CG Gang : ---------- assignee: -> docs at python 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, Interpreter Core, Library (Lib), Parser, Regular Expressions, SSL, Subinterpreters, Tests, Tkinter, Unicode, XML, ctypes, email, macOS nosy: +Alex.Willmer, asvetlov, barry, cjw296, docs at python, 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, zach.ware -gvanrossum, loewis, neologix, pitrou, python-dev title: signal.set_wakeup_fd() should accept sockets on Windows -> ???????????????? type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:14:16 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 19 Jun 2021 14:14:16 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624112056.61.0.246429907975.issue44450@roundup.psfhosted.org> Change by E. Paine : ---------- 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, habrecord22, koobs, larry, lys.nikolaou, mrabarnett, ned.deily, pablogsal, paul.moore, r.david.murray, ronaldoussoren, steve.dower, terry.reedy, tim.golden, vstinner, yselivanov, zach.ware title: ???????????????? -> Generator expressions trace differently on Windows than on Mac type: behavior -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:32:38 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 14:32:38 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624113158.19.0.174145253722.issue44426@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25386 pull_request: https://github.com/python/cpython/pull/26805 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:32:33 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 19 Jun 2021 14:32:33 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624113153.21.0.810726985138.issue44426@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25385 pull_request: https://github.com/python/cpython/pull/26804 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 10:32:42 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 14:32:42 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624113162.17.0.702361285024.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 291848195f85e23c01adb76d5a0ff9c6eb7f2614 by Mark Dickinson in branch 'main': bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) https://github.com/python/cpython/commit/291848195f85e23c01adb76d5a0ff9c6eb7f2614 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:16:16 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 15:16:16 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624115776.58.0.0802254080629.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 139c5778c26aaf25b51fcfabd88c99ba728beaea by Miss Islington (bot) in branch '3.10': bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) (GH-26804) https://github.com/python/cpython/commit/139c5778c26aaf25b51fcfabd88c99ba728beaea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:16:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 19 Jun 2021 15:16:41 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624115801.17.0.270343781442.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset 533bff4e9fe221a7c9cf12795fd2d002e87bfa6a by Miss Islington (bot) in branch '3.9': bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) (GH-26805) https://github.com/python/cpython/commit/533bff4e9fe221a7c9cf12795fd2d002e87bfa6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:26:00 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 19 Jun 2021 15:26:00 +0000 Subject: [issue6871] decimal.py: more format issues In-Reply-To: <1252512442.21.0.45305758987.issue6871@psf.upfronthosting.co.za> Message-ID: <1624116360.46.0.0900491684425.issue6871@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, Irit. I'm closing this as "won't fix". ---------- resolution: out of date -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:31:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Jun 2021 15:31:25 +0000 Subject: =?utf-8?b?W2lzc3VlMjIwMThdIOGegeGfkuGemOGfguGemuGen+GelOGfi+Gem+GegA==?= =?utf-8?b?4Z+L4Z6R4Z+G4Z6T4Z634Z6J?= In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624116685.94.0.30197701388.issue22018@roundup.psfhosted.org> Change by STINNER Victor : Removed file: https://bugs.python.org/file50120/??????????????????????????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:31:39 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Jun 2021 15:31:39 +0000 Subject: [issue22018] signal.set_wakeup_fd() should accept sockets on Windows In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624116699.0.0.498334613091.issue22018@roundup.psfhosted.org> Change by STINNER Victor : ---------- title: ???????????????? -> signal.set_wakeup_fd() should accept sockets on Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:32:11 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 19 Jun 2021 15:32:11 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624116731.22.0.657326750889.issue44450@roundup.psfhosted.org> Change by STINNER Victor : Removed file: https://bugs.python.org/file50119/??????????????????????????? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:38:01 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 15:38:01 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624117081.44.0.621992897086.issue44459@roundup.psfhosted.org> Jason R. Coombs added the comment: I suspect the performance enhancements to distribution deduplication are relevant here. Previously, distributions were deduplicated based on the canonical distribution name. Now they're deduplicated on the normalized name. And it seems that when attempting to calculate the normalized name in the indicated environment that the Distribution.name isn't a text string. That's a little surprising, but I'll investigate to see how that condition comes about. ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 11:55:24 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 15:55:24 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' Message-ID: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> New submission from Jason R. Coombs : While doing some debugging on issue44459 using Python 3.10b3, I was using Pdb and after troubleshooting an exception and hitting 'q' to quit, I saw the following: ``` (Pdb) q Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1709, in main pdb._runmodule(mainpyfile) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1541, in _runmodule mod_name, mod_spec, code = runpy._get_module_details(module_name) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 146, in _get_module_details return _get_module_details(pkg_main_name, error) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 110, in _get_module_details __import__(pkg_name) File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/__init__.py", line 41, in from . import resource File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/resource.py", line 205, in from .template import DocumentTemplate File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/template.py", line 42, in from .stylesheets import sphinx File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/stylesheets/__init__.py", line 42, in .format(stylesheet.description, stylesheet)) File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/style.py", line 670, in __str__ for name, entry_point in self.installed_resources: File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/resource.py", line 54, in installed_resources for entry_point in ilm.entry_points()[cls.entry_point_group]: File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 979, in entry_points return SelectableGroups.load(eps).select(**params) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 437, in load ordered = sorted(eps, key=by_group) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line -1, in File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 600, in _normalized_name return Prepared.normalize(self.name) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 841, in normalize return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py", line 187, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1738, in pdb.main() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1730, in main pdb.interaction(None, t) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 357, in interaction self._cmdloop() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 322, in _cmdloop self.cmdloop() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/cmd.py", line 138, in cmdloop stop = self.onecmd(line) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 422, in onecmd return cmd.Cmd.onecmd(self, line) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/cmd.py", line 217, in onecmd return func(arg) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1118, in do_quit self.set_quit() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/bdb.py", line 358, in set_quit self.stopframe = self.botframe AttributeError: 'Pdb' object has no attribute 'botframe'. Did you mean: 'curframe'? ``` I'd not seen this error before, so I suspect there may be a regression in 3.10. I haven't investigated further, but I wanted to register this possible issue. ---------- components: Library (Lib) keywords: 3.10regression messages: 396138 nosy: jaraco priority: normal severity: normal status: open title: 'Pdb' object has no attribute 'botframe' versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 12:00:31 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 16:00:31 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624118431.61.0.0567988238699.issue44459@roundup.psfhosted.org> Jason R. Coombs added the comment: Running the debugger, I can confirm that Distribution.name is None in this case: ``` ~ $ python3.10 -m pip-run -q rinohtype -- -m pdb -m rinoh --help WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available. You should consider upgrading via the '/usr/local/bin/python3.10 -m pip install --upgrade pip' command. Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py(187)sub() -> return _compile(pattern, flags).sub(repl, string, count) Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1709, in main pdb._runmodule(mainpyfile) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pdb.py", line 1541, in _runmodule mod_name, mod_spec, code = runpy._get_module_details(module_name) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 146, in _get_module_details return _get_module_details(pkg_main_name, error) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 110, in _get_module_details __import__(pkg_name) File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/__init__.py", line 41, in from . import resource File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/resource.py", line 205, in from .template import DocumentTemplate File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/template.py", line 42, in from .stylesheets import sphinx File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/stylesheets/__init__.py", line 42, in .format(stylesheet.description, stylesheet)) File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/style.py", line 670, in __str__ for name, entry_point in self.installed_resources: File "/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-run-w0xovt3h/rinoh/resource.py", line 54, in installed_resources for entry_point in ilm.entry_points()[cls.entry_point_group]: File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 979, in entry_points return SelectableGroups.load(eps).select(**params) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 437, in load ordered = sorted(eps, key=by_group) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line -1, in File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 600, in _normalized_name return Prepared.normalize(self.name) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py", line 841, in normalize return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/re.py", line 187, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: expected string or bytes-like object (Pdb) string is None True (Pdb) u > /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py(841)normalize() -> return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_') (Pdb) u > /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/metadata/__init__.py(600)_normalized_name() -> return Prepared.normalize(self.name) (Pdb) self.name is None True ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 12:35:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 19 Jun 2021 16:35:31 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624120531.85.0.802646475521.issue44459@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +3.10regression priority: normal -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 12:53:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 16:53:30 +0000 Subject: [issue16959] rlcompleter doesn't work if __main__ can't be imported In-Reply-To: <1358135943.75.0.97619198268.issue16959@psf.upfronthosting.co.za> Message-ID: <1624121610.52.0.879471235649.issue16959@roundup.psfhosted.org> Irit Katriel added the comment: Since this is not currently a problem for you, and nobody else reported it since 2013, I?ll close the issue and if anyone runs into it again we can investigate on current python/app engine versions. ---------- resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:04:12 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:04:12 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624122252.78.0.0978317064856.issue44459@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- priority: normal -> deferred blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:03:51 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:03:51 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624122231.26.0.551354325784.issue44459@roundup.psfhosted.org> Jason R. Coombs added the comment: It seems that even on Python 3.9 or 3.10b2, the [DynamicRinohDistribution](https://github.com/brechtm/rinohtype/blob/e7f1c2c6066303d86cff4105be0829f512059be2/src/rinoh/resource.py#L132) would return `None` for the `name` property (despite the [attempt to return the empty string](https://github.com/brechtm/rinohtype/blob/e7f1c2c6066303d86cff4105be0829f512059be2/src/rinoh/resource.py#L135)). The Python object model doesn't allow overriding descriptor (@property) in a superclass with a static class property in the subclass. I'm struggling to understand how the DynamicRinohDistribution works at all. I think I see. `importlib.metadata.Distribution`, while it declares a couple of abstract methods, doesn't actually declare itself an abstract base class, so someone can subclass it and get the degenerate behavior for the abstract methods. That's why a DynamicRinohDistribution.metadata gets `None` for `self.read_text` and then `email.message_from_string(None)` returns an empty `Message` object. My instinct here is that the `Distribution.name` was always expected to return a string and the fact that it's returning `None` is a symptom of the subclass not implementing the abstract methods. To be sure, type annotations might have helped here (if the `name` property declared that the return type is `str`, then `None` would be an invalid return value). The importlib distribution discovery mechanism was designed for other package distribution providers to make their distributions visible. It was not designed with the Rinoh use-case in mind (where a distribution already installed using the standard finders would present other "dynamic" distributions). Given that Rinoh is using the distribution discovery mechanism in a way that it was not designed to support and is unlikely to be a widespread (or even repeated) use-case, I'm leaning toward a recommendation that the issue be fixed in Rinoh by defining a name property that returns text (and preferably something other than the empty string). ---------- priority: deferred blocker -> normal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:06:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 17:06:37 +0000 Subject: [issue24888] FileNotFoundException raised by subprocess.call In-Reply-To: <1439908591.24.0.224694175166.issue24888@psf.upfronthosting.co.za> Message-ID: <1624122397.62.0.742278187504.issue24888@roundup.psfhosted.org> Irit Katriel added the comment: That said, the current wording does seem to imply that only CalledProcessErrors can be raised by this function so it might be worth clarifying that other exceptions can occur if the command could not run at all (without enumerating the precise exceptions). ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:08:19 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:08:19 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624122499.5.0.97257484908.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: I encountered the same error on Python 3.9. ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:10:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:10:11 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624122611.12.0.383904537418.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: I can replicate the issue with this command: `python -m pdb -m importlib` (since `importlib` isn't executable, it triggers an error in runpy). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:18:31 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:18:31 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624123111.74.0.483482271508.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: I was _unable_ to replicate the issue with a foo.py containing only `raise ValueError`, even with `python -m pdb -m foo`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:18:42 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:18:42 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624123122.88.0.197640627619.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: -3.10regression _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:25:18 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 17:25:18 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624123518.83.0.876739281644.issue44459@roundup.psfhosted.org> Jason R. Coombs added the comment: A small patch to rinoh seems to work around the issue: ``` diff --git a/src/rinoh/resource.py b/src/rinoh/resource.py index 57143f9d..586a4bb7 100644 --- a/src/rinoh/resource.py +++ b/src/rinoh/resource.py @@ -132,7 +132,9 @@ class DynamicEntryPoint(DynamicEntryPointBase): class DynamicRinohDistribution(ilm.Distribution): """Distribution for registering resource entry points to at runtime""" - name = '' + @property + def name(self): + return 'rinoh-dynamic-distro' def __init__(self): self._templates = {} rinohtype master $ python3.10 -m pip-run --use-feature=in-tree-build -q . -- -m rinoh --help usage: rinoh [-h] [-f FORMAT] [-o OPTION=VALUE] [-t NAME or FILENAME] [-s NAME or FILENAME] [-O FILENAME or DIRECTORY] [-p PAPER] [-i] [--list-templates] [--list-stylesheets] [--list-fonts [FILENAME]] [--list-formats] [--list-options FRONTEND] [--version] [--docs] [input] Render a structured document to PDF. positional arguments: input the document to render options: -h, --help show this help message and exit -f FORMAT, --format FORMAT the format of the input file (default: autodetect) -o OPTION=VALUE, --option OPTION=VALUE options to be passed to the input file reader -t NAME or FILENAME, --template NAME or FILENAME the document template or template configuration file to use (default: article) -s NAME or FILENAME, --stylesheet NAME or FILENAME the style sheet used to style the document elements (default: the template's default) -O FILENAME or DIRECTORY, --output FILENAME or DIRECTORY write the PDF output to FILENAME or to an existing DIRECTORY with a filename derived from the input filename (default: the current working directory) -p PAPER, --paper PAPER the paper size to render to (default: the template's default) -i, --install-resources automatically install missing resources (fonts, templates, style sheets) from PyPI --list-templates list the installed document templates and exit --list-stylesheets list the installed style sheets and exit --list-fonts [FILENAME] list the installed fonts or, if FILENAME is given, write a PDF file displaying all the fonts --list-formats list the supported input formats and exit --list-options FRONTEND list the options supported by the given frontend and exit --version show program's version number and exit --docs open the online documentation in the default browser ``` Anthony, does that recommendation address the concern? Do you have any reason to think other users may be doing something similarly? Do you think it's worth adding a compatibility shim to support this improper usage? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 13:31:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Jun 2021 17:31:25 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624123885.52.0.0451784457231.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 09eb81711597725f853e4f3b659ce185488b0d8c by Sebastian Rittau in branch 'main': bpo-38291: DeprecationWarning when importing typing.{io,re} (#26719) https://github.com/python/cpython/commit/09eb81711597725f853e4f3b659ce185488b0d8c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 14:40:42 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 19 Jun 2021 18:40:42 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624128042.84.0.171984268769.issue44458@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 14:58:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 18:58:23 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624129103.31.0.795060859911.issue12022@roundup.psfhosted.org> Irit Katriel added the comment: I've reproduced this on 3.11 (though the AttributeError is now on __enter__ and not __exit__ as was the case in msg135484): >>> import transaction >>> with transaction: pass ... Traceback (most recent call last): File "", line 1, in AttributeError: __enter__ >>> import sys >>> sys.__exit__ Traceback (most recent call last): File "", line 1, in AttributeError: module 'sys' has no attribute '__exit__' >>> ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:19:59 2021 From: report at bugs.python.org (Larry Hastings) Date: Sat, 19 Jun 2021 19:19:59 +0000 Subject: [issue22018] signal.set_wakeup_fd() should accept sockets on Windows In-Reply-To: <1405885633.45.0.930815175926.issue22018@psf.upfronthosting.co.za> Message-ID: <1624130399.56.0.781577507191.issue22018@roundup.psfhosted.org> Change by Larry Hastings : ---------- nosy: -larry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:34:12 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 19 Jun 2021 19:34:12 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624131252.39.0.418986117137.issue44458@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:42:15 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 19 Jun 2021 19:42:15 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624131735.84.0.787237991537.issue44229@roundup.psfhosted.org> Terry J. Reedy added the comment: See #44237 for another repeatedly failing (false positive) ssl test. These and other randomly failing tests should be skipped for routine CI regression testing of PRs. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:42:57 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Jun 2021 19:42:57 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1624131777.94.0.456503459763.issue44337@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum nosy_count: 2.0 -> 3.0 pull_requests: +25387 pull_request: https://github.com/python/cpython/pull/26749 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:45:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Jun 2021 19:45:32 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1624131932.42.0.257711710139.issue44337@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: -25387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:46:24 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 19 Jun 2021 19:46:24 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1624131984.48.0.353576770035.issue44337@roundup.psfhosted.org> Guido van Rossum added the comment: (That pull request doesn't have anything to do with this issue, but while testing it I did find a crash bug that I've bisected to this issue. See https://github.com/python/cpython/pull/26749#issuecomment-864454848.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:49:48 2021 From: report at bugs.python.org (Chaitanya) Date: Sat, 19 Jun 2021 19:49:48 +0000 Subject: [issue44462] multiprocessing.get hangs if the pool is closed in the signal handler Message-ID: <1624132188.66.0.0481912539758.issue44462@roundup.psfhosted.org> New submission from Chaitanya : This is similar to https://bugs.python.org/issue22393 but the child is killed in the Pool.terminate() using SIGTERM i.e., proper way. Run the attached script that runs an indefinite method using multiprocessing.apply_async, and in the signal handler for SIGTERM does the pool clean up (close, terminate and join), on issuing a SIGTERM (`kill `), the cleanup works fine, but the parent process is stuck in get() as during termination the event is not set. Able to repro with all 3.6/3.9/3.10. See logs below ``` [DEBUG/MainProcess] created semlock with handle 140035884298240 [DEBUG/MainProcess] created semlock with handle 140035884294144 [DEBUG/MainProcess] created semlock with handle 140035884290048 [DEBUG/MainProcess] created semlock with handle 140035884285952 [DEBUG/MainProcess] created semlock with handle 140035884281856 [DEBUG/MainProcess] created semlock with handle 140035884277760 [DEBUG/MainProcess] added worker [INFO/ForkPoolWorker-1] child process calling self.run() [INFO/MainProcess] [INFO/MainProcess] [INFO/MainProcess] [INFO/ForkPoolWorker-1] Signals for 28462 [INFO/ForkPoolWorker-1] Handlers.SIG_DFL [INFO/ForkPoolWorker-1] [INFO/ForkPoolWorker-1] Handlers.SIG_DFL [INFO/MainProcess] 28461: Caught signal 15 [INFO/MainProcess] 28461: Closing pools [INFO/MainProcess] 28461: Terminating pools [DEBUG/MainProcess] terminating pool [DEBUG/MainProcess] finalizing pool [DEBUG/MainProcess] helping task handler/workers to finish [DEBUG/MainProcess] removing tasks from inqueue until task handler finished [DEBUG/MainProcess] joining worker handler [DEBUG/MainProcess] worker handler exiting [DEBUG/MainProcess] result handler found thread._state=TERMINATE [DEBUG/MainProcess] ensuring that outqueue is not full [DEBUG/MainProcess] result handler exiting: len(cache)=1, thread._state=TERMINATE [DEBUG/MainProcess] task handler got sentinel [DEBUG/MainProcess] task handler sending sentinel to result handler [DEBUG/MainProcess] task handler sending sentinel to workers [DEBUG/MainProcess] task handler exiting [DEBUG/MainProcess] terminating workers [DEBUG/MainProcess] joining task handler [DEBUG/MainProcess] joining result handler [DEBUG/MainProcess] joining pool workers [DEBUG/MainProcess] cleaning up worker 28462 [INFO/MainProcess] 28461: Joining pools [DEBUG/MainProcess] joining pool [INFO/MainProcess] 28461: Closed pools ``` ``` (gdb) py-bt Traceback (most recent call first): File "/usr/lib/python3.9/threading.py", line 312, in wait waiter.acquire() File "/usr/lib/python3.9/threading.py", line 574, in wait signaled = self._cond.wait(timeout) File "/usr/lib/python3.9/multiprocessing/pool.py", line 762, in wait self._event.wait(timeout) File "/usr/lib/python3.9/multiprocessing/pool.py", line 765, in get self.wait(timeout) File "/home/tatac/workspaces/gerrit/bwt-device-health-manager/mp_test.py", line 66, in a.get() (gdb) ``` ---------- components: Library (Lib) files: mp_test.py messages: 396151 nosy: tkc17 priority: normal severity: normal status: open title: multiprocessing.get hangs if the pool is closed in the signal handler type: behavior versions: Python 3.10 Added file: https://bugs.python.org/file50121/mp_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 15:57:21 2021 From: report at bugs.python.org (Andre Roberge) Date: Sat, 19 Jun 2021 19:57:21 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624132641.86.0.0653298089009.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: Would it be possible to add a single line of code to idlelib's pyshell.py, as indicated below: def showsyntaxerror(self, filename=None): """... """ linecache.cache[""] = linecache.cache[filename] # here tkconsole = self.tkconsole ... Of course, another name than "" could be chosen. This would allow users (like me, with Friendly) to retrieve the code that caused a SyntaxError and process it as they wish. In my case, it would allow me to reproduce the SyntaxError and have Friendly provide an explanation and possible suggestions for fixing the error. This would complement the new support for user defined sys.excepthook introduced in Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 16:27:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 19 Jun 2021 20:27:09 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624134429.23.0.0982781197495.issue12022@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 17:53:03 2021 From: report at bugs.python.org (Ethan Furman) Date: Sat, 19 Jun 2021 21:53:03 +0000 Subject: [issue44342] enum with inherited type won't pickle In-Reply-To: <1623113813.43.0.510993848809.issue44342@roundup.psfhosted.org> Message-ID: <1624139583.72.0.288353309237.issue44342@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 18:25:23 2021 From: report at bugs.python.org (Chris Wagner) Date: Sat, 19 Jun 2021 22:25:23 +0000 Subject: [issue44463] HTTP Cookiejar doesn't support samesite Message-ID: <1624141523.4.0.557016380209.issue44463@roundup.psfhosted.org> New submission from Chris Wagner : In 3.8 the samesite attributes was added to http.cookies module. However it hasn't been added to http.cookiejar module. The method: _normalized_cookie_tuples seems to have a hardcoded list of allowable attributes. While the updated standard is still in draft stage (https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc6265bis/) samesite is widely implemented and used (Chrome added support in 2017). ---------- components: Library (Lib) messages: 396153 nosy: jwag956 priority: normal severity: normal status: open title: HTTP Cookiejar doesn't support samesite type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 19:43:36 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 19 Jun 2021 23:43:36 +0000 Subject: [issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh In-Reply-To: <1624083746.4.0.9882241408.issue44459@roundup.psfhosted.org> Message-ID: <1624146216.54.0.387566005073.issue44459@roundup.psfhosted.org> Jason R. Coombs added the comment: I submitted https://github.com/brechtm/rinohtype/pull/270 to address the issue in rinohtype. Please feel free to reopen and address the questions posed above if appropriate. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 19:58:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 23:58:01 +0000 Subject: [issue17359] Mention "__main__.py" explicitly in command line docs In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1624147081.27.0.936879885052.issue17359@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue39452. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 19:59:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 19 Jun 2021 23:59:34 +0000 Subject: [issue24632] Improve documentation about __main__.py In-Reply-To: <1436856841.67.0.538500952598.issue24632@psf.upfronthosting.co.za> Message-ID: <1624147174.06.0.606194642276.issue24632@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue39452 and Issue17359. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 20:00:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 00:00:52 +0000 Subject: [issue24632] Improve documentation about __main__.py In-Reply-To: <1436856841.67.0.538500952598.issue24632@psf.upfronthosting.co.za> Message-ID: <1624147252.34.0.728886076116.issue24632@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 20:00:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 00:00:56 +0000 Subject: [issue17359] Mention "__main__.py" explicitly in command line docs In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1624147256.25.0.0295840614144.issue17359@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 20:00:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 00:00:25 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624147225.21.0.353202365786.issue39452@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue24632 and Issue17359. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 20:00:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 00:00:48 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624147248.72.0.961764192311.issue39452@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 20:14:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 00:14:45 +0000 Subject: [issue36621] shutil.rmtree follows junctions on windows In-Reply-To: <1555101345.3.0.431387403068.issue36621@roundup.psfhosted.org> Message-ID: <1624148085.45.0.248526948807.issue36621@roundup.psfhosted.org> Irit Katriel added the comment: The documentation for rmtree[1] now says: Changed in version 3.8: On Windows, will no longer delete the contents of a directory junction before removing the junction. So I think this issue can be closed. [1] https://docs.python.org/3/library/shutil.html#shutil.rmtree ---------- nosy: +iritkatriel resolution: -> out of date status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 21:48:38 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Jun 2021 01:48:38 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) Message-ID: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> New submission from Jason R. Coombs : importlib_metadata 4.5 (https://importlib-metadata.readthedocs.io/en/latest/history.html#v4-5-0) removed the special exclusion for flake8 in the deprecation warning for deprecated interfaces in entry_points. For the same motivations there, do the same in importlib.metadata. ---------- assignee: jaraco components: Library (Lib) messages: 396159 nosy: jaraco priority: normal severity: normal status: open title: Remove flake8 exception for deprecation warning (importlib.metadata) versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 21:53:55 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 20 Jun 2021 01:53:55 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) In-Reply-To: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> Message-ID: <1624154035.36.0.835122977488.issue44464@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25388 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26807 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 22:21:31 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 20 Jun 2021 02:21:31 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624155691.41.0.995235053073.issue43476@roundup.psfhosted.org> Terry J. Reedy added the comment: The comment should be "# For 3rd party use. See issue 43476." Updates to the pypi url, now https://pypi.org/project/friendly/ should be recorded here on this issue. The undocumented name 'cache' is excluded from linecache.__all__ and therefore private. We use it at our own risk (which should be extremely minimal). I cannot think of anyway that adding another '<...>' pseudoname entry could hurt. The only possibility is adding another copy of an entry, but they are small. But are you sure that this is value for the key? We could instead make the pseudotext be anything we want, such as a serialized version of the exception instance itself, including the error line. Why reproduce the error instead of fetching it? (If you do reproduce, you have to make sure you use the same compile options.) ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 19 23:40:30 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 20 Jun 2021 03:40:30 +0000 Subject: [issue44465] html.escape can be used in a few places in the standard lib instead of similar existing code Message-ID: <1624160430.21.0.153812631131.issue44465@roundup.psfhosted.org> New submission from Andrei Kulakov : There are a few places where old code does essentially the same thing as `html.escape()`, and can be replaced with html.escape(): - more readable - less error prone on refactorings - will benefit if html.escape() performance is improved in the future - will be easier to grep for in case in the future html.escape() is enhanced with new escapes & it will be useful to consider applying it to all instances where it is used. Here's what I found: https://github.com/python/cpython/blob/main/Lib/difflib.py#L1914 https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/plistlib.py#L158 https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/pydoc.py#L525 https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/dom/minidom.py#L306 (^ keep existing escape of double quote) https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/sax/saxutils.py#L27 https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xmlrpc/client.py#L149 I can add a PR if this sounds good. ---------- components: Library (Lib) messages: 396161 nosy: andrei.avk priority: normal severity: normal status: open title: html.escape can be used in a few places in the standard lib instead of similar existing code type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 01:15:37 2021 From: report at bugs.python.org (Ofek Kirzner) Date: Sun, 20 Jun 2021 05:15:37 +0000 Subject: [issue44371] asyncio.wait_for does not cancel running tasks in the correct fashion In-Reply-To: <1623304558.86.0.995602779591.issue44371@roundup.psfhosted.org> Message-ID: <1624166137.76.0.527159317683.issue44371@roundup.psfhosted.org> Ofek Kirzner added the comment: Kindly reminder. Thx :) ---------- resolution: -> remind _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 02:34:47 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 20 Jun 2021 06:34:47 +0000 Subject: [issue36621] shutil.rmtree follows junctions on windows In-Reply-To: <1555101345.3.0.431387403068.issue36621@roundup.psfhosted.org> Message-ID: <1624170887.78.0.113140506591.issue36621@roundup.psfhosted.org> Eryk Sun added the comment: Yes, this issue is out of date. shutil._rmtree_isdir() and shutil._rmtree_islink() were added to handle mount points (i.e. junctions) as if they're symlinks. More generally, junctions and symlinks are what the platform refers to as name-surrogate reparse points. This category isn't handled generically by rmtree(). It wouldn't be hard to generalize the implementation, but that's something for a new issue. ---------- nosy: +eryksun stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 03:10:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 20 Jun 2021 07:10:15 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624173015.98.0.931944558425.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: I think this should be good now. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 03:10:44 2021 From: report at bugs.python.org (Russell Keith-Magee) Date: Sun, 20 Jun 2021 07:10:44 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624173044.1.0.272620765917.issue44458@roundup.psfhosted.org> Change by Russell Keith-Magee : ---------- keywords: +patch pull_requests: +25389 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26808 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 04:21:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Jun 2021 08:21:10 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624177270.68.0.149312402671.issue12022@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25391 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26809 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 04:21:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Jun 2021 08:21:44 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624177304.29.0.344508373168.issue12022@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 04:23:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 20 Jun 2021 08:23:21 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624177401.31.0.36092254688.issue12022@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 26809 makes "with" and "async with" raising TypeError instead of AttributeError for wrong types. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 05:36:04 2021 From: report at bugs.python.org (Andre Roberge) Date: Sun, 20 Jun 2021 09:36:04 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624181764.65.0.240215319399.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: I just thought of making a copy of the file content under a known name as the least disruptive approach for IDLE's code - even less so than the recent addition required to support user-defined exception hooks. For SyntaxErrors and subclasses [1], Friendly needs the source code as well as the error message, offset, lineno (end_offset and end_lineno if they are present) in order to perform its analysis. In all cases (i.e not only with IDLE but with other environments like Jupyter notebooks), it retrieves this source code from the given filename using the linecache module. If it were possible to get those exception arguments using RPC, this would be much better than what I suggested. This might also be much more useful that what I suggest for any third-party code wanting access to the traceback information for SyntaxErrors. However, I could not find a simple way of doing this. [1] The required information for run-time errors, such as NameError, etc., is already available with sys.excepthook. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 07:07:04 2021 From: report at bugs.python.org (Noam) Date: Sun, 20 Jun 2021 11:07:04 +0000 Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition) In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za> Message-ID: <1624187224.37.0.677456056213.issue29699@roundup.psfhosted.org> Noam added the comment: Is this still alive? If decided to decline PR why is this still open? ---------- nosy: +noamda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 07:55:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 11:55:54 +0000 Subject: [issue1207466] installer ignores changed installation directory Message-ID: <1624190154.72.0.370156284728.issue1207466@roundup.psfhosted.org> Irit Katriel added the comment: Did Terry remove 3.1 because this is only relevant to python 2? Is this resolved/obsolete by now? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 07:56:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 11:56:48 +0000 Subject: [issue1207466] installer ignores changed installation directory Message-ID: <1624190208.65.0.769507150724.issue1207466@roundup.psfhosted.org> Irit Katriel added the comment: Ah I see 3.2 is still there, so it's wasn't just a python 2 issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:00:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:00:21 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1624197621.49.0.636956543917.issue41546@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 9.0 -> 10.0 pull_requests: +25392 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26810 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:02:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:02:01 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1624197721.38.0.72785178113.issue41546@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:07:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:07:59 +0000 Subject: [issue24501] configure does not find (n)curses in /usr/local/libs In-Reply-To: <1435164904.34.0.98182021259.issue24501@psf.upfronthosting.co.za> Message-ID: <1624198079.04.0.0836553680433.issue24501@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this was reported for 2.7 and there has been no followup since. If you are still seeing this problem with a current version (>= 3.9), please create a new issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:20:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:20:26 +0000 Subject: [issue21482] get_versions() in cygwinccomiler.py cannot return correct gcc version In-Reply-To: <1399910940.73.0.452990357342.issue21482@psf.upfronthosting.co.za> Message-ID: <1624198826.02.0.876826453263.issue21482@roundup.psfhosted.org> Irit Katriel added the comment: Closing as this is part of distutils which is deprecated now. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:27:21 2021 From: report at bugs.python.org (Carl Schaefer) Date: Sun, 20 Jun 2021 14:27:21 +0000 Subject: [issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used In-Reply-To: <1359599707.26.0.771342463799.issue17088@psf.upfronthosting.co.za> Message-ID: <1624199241.7.0.954973053731.issue17088@roundup.psfhosted.org> Change by Carl Schaefer : ---------- nosy: +carlschaefer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:35:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:35:05 +0000 Subject: [issue30238] 2to3 doesn't detect or fix Exception indexing In-Reply-To: <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za> Message-ID: <1624199705.79.0.0239037848115.issue30238@roundup.psfhosted.org> Irit Katriel added the comment: There is no way to know through static analysis that the subscript is on an object of type exception. I think this should be closed as won't fix. ---------- nosy: +iritkatriel resolution: -> wont fix status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:37:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:37:47 +0000 Subject: [issue31314] email throws exception with oversized header input In-Reply-To: <1504175392.51.0.871887341171.issue31314@psf.upfronthosting.co.za> Message-ID: <1624199867.5.0.48004868528.issue31314@roundup.psfhosted.org> Irit Katriel added the comment: This is working now: >>> import sys, email >>> mail = email.message_from_string( ... """From: ... To: ... Subject: demo ... X-Overlong-Header-Name-causes-python-mail-to-crash-in-re-serialization-example: ... ... Hello ... """) >>> >>> mail >>> message = mail.as_string() >>> sys.stdout.write(message) From: To: Subject: demo X-Overlong-Header-Name-causes-python-mail-to-crash-in-re-serialization-example: Hello 158 >>> ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:48:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 20 Jun 2021 14:48:53 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1624200533.69.0.905851090906.issue33213@roundup.psfhosted.org> Andrei Kulakov added the comment: How about adding a check to `crypt.mksalt()`: if method and method not in methods: raise ValueError(f'method {method} is not supported') If a method is supplied to `crypt.crypt()`, mksalt() is called with it as an arg, so adding this check will take care of both paths: crypt(val, method) crypt(val, mksalt(method)) the only remaining issue is if an (improperly generated) salt is loaded from somewhere and used to call `crypt()`, but the check above fixes most of the issue. I can put up a PR if this sounds good. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:54:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 20 Jun 2021 14:54:03 +0000 Subject: [issue33213] crypt function not hashing properly on Mac (uses a specific salt) In-Reply-To: <1522744018.72.0.467229070634.issue33213@psf.upfronthosting.co.za> Message-ID: <1624200843.86.0.59963146047.issue33213@roundup.psfhosted.org> Andrei Kulakov added the comment: Actually it should be: if method is not None and method not in methods: ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:54:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:54:37 +0000 Subject: [issue37260] shutil.rmtree() FileNotFoundError race condition In-Reply-To: <1560388241.37.0.285109327745.issue37260@roundup.psfhosted.org> Message-ID: <1624200877.73.0.0601132455079.issue37260@roundup.psfhosted.org> Irit Katriel added the comment: see also issue29699 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 10:54:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 14:54:39 +0000 Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition) In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za> Message-ID: <1624200879.59.0.899655015644.issue29699@roundup.psfhosted.org> Irit Katriel added the comment: seel also issue37260 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 11:11:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 20 Jun 2021 15:11:01 +0000 Subject: [issue44310] Document that lru_cache uses hard references In-Reply-To: <1622807158.12.0.225505300643.issue44310@roundup.psfhosted.org> Message-ID: <1624201861.9.0.774635737438.issue44310@roundup.psfhosted.org> Raymond Hettinger added the comment: Adding a weak referencing recipe here just so I can find it in the future. -------------------------------------------------------------------------- import functools import weakref def weak_lru(maxsize=128, typed=False): """LRU Cache decorator that keeps a weak reference to "self". Only provides benefit if the instances are so large that it is impractical to wait for them to age out of the cache. When the instance is freed, the cache entry still remains but will be unreachable. If new instances will be created that are equal to the ones retired by the weak reference, we lose all the benefits of having cached the previous call. If the class defines __slots__, be sure to add '__weakref__' to make the instances weak referenceable. """ def decorator(func): ref = weakref.ref @functools.lru_cache(maxsize, typed) def _func(_self, /, *args, **kwargs): return func(_self(), *args, **kwargs) @functools.wraps(func) def wrapper(self, /, *args, **kwargs): return _func(ref(self), *args, **kwargs) return wrapper return decorator ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 12:49:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 16:49:46 +0000 Subject: [issue5840] "Thread State and the Global Interpreter Lock" section of the docs doesn't cover TLS APIs In-Reply-To: <1240664318.91.0.855784600353.issue5840@psf.upfronthosting.co.za> Message-ID: <1624207786.45.0.465433083845.issue5840@roundup.psfhosted.org> Irit Katriel added the comment: Indeed, this API was deprecated in 3.7: https://docs.python.org/3/c-api/init.html#thread-local-storage-tls-api ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:02:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 17:02:21 +0000 Subject: [issue24907] Module location load order is not respected if pkg_resources is imported and a namespace is declared In-Reply-To: <1440152333.17.0.123323582496.issue24907@psf.upfronthosting.co.za> Message-ID: <1624208541.14.0.541628967964.issue24907@roundup.psfhosted.org> Irit Katriel added the comment: 2.7 is past EOL and I could not reproduce this on a current python version. Please create a new issue if you are still having a problem with this on 3.9+. PS C:\Users\User\src\cpython-dev> .\python.bat Running Release|x64 interpreter... Python 3.11.0a0 (heads/main-dirty:09eb817115, Jun 20 2021, 16:50:29) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> with open('json/__init__.py', 'w') as f: ... f.write("__import__('pkg_resources').declare_namespace(__name__); print('test')") ... 70 >>> quit() PS C:\Users\User\src\cpython-dev> python -c 'import json; print( json.__file__)' Running Release|x64 interpreter... test C:\Users\User\src\cpython-dev\json\__init__.py ---------- nosy: +iritkatriel resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:14:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 17:14:48 +0000 Subject: [issue29479] httplib: could not skip "ACCEPT-ENCODING" header In-Reply-To: <1486549140.01.0.111970837226.issue29479@psf.upfronthosting.co.za> Message-ID: <1624209288.85.0.348763925238.issue29479@roundup.psfhosted.org> Irit Katriel added the comment: As Martin has stated, this can be achieved with putrequest as explained in the doc: https://docs.python.org/3.10/library/http.client.html#http.client.HTTPConnection.putrequest ---------- nosy: +iritkatriel resolution: -> not a bug stage: test needed -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:21:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 17:21:42 +0000 Subject: [issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header In-Reply-To: <1408502977.94.0.555848371144.issue22231@psf.upfronthosting.co.za> Message-ID: <1624209702.94.0.611755299377.issue22231@roundup.psfhosted.org> Irit Katriel added the comment: This looks like a 2.7-only issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:27:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 17:27:30 +0000 Subject: [issue16328] win_add2path.py sets wrong user path In-Reply-To: <1351255282.63.0.930970476961.issue16328@psf.upfronthosting.co.za> Message-ID: <1624210050.86.0.864101321069.issue16328@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:29:39 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 20 Jun 2021 17:29:39 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624210179.51.0.667358175299.issue38291@roundup.psfhosted.org> Ken Jin added the comment: Hello Sebastian, the tests are failing on the Azure pipelines buildbot running appx tests: https://dev.azure.com/Python/cpython/_build/results?buildId=82827&view=logs&j=0fcf9c9b-89fc-526f-8708-363e467e119e&t=fa5ef4ee-3911-591e-4444-19482ab189b7 I suspect it's the same problem as this issue: https://bugs.python.org/issue44451 Sending a PR shortly to test if that fixes it. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:29:56 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 20 Jun 2021 17:29:56 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624210196.18.0.14234591635.issue38291@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25393 pull_request: https://github.com/python/cpython/pull/26811 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:30:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 17:30:54 +0000 Subject: [issue16328] win_add2path.py sets wrong user path In-Reply-To: <1351255282.63.0.930970476961.issue16328@psf.upfronthosting.co.za> Message-ID: <1624210254.57.0.515668289722.issue16328@roundup.psfhosted.org> Irit Katriel added the comment: I've refreshed the version as neither the patch was applied nor was the bug mentioned in msg239074 fixed so far. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 13:35:30 2021 From: report at bugs.python.org (Noam) Date: Sun, 20 Jun 2021 17:35:30 +0000 Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition) In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za> Message-ID: <1624210530.27.0.856067167004.issue29699@roundup.psfhosted.org> Noam added the comment: Hi Irit, Sorry, I'm still not following, The other issue you stated, states that PR is ready(06-2019), and this was in 2019, is this going to be fixed? or declined (and both should be closed)? What is the current updated status? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 14:18:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 18:18:04 +0000 Subject: [issue29699] shutil.rmtree should not fail with FileNotFoundError (race condition) In-Reply-To: <1488481944.03.0.0307704051627.issue29699@psf.upfronthosting.co.za> Message-ID: <1624213084.58.0.0443466359277.issue29699@roundup.psfhosted.org> Irit Katriel added the comment: PR13580 was not declined, the reviewer requested unit tests. If you want to advance this, perhaps you can help fill that in. The other PR looks like a duplicate that should be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 14:59:35 2021 From: report at bugs.python.org (E. Paine) Date: Sun, 20 Jun 2021 18:59:35 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624215575.14.0.430487437807.issue44404@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch pull_requests: +25394 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26812 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:21:07 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 20 Jun 2021 19:21:07 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1624216867.54.0.37625009197.issue43066@roundup.psfhosted.org> Andrei Kulakov added the comment: I propose fixing this in documentation. Raising an error is probably not warranted because zip files are often created on one system and used on another, so you can't raise an error based on current OS, and having a leading slash in the name is both useful and does work in MacOS and Unix. It probably works in some unzip programs on Windows as well (if anyone can test that would be great). Therefore I propose adding the following notes to ZipInfo, ZipFile.write() and ZipFile.writestr(): Note: a leading slash in the archive / filename may lead to the archive being un-openable in some zip programs on Windows systems. If that sounds good I can make a PR. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:24:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 19:24:03 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1624217043.98.0.0489844880098.issue40956@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 185ecdc1463c527743eeb16a5deef75c1985de79 by Erlend Egeberg Aasland in branch 'main': bpo-40956: Convert sqlite3.connect and sqlite3.Connection.__init__ to AC (GH-24421) https://github.com/python/cpython/commit/185ecdc1463c527743eeb16a5deef75c1985de79 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:24:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 19:24:35 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1624217075.58.0.24526673563.issue44087@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7d0a47e1affd0a2f56600f3e9473f55f931595bd by Erlend Egeberg Aasland in branch 'main': bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) https://github.com/python/cpython/commit/7d0a47e1affd0a2f56600f3e9473f55f931595bd ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:24:59 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Jun 2021 19:24:59 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1624217099.26.0.93995299407.issue44087@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25395 pull_request: https://github.com/python/cpython/pull/26813 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:26:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 19:26:46 +0000 Subject: [issue44430] [sqlite3] refactor threading tests In-Reply-To: <1623799349.31.0.598300171565.issue44430@roundup.psfhosted.org> Message-ID: <1624217206.41.0.682918781175.issue44430@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:26:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 19:26:43 +0000 Subject: [issue44430] [sqlite3] refactor threading tests In-Reply-To: <1623799349.31.0.598300171565.issue44430@roundup.psfhosted.org> Message-ID: <1624217203.62.0.454498174612.issue44430@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5f0fc30de46d41dccf04096df12664fc0a684ca2 by Erlend Egeberg Aasland in branch 'main': bpo-44430: Refactor `sqlite3` threading tests (GH-26748) https://github.com/python/cpython/commit/5f0fc30de46d41dccf04096df12664fc0a684ca2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 15:38:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 19:38:34 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1624217914.05.0.969734817374.issue40956@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Erlend, is anything left in this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:08:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 20:08:14 +0000 Subject: [issue44077] IP_RECVTOS option is missing from socket module In-Reply-To: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org> Message-ID: <1624219694.43.0.119415960826.issue44077@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a317778fd58b1c6b250feffbdb4ecf15e293ef48 by Georg Sauthoff in branch 'main': bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992) https://github.com/python/cpython/commit/a317778fd58b1c6b250feffbdb4ecf15e293ef48 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:08:25 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Jun 2021 20:08:25 +0000 Subject: [issue44077] IP_RECVTOS option is missing from socket module In-Reply-To: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org> Message-ID: <1624219705.55.0.966500266476.issue44077@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25396 pull_request: https://github.com/python/cpython/pull/26815 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:12:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 20:12:30 +0000 Subject: [issue41299] Python3 threading.Event().wait time is twice as large as Python27 In-Reply-To: <1594764957.86.0.842448865524.issue41299@roundup.psfhosted.org> Message-ID: <1624219950.39.0.396500699215.issue41299@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8673b77e251e42874501a47b1df86c6bde4fe1d2 by Miss Islington (bot) in branch '3.10': bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision time source (GH-26568) (GH-26580) https://github.com/python/cpython/commit/8673b77e251e42874501a47b1df86c6bde4fe1d2 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:12:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 20:12:16 +0000 Subject: [issue43667] Solaris: Fix broken Unicode encoding in non-UTF locales In-Reply-To: <1617099094.43.0.768783655635.issue43667@roundup.psfhosted.org> Message-ID: <1624219936.27.0.018669387607.issue43667@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f87d2038fadd9c067d50fb2f1d7c2f37b9f3893a by Miss Islington (bot) in branch '3.10': bpo-43667: Add news fragment for Solaris changes (GH-26405) (GH-26498) https://github.com/python/cpython/commit/f87d2038fadd9c067d50fb2f1d7c2f37b9f3893a ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:12:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 20:12:49 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1624219969.42.0.862881434824.issue43298@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5fbccb763ce540c0d07be86660e0357bffc69d76 by Miss Islington (bot) in branch '3.10': bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) (GH-26802) https://github.com/python/cpython/commit/5fbccb763ce540c0d07be86660e0357bffc69d76 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:24:28 2021 From: report at bugs.python.org (Maxwell Ballenger) Date: Sun, 20 Jun 2021 20:24:28 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection Message-ID: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> New submission from Maxwell Ballenger : I have been working on debugging a segfault. When faulthandler catches the fault, it makes a printout like this: Current thread 0x00007f4fa62b2700 (most recent call first): File "/usr/lib/python3.6/site-packages/tornado/ioloop.py", line 919, in call_at File "/usr/lib/python3.6/site-packages/tornado/ioloop.py", line 502, in add_timeout ... However, when I run the same app with gdb, catch the segfault with gdb and and run py-bt, it makes a printout like this (gdb) py-bt Traceback (most recent call first): Garbage-collecting File "/usr/lib/python3.6/site-packages/tornado/ioloop.py", line 919, in call_at functools.partial(stack_context.wrap(callback), *args, **kwargs), File "/usr/lib/python3.6/site-packages/tornado/ioloop.py", line 502, in add_timeout return self.call_at(deadline, callback, *args, **kwargs) ... The important distinction here for me is the "Garbage-collecting" line. When debugging this issue with faulthandler, I thought that the segfault was happening somewhere in the execution stack of this ioloop.py function. It wasn't until I ran under gdb that I realized it was actually happening in garbage collection and more or less has nothing to do with ioloop.py. It seems like faulthandler should be able to tell that the segfault was actually generated in garbage collection and this would make faulthandler much more helpful for cases like this. Thank you for reading! ---------- components: Library (Lib) messages: 396196 nosy: maxballenger priority: normal severity: normal status: open title: faulthandler should indicate if the fault happened in garbage collection type: enhancement versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:29:03 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 20 Jun 2021 20:29:03 +0000 Subject: [issue40956] Use Argument Clinic in sqlite3 In-Reply-To: <1591956335.72.0.553737405887.issue40956@roundup.psfhosted.org> Message-ID: <1624220943.62.0.122077429517.issue40956@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Erlend, is anything left in this issue? Nothing left; thank you for your guidance and reviews, Dong-hee, Berker, Serhiy, and Pablo. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:36:29 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 20 Jun 2021 20:36:29 +0000 Subject: [issue44077] IP_RECVTOS option is missing from socket module In-Reply-To: <1620485869.86.0.948839095965.issue44077@roundup.psfhosted.org> Message-ID: <1624221389.97.0.193995176286.issue44077@roundup.psfhosted.org> miss-islington added the comment: New changeset 28fe0159f59a761bf52c1999c8f7cb12d0d12562 by Miss Islington (bot) in branch '3.10': bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992) https://github.com/python/cpython/commit/28fe0159f59a761bf52c1999c8f7cb12d0d12562 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:40:39 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sun, 20 Jun 2021 20:40:39 +0000 Subject: [issue44467] profiling-compatible functools.wraps Message-ID: <1624221639.17.0.239071642719.issue44467@roundup.psfhosted.org> New submission from Anthony Sottile : this is a small proposal to add a new function to the functools module which provides better profiling-compatible `@functools.wraps(...)` the rationale comes from https://github.com/Yelp/named_decorator (which is dead / abandoned) the tl;dr from there is any time a decorator is involved in a profile it becomes very difficult to trace because everything becomes tangled around common decorators (because function names are used from the code object) here is the proposal and an initial implementation: def wraps_with_name(func, decorator, **kwargs): def wraps_with_name_decorator(wrapped): new_name = f'{func.__name__}@{decorator.__name__}' new_code = wrapped.__code__.replace(co_name=new_name) # would be nice if `types.FunctionType` had a `.replace(...)` too! new_wrapped = types.FunctionType( new_code, wrapped.__globals__, new_name, wrapped.__defaults__, wrapped.__closure__, ) return functools.wraps(func, **kwargs)(new_wrapped) return better_wraps_decorator the usage would be similar to `functools.wraps`, here is an example: ```python def my_decorator(func): @functools.wraps_with_name(func, my_decorator) def my_decorator_inner(*args, **kwargs): return func(*args, **kwargs) return my_decorator ``` ---------- components: Library (Lib) messages: 396199 nosy: Anthony Sottile priority: normal severity: normal status: open title: profiling-compatible functools.wraps type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 16:47:53 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 20 Jun 2021 20:47:53 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1624222073.22.0.159931772904.issue44087@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25397 pull_request: https://github.com/python/cpython/pull/26816 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 17:01:25 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 20 Jun 2021 21:01:25 +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: <1624222885.77.0.746283935219.issue43916@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, bpo-44087 added the Py_TPFLAGS_DISALLOW_INSTANTIATION flag to sqlite3.Statement. (Side note: I find the issue title a little bit confusing.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 17:07:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 21:07:41 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1624223261.91.0.299103290048.issue44087@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ccc95c7b4799570c2d7e4de3d579860ad833e1f8 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) (GH-26816) https://github.com/python/cpython/commit/ccc95c7b4799570c2d7e4de3d579860ad833e1f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 17:29:55 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 20 Jun 2021 21:29:55 +0000 Subject: [issue44087] [sqlite3] consider adding Py_TPFLAGS_DISALLOW_INSTANTIATION to sqlite3.Statement In-Reply-To: <1620548889.46.0.572288085506.issue44087@roundup.psfhosted.org> Message-ID: <1624224595.01.0.013871689474.issue44087@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 Sun Jun 20 18:57:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 22:57:55 +0000 Subject: [issue44467] profiling-compatible functools.wraps In-Reply-To: <1624221639.17.0.239071642719.issue44467@roundup.psfhosted.org> Message-ID: <1624229875.48.0.998401065554.issue44467@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 18:59:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 20 Jun 2021 22:59:12 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624229952.27.0.511681963704.issue44466@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: faulthandler has no access to the C-stack so it cannot see the gc_collect_main() as gdb does. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 19:05:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 20 Jun 2021 23:05:01 +0000 Subject: [issue3276] httplib.HTTPConnection._send_request should not blindly assume dicts for headers In-Reply-To: <1215130769.47.0.0230905543783.issue3276@psf.upfronthosting.co.za> Message-ID: <1624230301.61.0.978760927261.issue3276@roundup.psfhosted.org> Irit Katriel added the comment: Indeed, as Terry wrote the assumption is that header is a mapping (not necessarily a dict). It is not hard to implement a Multimap that has this API: import collections.abc class Multimap(collections.abc.Mapping): def __init__(self): self.data = collections.defaultdict(list) def __getitem__(self, key): return self.data[key] def __setitem__(self, key, value): self.data[key].append(value) def __iter__(self): yield from self.data def items(self): for k in list(self.data.keys()): for v in list(self.data[k]): yield (k,v) def __len__(self): return sum([len(v) for v in self.data.values()]) mm = Multimap() mm['1'] = 'a' mm['1'] = 'aa' mm['1'] = 'aaa' mm['2'] = 'b' mm['3'] = 'c' mm['3'] = 'cc' print(f'len = {len(mm)}') print(f'mm.items() = {list(mm.items())}') Output: len = 6 mm.items() = [('1', 'a'), ('1', 'aa'), ('1', 'aaa'), ('2', 'b'), ('3', 'c'), ('3', 'cc')] ---------- nosy: +iritkatriel resolution: out of date -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 20:01:33 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 21 Jun 2021 00:01:33 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624233693.01.0.134606203799.issue44466@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 22:58:08 2021 From: report at bugs.python.org (Jacob Walls) Date: Mon, 21 Jun 2021 02:58:08 +0000 Subject: [issue44455] compileall should exit nonzero for nonexistent directories In-Reply-To: <1624049977.61.0.207716246546.issue44455@roundup.psfhosted.org> Message-ID: <1624244288.7.0.813527088236.issue44455@roundup.psfhosted.org> Change by Jacob Walls : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 20 23:45:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 03:45:57 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624247157.18.0.430858880121.issue43476@roundup.psfhosted.org> Terry J. Reedy added the comment: What I am proposing that pseudofile have one line representing a tuple with all the exception information, *including the filename* for the code with the error. In Shell, the filename will usually be another pseudofile name, . The latter are set with def stuffsource(self, source): "Stuff source in the filename cache" filename = "" % self.gid self.gid = self.gid + 1 lines = source.split("\n") linecache.cache[filename] = len(source)+1, 0, lines, filename return filename I think the +1 is for a '\n' that will be appended. The linecache line is otherwise our model. The following is how I created a line while testing. try: compile('a b', '', 'single') except SyntaxError as e: err = str((type(e).__name__, e.args[0], *e.args[1]))+'\n' err will be the single line for the file: "('SyntaxError', 'invalid syntax. Perhaps you forgot a comma?', '', 1, 1, 'a b', 1, 4)" For the patch, err would can be calculated a little differently further down in showsyntaxerror (which needs updating). Then set the cache with linecache.cache[""] = (len(err), 0, [err], "") --- In friendly, retrieve the lines and unpack the evaluated tuple (\n at the end is ok). exception, message, filename, line, col, text, line_end, col_end = eval(lines[0]) Use filename to retrieve the error code lines as you wish. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 00:11:39 2021 From: report at bugs.python.org (Will Chen) Date: Mon, 21 Jun 2021 04:11:39 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? Message-ID: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> New submission from Will Chen : An issue was recently closed that caused synthetic classes and base classes with invalid `__module__` attributes to raise `KeyError()` in `typing.get_type_hints()`: https://bugs.python.org/issue41515 However, the implemented solution appears to be to skip those classes completely with a `continue` statement, instead of getting the annotations that may still be present by using an empty globals dictonary: https://github.com/python/cpython/pull/25352/files#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887 In order to work around this issue in my local install of Blender, I had to change `.get_type_hints()` to use an empty dictionary for `globalns` when encountering invalid modules, rather than skipping them: https://developer.blender.org/T88986#1179812 >From reading the commit where the broken behaviour was first introduced? Which was described/designed as "backwards compatible"? It looks like the original behaviour was also to use an empty dictionary, and never skip: https://github.com/python/cpython/commit/f350a268a7071ce7d7a5bb86a9b1229782d4963b#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887R1501 Using an empty dictionary also seemed to be mentioned in the bug report linked above. IMO using an empty dictionary and still returning annotations from classes with invalid modules seems like it'd be more sensible, predictable, and backwards-compatible, while skipping base classes is likely to just replace the obvious `KeyError()` with less reproducible and nastier errors caused by returning incomplete type hints. ---------- messages: 396205 nosy: willchencontact priority: normal severity: normal status: open title: Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 00:12:00 2021 From: report at bugs.python.org (Cameron Simpson) Date: Mon, 21 Jun 2021 04:12:00 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624248720.83.0.48586297649.issue39452@roundup.psfhosted.org> Change by Cameron Simpson : ---------- nosy: +cameron _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 00:12:40 2021 From: report at bugs.python.org (Cameron Simpson) Date: Mon, 21 Jun 2021 04:12:40 +0000 Subject: [issue24632] Improve documentation about __main__.py In-Reply-To: <1436856841.67.0.538500952598.issue24632@psf.upfronthosting.co.za> Message-ID: <1624248760.97.0.705685544818.issue24632@roundup.psfhosted.org> Change by Cameron Simpson : ---------- nosy: +cameron _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 00:12:55 2021 From: report at bugs.python.org (Cameron Simpson) Date: Mon, 21 Jun 2021 04:12:55 +0000 Subject: [issue17359] Mention "__main__.py" explicitly in command line docs In-Reply-To: <1362512425.64.0.937549165034.issue17359@psf.upfronthosting.co.za> Message-ID: <1624248775.7.0.386233739598.issue17359@roundup.psfhosted.org> Change by Cameron Simpson : ---------- nosy: +cameron _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 01:38:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 05:38:29 +0000 Subject: [issue44469] Fix tests for "async with" Message-ID: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> New submission from Serhiy Storchaka : In Lib/test/test_coroutines.py some tests test that the body of the "asyn with" statement with bad context manager was not executed by setting a value of a variable in the body and checking its value after executing. body_executed = False async def foo(): async with CM(): body_executed = True with self.assertRaisesRegex(AttributeError, '__aexit__'): run_async(foo()) self.assertFalse(body_executed) The problem is that it sets the value of local variable of the inner function, and does not affect the outer variable. The test would pass even if the body was executed. ---------- components: Tests messages: 396206 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fix tests for "async with" type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 01:43:11 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 05:43:11 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624254191.52.0.0306985792934.issue44469@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25398 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26817 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 02:52:35 2021 From: report at bugs.python.org (Samuel Marks) Date: Mon, 21 Jun 2021 06:52:35 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? Message-ID: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> New submission from Samuel Marks : It's been too long since my family have been Polish! (see screenshot of https://docs.python.org/3.11/library/parser.html ) My computer is only configured for English. Running Firefox 90.0b9 (64-bit) on macOS 11.4 (20F71). ---------- assignee: docs at python components: Documentation files: Screen Shot 2021-06-21 at 4.49.27 pm.png messages: 396207 nosy: docs at python, samuelmarks priority: normal severity: normal status: open title: 3.11 docs.python.org in Polish not English? type: behavior versions: Python 3.11 Added file: https://bugs.python.org/file50122/Screen Shot 2021-06-21 at 4.49.27 pm.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:22:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 07:22:07 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624260127.26.0.869277010607.issue44469@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 5d2b3a0d688cf8a33db3d266c9e7049c13766a4c by Serhiy Storchaka in branch 'main': bpo-44469: Fix tests for "async with" with bad object (GH-26817) https://github.com/python/cpython/commit/5d2b3a0d688cf8a33db3d266c9e7049c13766a4c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:22:20 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 07:22:20 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624260140.51.0.167618303114.issue44469@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25400 pull_request: https://github.com/python/cpython/pull/26819 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:22:15 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 07:22:15 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624260135.25.0.381248843634.issue44469@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25399 pull_request: https://github.com/python/cpython/pull/26818 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:43:53 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 07:43:53 +0000 Subject: [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument Message-ID: <1624261433.34.0.758010123752.issue44471@roundup.psfhosted.org> New submission from Serhiy Storchaka : For consistency with the "with" statement (see issue12022) ExitStack.enter_context() should raise TypeError instead of AttributeError if the argument is not a context manager. Same for AsyncExitStack.enter_async_context(). ---------- components: Library (Lib) messages: 396209 nosy: ncoghlan, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Raise TypeError in ExitStack.enter_context() for bad argument type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:52:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 07:52:43 +0000 Subject: [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument In-Reply-To: <1624261433.34.0.758010123752.issue44471@roundup.psfhosted.org> Message-ID: <1624261963.62.0.637455726653.issue44471@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25401 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26820 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:53:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 07:53:47 +0000 Subject: [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument In-Reply-To: <1624261433.34.0.758010123752.issue44471@roundup.psfhosted.org> Message-ID: <1624262027.39.0.908241498795.issue44471@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +AttributeError should report the same details when raised by lookup_special() as when raised in the REPL _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:54:11 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 07:54:11 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624262051.87.0.204865932145.issue44469@roundup.psfhosted.org> miss-islington added the comment: New changeset 175e264d363164c905b08688bbda751c9ff26342 by Miss Islington (bot) in branch '3.9': bpo-44469: Fix tests for "async with" with bad object (GH-26817) https://github.com/python/cpython/commit/175e264d363164c905b08688bbda751c9ff26342 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:57:11 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 07:57:11 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624262231.42.0.751020636829.issue44469@roundup.psfhosted.org> miss-islington added the comment: New changeset 553e10498ac2020e9abdb5302c91bfb235925cef by Miss Islington (bot) in branch '3.10': bpo-44469: Fix tests for "async with" with bad object (GH-26817) https://github.com/python/cpython/commit/553e10498ac2020e9abdb5302c91bfb235925cef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 03:58:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 07:58:34 +0000 Subject: [issue44469] Fix tests for "async with" In-Reply-To: <1624253909.65.0.82466833877.issue44469@roundup.psfhosted.org> Message-ID: <1624262314.24.0.277054365873.issue44469@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 Jun 21 04:03:42 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 21 Jun 2021 08:03:42 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624262622.67.0.00811624754682.issue44470@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: I can confirm it looks the same to me, and I have never said Polish in my browser et cetera, so I assume this is the same for everyone. ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 04:27:12 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 21 Jun 2021 08:27:12 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624264032.08.0.871009937988.issue44470@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: It seems to affect 3.10 as well and other languages (French seems to show a variety fo languages) ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 05:06:23 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 21 Jun 2021 09:06:23 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624266383.5.0.593838236794.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: Having a fake file with a single line containing all the exception information as described would definitely provide all the required information needed. It would be much better than what I had suggested previously. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 05:24:46 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 21 Jun 2021 09:24:46 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624267486.3.0.0938554448414.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: Unless I am mistaken, when compiling the code, both SyntaxError and OverflowError instances are caught at the same stage, and likely passed on to showsyntaxerror. For OverflowError, e.args is not normally a tuple but a string, and *e.args[1] would raise an exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 05:55:30 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 09:55:30 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624269330.14.0.805779402511.issue44297@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 82e5c28af7049c4f5343c808f172cbe2e145f49b by Mark Shannon in branch 'main': bpo-44297: Fix missing line number in generator expressions (GH-26801) https://github.com/python/cpython/commit/82e5c28af7049c4f5343c808f172cbe2e145f49b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:01:14 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 21 Jun 2021 10:01:14 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624269674.29.0.605523217907.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: Thank you for fixing this, Ken, the PR looks good to me. Overall it looks as if the the Azure pipeline should be fixed, though. It's not ideal that the tests pass while running the PR, but not in other situations. Also, the warnings suppression is not really obvious. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:02:09 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 10:02:09 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624269729.44.0.692181187947.issue44297@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25402 pull_request: https://github.com/python/cpython/pull/26821 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:08:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 10:08:29 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624270109.71.0.305431495652.issue44450@roundup.psfhosted.org> Mark Shannon added the comment: I think this is a combination of https://bugs.python.org/issue44297 and the PREDICT macros. I don't have a windows machine to confirm this on, but I suspect that if you rewrite `doit` as: def doit(): o = ((1,2), (3,4)) o = (a for a in o) for tup in o: x = tup[0] y = tup[1] then you should be able to observe a difference between Windows and Mac on 3.9 as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:15:46 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 10:15:46 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624270546.31.0.0546876098384.issue38291@roundup.psfhosted.org> Ken Jin added the comment: > Overall it looks as if the the Azure pipeline should be fixed, though. It's not ideal that the tests pass while running the PR, but not in other situations. I agree. This specific test only seems to run *after* a commit is made. I don't see a way to run this test on a PR, even the `test-with-buildbots` test doesn't seem to trigger it. > Also, the warnings suppression is not really obvious. Yup, it's hidden away in the docs here, so I was rather lost too: https://docs.python.org/3/library/warnings.html#testing-warnings Anyways, I'm not actually sure that the PR will fix it. AFAICS, the only way to test it is to commit it and let the buildbot run ;). I can't reproduce it locally. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:18:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 21 Jun 2021 10:18:55 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set Message-ID: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> New submission from Pablo Galindo Salgado : Using lltrace results in this crash because we are getting the repl with an exception set: pop None Assertion failed: (!_PyErr_Occurred(tstate)), function PyObject_Repr, file Objects/object.c, line 431. pop Fatal Python error: Aborted Current thread 0x00000001060eddc0 (most recent call first): File "/Users/pgalindo3/github/cpython/Lib/test/test_sys_settrace.py", line 1999 in gen File "/Users/pgalindo3/github/cpython/Lib/test/test_sys_settrace.py", line 2001 in test_jump_from_yield File "/Users/pgalindo3/github/cpython/Lib/test/test_sys_settrace.py", line 1248 in run_test File "/Users/pgalindo3/github/cpython/Lib/test/test_sys_settrace.py", line 1276 in test File "/Users/pgalindo3/github/cpython/Lib/unittest/case.py", line 549 in _callTestMethod File "/Users/pgalindo3/github/cpython/Lib/unittest/case.py", line 592 in run File "/Users/pgalindo3/github/cpython/Lib/unittest/case.py", line 652 in __call__ File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 122 in run File "/Users/pgalindo3/github/cpython/Lib/unittest/suite.py", line 84 in __call__ File "/Users/pgalindo3/github/cpython/Lib/unittest/runner.py", line 176 in run File "/Users/pgalindo3/github/cpython/Lib/test/support/__init__.py", line 960 in _run_suite File "/Users/pgalindo3/github/cpython/Lib/test/support/__init__.py", line 1083 in run_unittest File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/runtest.py", line 210 in _test_module File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/main.py", line 423 in run_tests_sequential File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/main.py", line 521 in run_tests File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/main.py", line 694 in _main File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/main.py", line 641 in main File "/Users/pgalindo3/github/cpython/Lib/test/libregrtest/main.py", line 719 in main File "/Users/pgalindo3/github/cpython/Lib/test/__main__.py", line 2 in File "/Users/pgalindo3/github/cpython/Lib/runpy.py", line 86 in _run_code File "/Users/pgalindo3/github/cpython/Lib/runpy.py", line 196 in _run_module_as_main ---------- messages: 396220 nosy: pablogsal priority: normal severity: normal status: open title: ltrace functionality doesn't work if there is an exception set _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:20:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 21 Jun 2021 10:20:25 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set In-Reply-To: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> Message-ID: <1624270825.37.0.240968280043.issue44472@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25403 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:20:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 10:20:35 +0000 Subject: [issue37602] nonzero fixer problem In-Reply-To: <1563255027.06.0.811777029402.issue37602@roundup.psfhosted.org> Message-ID: <1624270835.05.0.76137287778.issue37602@roundup.psfhosted.org> Serhiy Storchaka added the comment: If no one going to provide documentation changes I propose to close this issue. ---------- nosy: +serhiy.storchaka status: open -> pending versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:26:55 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 10:26:55 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624271215.66.0.0541694058097.issue44468@roundup.psfhosted.org> Ken Jin added the comment: Will, I think what you say makes sense. @Guido / Ivan / Jelle What do you think? ---------- nosy: +Jelle Zijlstra, gvanrossum, kj, levkivskyi _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:33:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 10:33:34 +0000 Subject: [issue16321] Move eq.h out of stringlib In-Reply-To: <1351157379.02.0.714048258846.issue16321@psf.upfronthosting.co.za> Message-ID: <1624271614.82.0.269733534256.issue16321@roundup.psfhosted.org> Irit Katriel added the comment: Some of this cleanup was done but we still have unicode_eq in Objects/stringlib/eq.h which is only used in Objects/dictobject.c. ---------- keywords: +easy (C) -patch nosy: +iritkatriel versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:47:44 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 10:47:44 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624272464.7.0.531510155402.issue44297@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 7674c83d81905d6afe989ca3f93f08b7939b057c by Mark Shannon in branch '3.10': bpo-44297: Fix missing line number in generator expressions (GH-26821) https://github.com/python/cpython/commit/7674c83d81905d6afe989ca3f93f08b7939b057c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:49:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 10:49:02 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624272542.43.0.92650032035.issue44466@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25404 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26823 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:49:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 10:49:29 +0000 Subject: [issue44337] Port LOAD_ATTR to adaptive interpreter In-Reply-To: <1623089020.4.0.120322851148.issue44337@roundup.psfhosted.org> Message-ID: <1624272569.05.0.22674072572.issue44337@roundup.psfhosted.org> Mark Shannon added the comment: New changeset fb68791a26e157ed3cdeb409c8d8b6cddc7535bd by Mark Shannon in branch 'main': bpo-44337: Improve LOAD_ATTR specialization (GH-26759) https://github.com/python/cpython/commit/fb68791a26e157ed3cdeb409c8d8b6cddc7535bd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 06:49:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 10:49:37 +0000 Subject: [issue20109] TestProgram is mentioned in the unittest docs but is not documented In-Reply-To: <1388685707.72.0.688331916968.issue20109@psf.upfronthosting.co.za> Message-ID: <1624272577.81.0.883691504997.issue20109@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:13:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 11:13:22 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624274002.48.0.167544899387.issue44466@roundup.psfhosted.org> STINNER Victor added the comment: Maxwell: Oh, that's a good idea! I wrote PR 26823 to implement the feature. It's just 3 new lines in traceback.c :-) if (tstate == current_tstate && tstate->interp->gc.collecting) { PUTS(fd, " Garbage-collecting\n"); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:14:28 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 21 Jun 2021 11:14:28 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624274068.06.0.402532717752.issue44450@roundup.psfhosted.org> Ned Batchelder added the comment: I tried adding that rewritten doit as a new test, and it does not show a mac/win difference on 3.9. In fact, it doesn't show a mac/win difference on 3.10! https://github.com/nedbat/coveragepy/actions/runs/956791631 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:15:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 11:15:51 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624274151.43.0.0877817419507.issue44466@roundup.psfhosted.org> STINNER Victor added the comment: New changeset d19163912bfc790283724f05328bd31e4e65003d by Victor Stinner in branch 'main': bpo-44466: Faulthandler now detects the GC (GH-26823) https://github.com/python/cpython/commit/d19163912bfc790283724f05328bd31e4e65003d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:16:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 11:16:21 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624274181.81.0.718729369769.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 45a78f906d2d5fe5381d78466b11763fc56d57ba by Victor Stinner in branch 'main': bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) https://github.com/python/cpython/commit/45a78f906d2d5fe5381d78466b11763fc56d57ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:16:27 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 11:16:27 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624274187.26.0.625589800125.issue44434@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25405 pull_request: https://github.com/python/cpython/pull/26824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:18:23 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 11:18:23 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624274303.65.0.517965558333.issue44434@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25406 pull_request: https://github.com/python/cpython/pull/26825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:19:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 11:19:03 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1624274343.63.0.217711541814.issue44446@roundup.psfhosted.org> Mark Shannon added the comment: This appears to be a duplicate of https://bugs.python.org/issue44297 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:21:27 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 11:21:27 +0000 Subject: [issue44446] linecache.getline TypeError when formatting tracebacks in stacks containing an async list comprehension In-Reply-To: <1623955752.49.0.722717443318.issue44446@roundup.psfhosted.org> Message-ID: <1624274487.81.0.519021696362.issue44446@roundup.psfhosted.org> Mark Shannon added the comment: With the latest 3.10, I get: File "/home/mark/test/test.py", line 13, in next(bar().__await__(), None) File "/home/mark/test/test.py", line 10, in bar return [chunk async for chunk in foo()] File "/home/mark/test/test.py", line 10, in return [chunk async for chunk in foo()] File "/home/mark/test/test.py", line 6, in foo traceback.print_stack() working! Thomas, can you confirm? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:23:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 11:23:01 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624274581.92.0.0458082300573.issue44466@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25407 pull_request: https://github.com/python/cpython/pull/26826 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:31:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 21 Jun 2021 11:31:57 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624275117.57.0.84859230197.issue44450@roundup.psfhosted.org> Mark Shannon added the comment: Hmm, I'm a bit puzzled by that. Did you test with 3.10b3 or the latest build from the 3.10 branch with the fix to https://bugs.python.org/issue44297 included? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:38:32 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 21 Jun 2021 11:38:32 +0000 Subject: [issue44450] Generator expressions trace differently on Windows than on Mac In-Reply-To: <1624017004.2.0.445134128293.issue44450@roundup.psfhosted.org> Message-ID: <1624275512.09.0.141906389888.issue44450@roundup.psfhosted.org> Ned Batchelder added the comment: This was with 3.10.0b3. I haven't got a way (yet) to build with my own-built versions of CPython. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 07:57:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 11:57:39 +0000 Subject: [issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float? In-Reply-To: <1590657786.78.0.118668826809.issue40801@roundup.psfhosted.org> Message-ID: <1624276659.29.0.476694398996.issue40801@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25408 pull_request: https://github.com/python/cpython/pull/26827 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:00:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 12:00:00 +0000 Subject: [issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float? In-Reply-To: <1590657786.78.0.118668826809.issue40801@roundup.psfhosted.org> Message-ID: <1624276800.04.0.549935762686.issue40801@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 26827 is a draft for float.from_number() and complex.from_number(). ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:03:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 12:03:02 +0000 Subject: [issue21342] multiprocessing RLock and Lock raise incorrect exceptions when releasing an unlocked lock. In-Reply-To: <1398319251.34.0.871128764935.issue21342@psf.upfronthosting.co.za> Message-ID: <1624276982.52.0.619888274618.issue21342@roundup.psfhosted.org> Irit Katriel added the comment: The differences were documented under issue23484: https://github.com/python/cpython/commit/407c497e83b86011173fbf25e9a08b81adad5477 ---------- nosy: +iritkatriel resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> SemLock acquire() keyword arg 'blocking' is invalid _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:23:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:23:07 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624278187.14.0.85759921902.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 83ad40efc3e299d1e94692d958111a63c2fd6775 by Victor Stinner in branch '3.9': bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) (GH-26825) https://github.com/python/cpython/commit/83ad40efc3e299d1e94692d958111a63c2fd6775 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:23:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:23:17 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624278197.1.0.0706922001925.issue44466@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 9b0bbb9143d15507aae0ff3afeb05969178b306c by Victor Stinner in branch '3.10': bpo-44466: Faulthandler now detects the GC (GH-26823) (GH-26826) https://github.com/python/cpython/commit/9b0bbb9143d15507aae0ff3afeb05969178b306c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:23:47 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:23:47 +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: <1624278227.88.0.0859107565054.issue41682@roundup.psfhosted.org> STINNER Victor added the comment: This bug still occurs time to time on GitHub Actions. https://github.com/python/cpython/pull/26826/checks?check_run_id=2874631119 ====================================================================== FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving with self.assertRaises(ConnectionError): AssertionError: ConnectionError not raised ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:29:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:29:20 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624278560.96.0.373056641636.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 6614eac843c5dc0f4c2664ef610b81e556e44923 by Miss Islington (bot) in branch '3.10': bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) (GH-26824) https://github.com/python/cpython/commit/6614eac843c5dc0f4c2664ef610b81e556e44923 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:29:46 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:29:46 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624278586.72.0.330465158933.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: Ok, the issue is now fixed in 3.9, 3.10 and main branches. ---------- 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 Jun 21 08:38:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 12:38:14 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624279094.28.0.379887915756.issue44466@roundup.psfhosted.org> STINNER Victor added the comment: Maxwell: That was a nice idea and it's now added to Python 3.10 (will be part of the next Python 3.10 beta release)! I got an exception to land this feature in Python 3.10 even if we are past the feature freeze (see PR 26823 discussion). As explained in PR 26823, Py_FatalError() also gets this _Py_DumpTracebackThreads() enhancement ;-) See an example at: https://github.com/python/cpython/pull/26823#issuecomment-864950372 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 08:57:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 12:57:25 +0000 Subject: [issue23079] os.path.normcase documentation confusing In-Reply-To: <1418904131.32.0.416083778815.issue23079@psf.upfronthosting.co.za> Message-ID: <1624280245.28.0.464052707159.issue23079@roundup.psfhosted.org> Irit Katriel added the comment: This has been fixed by now: https://docs.python.org/3/library/os.path.html#os.path.normpath ---------- nosy: +iritkatriel resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:04:38 2021 From: report at bugs.python.org (=?utf-8?q?Kai_M=C3=BCller?=) Date: Mon, 21 Jun 2021 13:04:38 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected Message-ID: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> New submission from Kai M?ller : According to the docstring of logging.handlers.QueueHandler "The base implementation formats the record to merge the message and arguments, and removes unpickleable items from the record in-place." But, if a just a log message is used w/o any arguments, the arguments are still set to None, which IMHO unexpected. Especially, according to the typeshed project, the "args" is ALWAYS either a dict or a tuple. But in this case, they are set to None which surprised my a lot. Would it be possible to improve the docstring to state, that args, exc_info, exc_text are set to None and that msg is overwritten. If you miss this tiny but very important detail, additional handlers can act very wrong. In addition, it seems to be that the type information needs to be improved in typeshed or are there any other plans on your side? ---------- assignee: docs at python components: Documentation messages: 396243 nosy: docs at python, kai.jmueller priority: normal severity: normal status: open title: logging.handlers.QueueHandler acts unexpected 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 Mon Jun 21 09:24:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 13:24:42 +0000 Subject: [issue17537] csv.DictReader should fail if >1 column has the same name In-Reply-To: <1364159513.65.0.538891965028.issue17537@psf.upfronthosting.co.za> Message-ID: <1624281882.22.0.126665504383.issue17537@roundup.psfhosted.org> Irit Katriel added the comment: It's not hard to write a helper function that checks whether a csv has duplicated columns: def unique_cols(filename): cols = next(csv.reader(open(filename,'r'))) return len(cols) == len(set(cols)) >>> with open('x.csv', 'w') as f: ... f.write('foo,bar,foo\n1,2,3\n') ... >>> with open('y.csv', 'w') as f: ... f.write('foo,bar,baz\n1,2,3\n') ... >>> unique_cols('x.csv') False >>> unique_cols('y.csv') True ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:33:42 2021 From: report at bugs.python.org (Wel Griv) Date: Mon, 21 Jun 2021 13:33:42 +0000 Subject: [issue44474] inspect.getsourceslines() consider lambda of one line only Message-ID: <1624282422.28.0.515829011404.issue44474@roundup.psfhosted.org> New submission from Wel Griv : When lambda expression is more than one line or contain a line break, getsourcelines() from inspect package only return the first line. Code example: import inspect def foo(param, lambda_ref): _ = param print(str(inspect.getsourcelines(lambda_ref))) foo(param=0, lambda_ref=lambda: 40 + 2) output: ([' lambda_ref=lambda:\n'], 10) expected output: (['foo(lambda_ref=lambda:\n', ' 40 + 2)\n'], 10) `param` is not necessary to make the bug appears but makes more sense in a real use-case scenario. Beside, I checked the inspect.py code (see github: https://github.com/python/cpython/blob/3.9/Lib/inspect.py couldn't include link in the form for some reason), the guilty code is in the tokeneater() method in the BlockFinder class. A commentary explicitly mention "# lambdas always end at the first NEWLINE" (line 957 of inspect.py in python 3.9, line 1078 in python 3.10). EndOfBlock is raised after the first newline in case the block is a lambda. Moreover, a similar issue was raised, and closed for strange reason in python 2 back in 2013, see here: https://bugs.python.org/issue17631 ---------- components: Extension Modules, Library (Lib), Windows messages: 396245 nosy: Welgriv, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: inspect.getsourceslines() consider lambda of one line only type: behavior versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:49:22 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 13:49:22 +0000 Subject: [issue30966] Add multiprocessing.queues.SimpleQueue.close() In-Reply-To: <1500454402.66.0.425527808924.issue30966@psf.upfronthosting.co.za> Message-ID: <1624283362.27.0.325914494157.issue30966@roundup.psfhosted.org> Irit Katriel added the comment: This seems complete, can it be closed? ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:50:44 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Jun 2021 13:50:44 +0000 Subject: [issue30966] Add multiprocessing.queues.SimpleQueue.close() In-Reply-To: <1500454402.66.0.425527808924.issue30966@psf.upfronthosting.co.za> Message-ID: <1624283444.65.0.654230964823.issue30966@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- stage: patch review -> resolved status: pending -> closed type: -> resource usage _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:51:54 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Jun 2021 13:51:54 +0000 Subject: [issue30966] Add multiprocessing.queues.SimpleQueue.close() In-Reply-To: <1500454402.66.0.425527808924.issue30966@psf.upfronthosting.co.za> Message-ID: <1624283514.78.0.1623630354.issue30966@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- versions: +Python 3.10 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:59:12 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 13:59:12 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624283952.83.0.741005977059.issue44395@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25409 pull_request: https://github.com/python/cpython/pull/26828 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:59:10 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 21 Jun 2021 13:59:10 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624283950.92.0.0547703063299.issue44395@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 30f7a77f359a0fc6e37988b0f317a77a15d66b7b by Dong-hee Na in branch 'main': bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685) https://github.com/python/cpython/commit/30f7a77f359a0fc6e37988b0f317a77a15d66b7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 09:59:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 13:59:18 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624283958.53.0.953541094721.issue44395@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25410 pull_request: https://github.com/python/cpython/pull/26829 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 10:00:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 14:00:05 +0000 Subject: [issue30966] Add multiprocessing.queues.SimpleQueue.close() In-Reply-To: <1500454402.66.0.425527808924.issue30966@psf.upfronthosting.co.za> Message-ID: <1624284005.74.0.353986163689.issue30966@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 10:12:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 14:12:09 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1624284729.6.0.99200288927.issue26329@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 10:27:35 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 14:27:35 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624285655.75.0.394105813501.issue44395@roundup.psfhosted.org> miss-islington added the comment: New changeset 20a1495b8a93596b322ea19bb09008db036eb7e6 by Miss Islington (bot) in branch '3.10': bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685) https://github.com/python/cpython/commit/20a1495b8a93596b322ea19bb09008db036eb7e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 10:27:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 21 Jun 2021 14:27:56 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624285676.65.0.0352915018039.issue44395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 10:27:46 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 14:27:46 +0000 Subject: [issue44395] email.message as_string() not writing unixfrom In-Reply-To: <1623420926.37.0.619875341642.issue44395@roundup.psfhosted.org> Message-ID: <1624285666.25.0.61506498391.issue44395@roundup.psfhosted.org> miss-islington added the comment: New changeset 67b3a9995368f89b7ce4a995920b2a83a81c599b by Miss Islington (bot) in branch '3.9': bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685) https://github.com/python/cpython/commit/67b3a9995368f89b7ce4a995920b2a83a81c599b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:06:36 2021 From: report at bugs.python.org (Andrew C) Date: Mon, 21 Jun 2021 15:06:36 +0000 Subject: [issue44475] Dataclass Causes Infinite Recursion when using type of bytes Message-ID: <1624287996.71.0.124244983784.issue44475@roundup.psfhosted.org> New submission from Andrew C : Hello, When given a `Field` on a Dataclass, the `__repr__` throws an infinite recursive error when the data type is bytes. In the `Field` class, the __repr__ is as follows: ``` def __repr__(self): return ( 'Field(' f'name={self.name!r},' f'type={self.type!r},' f'default={self.default!r},' f'default_factory={self.default_factory!r},' f'init={self.init!r},' f'repr={self.repr!r},' f'hash={self.hash!r},' f'compare={self.compare!r},' f'metadata={self.metadata!r},' f'_field_type={self._field_type}' ')' ) ``` The issue is the f'type={self.type!r}, part of the code. ---------- components: Windows messages: 396250 nosy: andrewonboe, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Dataclass Causes Infinite Recursion when using type of bytes versions: Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:17:12 2021 From: report at bugs.python.org (J.P) Date: Mon, 21 Jun 2021 15:17:12 +0000 Subject: [issue18233] SSLSocket.getpeercertchain() In-Reply-To: <1371415195.44.0.636993698614.issue18233@psf.upfronthosting.co.za> Message-ID: <1624288632.86.0.967368460569.issue18233@roundup.psfhosted.org> Change by J.P : ---------- nosy: +jamespo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:17:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 15:17:15 +0000 Subject: [issue21760] inspect documentation describes module type inaccurately In-Reply-To: <1402775893.22.0.955121317915.issue21760@psf.upfronthosting.co.za> Message-ID: <1624288635.63.0.625741317508.issue21760@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy -patch versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:22:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 15:22:15 +0000 Subject: [issue26693] Exception ignored in: in _shutdown, assert tlock.locked() In-Reply-To: <1459821105.82.0.884891417565.issue26693@psf.upfronthosting.co.za> Message-ID: <1624288935.72.0.831808991684.issue26693@roundup.psfhosted.org> Irit Katriel added the comment: Can we close this as not a bug, as the reproducer includes unsupported code? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:24:03 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 15:24:03 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set In-Reply-To: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> Message-ID: <1624289043.43.0.314787276474.issue44472@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25411 pull_request: https://github.com/python/cpython/pull/26830 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:24:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 15:24:10 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set In-Reply-To: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> Message-ID: <1624289050.96.0.0728052785374.issue44472@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25412 pull_request: https://github.com/python/cpython/pull/26831 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:24:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 21 Jun 2021 15:24:15 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set In-Reply-To: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> Message-ID: <1624289055.68.0.57620714353.issue44472@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 06cda808f149fae9b4c688f752b6eccd0d455ba4 by Pablo Galindo in branch 'main': bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) https://github.com/python/cpython/commit/06cda808f149fae9b4c688f752b6eccd0d455ba4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:25:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 21 Jun 2021 15:25:49 +0000 Subject: [issue44472] ltrace functionality doesn't work if there is an exception set In-Reply-To: <1624270735.06.0.710664144934.issue44472@roundup.psfhosted.org> Message-ID: <1624289149.62.0.09481035676.issue44472@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 Jun 21 11:29:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:29:08 +0000 Subject: [issue26693] Exception ignored in: in _shutdown, assert tlock.locked() In-Reply-To: <1459821105.82.0.884891417565.issue26693@psf.upfronthosting.co.za> Message-ID: <1624289348.34.0.967069957952.issue26693@roundup.psfhosted.org> STINNER Victor added the comment: Yeah, I consider that the issue can be closed. I'm ok to investigate the issue if another reproducer code is written only using fully initialized (sub)interpreters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:30:21 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:30:21 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624289421.02.0.12703347106.issue44470@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:33:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:33:04 +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: <1624289584.01.0.418540594507.issue44394@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +lukasz.langa, ned.deily, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:33:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 15:33:51 +0000 Subject: [issue26693] Exception ignored in: in _shutdown, assert tlock.locked() In-Reply-To: <1459821105.82.0.884891417565.issue26693@psf.upfronthosting.co.za> Message-ID: <1624289631.11.0.925583405233.issue26693@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:35:38 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 21 Jun 2021 15:35:38 +0000 Subject: [issue44475] Dataclass Causes Infinite Recursion when using type of bytes In-Reply-To: <1624287996.71.0.124244983784.issue44475@roundup.psfhosted.org> Message-ID: <1624289738.18.0.545114355201.issue44475@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:37:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:37:08 +0000 Subject: [issue44358] AMD64 RHEL8 LTO + PGO 3.x build failed with: /usr/bin/ld: Dwarf Error: Offset (2487097600) greater than or equal to .debug_str size (571933). In-Reply-To: <1623225020.58.0.673640131019.issue44358@roundup.psfhosted.org> Message-ID: <1624289828.14.0.200066599845.issue44358@roundup.psfhosted.org> Change by STINNER Victor : ---------- nosy: +cstratak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:38:07 2021 From: report at bugs.python.org (Erik Y. Adams) Date: Mon, 21 Jun 2021 15:38:07 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1624289887.3.0.0629117564043.issue44344@roundup.psfhosted.org> Erik Y. Adams added the comment: I still think the most important aspect of this is that pow() will return complex numbers, contrary to what is implied by the statement I quoted at the beginning of this thread. Perhaps we should just borrow from the documentation for the power operator, which says: Raising 0.0 to a negative power results in a ZeroDivisionError. Raising a negative number to a fractional power results in a complex number. (In earlier versions it raised a ValueError.) https://docs.python.org/3/reference/expressions.html#the-power-operator ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:42:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:42:17 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624290137.73.0.533311821682.issue44297@roundup.psfhosted.org> STINNER Victor added the comment: Can the issue be closed? I'm not sure which assertion failed in test_ssl.test_pha_required_nocert(). I bet on this one: with self.assertRaisesRegex( ssl.SSLError, '(certificate required|EOF occurred)' ): I don't know if the commit 82e5c28af7049c4f5343c808f172cbe2e145f49b is supported is to fix issue or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:43:22 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 21 Jun 2021 15:43:22 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624290202.35.0.54294036758.issue44470@roundup.psfhosted.org> Mark Dickinson added the comment: The bug here is that https://docs.python.org/3.11/library/parser.html is visible at all, given that the parser module no longer exists in 3.10 or 3.11. @Samuel: Do you see this on any other documentation nodes, or just on parser.html? I can reproduce the confusion on parser.html, but I don't see it anywhere else. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:44:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:44:33 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624290273.29.0.761271737255.issue44297@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I can still reproduce the issue on the main branch with this patch: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index cee97a8302..3f66818ae1 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4499,7 +4499,7 @@ def msg_cb(conn, direction, version, content_type, msg_type, data): # server aborts connection with an error. with self.assertRaisesRegex( ssl.SSLError, - '(certificate required|EOF occurred)' + 'xxxxxxxxxxxxx' ): # receive CertificateRequest data = s.recv(1024) $ ./python -m test test_ssl -m test_pha_required_nocert -v (...) FAIL: test_pha_required_nocert (test.test_ssl.TestPostHandshakeAuth) ---------------------------------------------------------------------- (...) Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_ssl.py", line -1, in test_pha_required_nocert AssertionError: (...) ... => "line -1" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:45:50 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Mon, 21 Jun 2021 15:45:50 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624290350.48.0.565053471956.issue44470@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: @Mark, I don't know about Samuel, but when I tried, I could get the bug with other languages, but not on other pages (which seems to agree with your point of reasoning). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:46:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:46:08 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1624290368.63.0.351813176822.issue44442@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44288: can it be a duplicate? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:47:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:47:02 +0000 Subject: [issue44288] unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None In-Reply-To: <1622646301.21.0.530084460919.issue44288@roundup.psfhosted.org> Message-ID: <1624290422.85.0.757507005884.issue44288@roundup.psfhosted.org> STINNER Victor added the comment: Is it possible that bpo-44442 is a duplicate of this issue? Is it already fixed by GH-26768, commit ba2f32a983a08c4f64c23c187432e38908639c12? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:47:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:47:25 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1624290445.99.0.305270333526.issue44442@roundup.psfhosted.org> STINNER Victor added the comment: The bpo number is missing from the merged commit, it's: commit ba2f32a983a08c4f64c23c187432e38908639c12 Author: Mark Shannon Date: Thu Jun 17 16:29:15 2021 +0100 Do not clear globals or builtins when calling clear() on a frame object. Reverts behavior to that of 3.10 and earlier. (GH-26768) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:52:57 2021 From: report at bugs.python.org (Brian Curtin) Date: Mon, 21 Jun 2021 15:52:57 +0000 Subject: [issue44476] "subprocess not supported for isolated subinterpreters" when running venv Message-ID: <1624290777.25.0.989735208414.issue44476@roundup.psfhosted.org> New submission from Brian Curtin : I'm currently trying to run my `tox` testing environment?all of which runs under `coverage`?against 3.10b3 and am running into some trouble. I initially thought it was something about tox or coverage, but it looks lower level than that as the venv script in the stdlib isn't working. I'm not actually sure if the direct problem I'm experiencing is the same as what I'm listing below, but it reproduces the same result: $ python3.10 -m venv ~/.envs/test Error: subprocess not supported for isolated subinterpreters Here's the version I'm running: Python 3.10.0b3 (tags/v3.10.0b3:865714a117, Jun 17 2021, 17:37:28) [Clang 10.0.1 (clang-1001.0.46.4)] on darwin In case it's helpful, here's a full traceback from tox: action: py310-unit, msg: getenv cwd: /Users/briancurtin/elastic/cloud/python-services-v3 cmd: /Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/bin/python -m pip install coverage -rrequirements.txt -rtest-requirements.txt Collecting coverage Using cached coverage-5.5.tar.gz (691 kB) ERROR: Error subprocess not supported for isolated subinterpreters while executing command python setup.py egg_info ERROR: Exception: Traceback (most recent call last): File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 188, in _main status = self.run(options, args) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper return func(self, options, args) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 332, in run requirement_set = resolver.resolve( File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/resolution/legacy/resolver.py", line 179, in resolve discovered_reqs.extend(self._resolve_one(requirement_set, req)) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/resolution/legacy/resolver.py", line 362, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/resolution/legacy/resolver.py", line 314, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement(req) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 487, in prepare_linked_requirement abstract_dist = _get_prepared_distribution( File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 91, in _get_prepared_distribution abstract_dist.prepare_distribution_metadata(finder, build_isolation) File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py", line 40, in prepare_distribution_metadata self.req.prepare_metadata() File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 550, in prepare_metadata self.metadata_directory = self._generate_metadata() File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 525, in _generate_metadata return generate_metadata_legacy( File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 70, in generate_metadata call_subprocess( File "/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py", line 185, in call_subprocess proc = subprocess.Popen( File "/usr/local/lib/python3.10/subprocess.py", line 962, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.10/subprocess.py", line 1773, in _execute_child self.pid = _posixsubprocess.fork_exec( RuntimeError: subprocess not supported for isolated subinterpreters WARNING: You are using pip version 20.1.1; however, version 21.1.2 is available. You should consider upgrading via the '/Users/briancurtin/elastic/cloud/python-services-v3/.tox/py310-unit/bin/python -m pip install --upgrade pip' command. ---------- messages: 396262 nosy: brian.curtin priority: normal severity: normal status: open title: "subprocess not supported for isolated subinterpreters" when running venv type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 11:55:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 15:55:04 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624290904.92.0.155065115007.issue44287@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25413 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26832 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:02:02 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 21 Jun 2021 16:02:02 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624291322.59.0.531465120508.issue44470@roundup.psfhosted.org> Julien Palard added the comment: Hi all! Thanks for reporting! I'm taking a look at it. ---------- assignee: docs at python -> mdk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:08:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 16:08:14 +0000 Subject: [issue24948] Multiprocessing not timely flushing stack trace to stderr In-Reply-To: <1440710429.87.0.104720490474.issue24948@psf.upfronthosting.co.za> Message-ID: <1624291694.68.0.389576870427.issue24948@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:08:34 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 16:08:34 +0000 Subject: [issue44477] Remove ma_version_tag in dict? Message-ID: <1624291714.04.0.676545373232.issue44477@roundup.psfhosted.org> New submission from Ken Jin : issue44206, issue44337, and issue44338 converted things dependent on ma_version_tag to ma_keys->dk_version. I propose to remove ma_version_tag and save 8 bytes of space in dict. I've prepared a draft PR to do that. However, I'd like to wait for some time before merging it. This will make it easier to revert a PR in one of those issues should the need arise. ---------- messages: 396264 nosy: Mark.Shannon, kj, methane priority: normal severity: normal status: open title: Remove ma_version_tag in dict? versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:09:15 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 16:09:15 +0000 Subject: [issue44477] Remove ma_version_tag in dict? In-Reply-To: <1624291714.04.0.676545373232.issue44477@roundup.psfhosted.org> Message-ID: <1624291755.86.0.272216394725.issue44477@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +25414 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26833 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:09:35 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 21 Jun 2021 16:09:35 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624291775.97.0.575756263509.issue44470@roundup.psfhosted.org> Julien Palard added the comment: I added a git clean in docsbuild scripts to switch from one version to another: https://github.com/python/docsbuild-scripts/commit/1397a8dbe4c73744757ad24764baeb393842f30b It should be enough to correctly start fresh from one lang to another and from one version to another. Let's check next time the cron runs (daily) if it's fixed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:14:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 16:14:36 +0000 Subject: [issue22472] OSErrors should use str and not repr on paths In-Reply-To: <1411504485.58.0.497867466453.issue22472@psf.upfronthosting.co.za> Message-ID: <1624292076.88.0.752514612737.issue22472@roundup.psfhosted.org> Irit Katriel added the comment: Should this be closed as rejected, or is there anything left to do? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:15:43 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 21 Jun 2021 16:15:43 +0000 Subject: [issue44344] Documentation for pow() should include the possibility of complex numbers as a return type In-Reply-To: <1623125616.73.0.892905550694.issue44344@roundup.psfhosted.org> Message-ID: <1624292143.81.0.914007865318.issue44344@roundup.psfhosted.org> Mark Dickinson added the comment: > Perhaps we should just borrow from the documentation for the power operator, which says [...] That sounds good to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:24:32 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 16:24:32 +0000 Subject: [issue44477] Remove ma_version_tag in dict? In-Reply-To: <1624291714.04.0.676545373232.issue44477@roundup.psfhosted.org> Message-ID: <1624292672.77.0.621936635018.issue44477@roundup.psfhosted.org> Ken Jin added the comment: Hmm I'm suddenly having second thoughts. I wonder if there's future use cases I might be missing here from PEP 509? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:36:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 16:36:23 +0000 Subject: [issue38825] shutil.disk_usage - Lacking documentation In-Reply-To: <1573942798.11.0.196925055555.issue38825@roundup.psfhosted.org> Message-ID: <1624293383.78.0.661564976654.issue38825@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:40:52 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 21 Jun 2021 16:40:52 +0000 Subject: [issue44475] Dataclass Causes Infinite Recursion when using type of bytes In-Reply-To: <1624287996.71.0.124244983784.issue44475@roundup.psfhosted.org> Message-ID: <1624293652.8.0.313340252098.issue44475@roundup.psfhosted.org> Eric V. Smith added the comment: Please give a complete example that we can execute. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:46:16 2021 From: report at bugs.python.org (Brian Curtin) Date: Mon, 21 Jun 2021 16:46:16 +0000 Subject: [issue44476] "subprocess not supported for isolated subinterpreters" when running venv In-Reply-To: <1624290777.25.0.989735208414.issue44476@roundup.psfhosted.org> Message-ID: <1624293976.78.0.941609840009.issue44476@roundup.psfhosted.org> Brian Curtin added the comment: Hmm. I asked around about this and someone installed 3.10.0-beta3 via pyenv and this worked fine. For whatever it's worth, this was built from source on OS X 10.14.6 via a pretty normal setup of `./configure` with no extra flags and then `make install` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:50:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 16:50:28 +0000 Subject: [issue37514] french translation Spelling mistake on datetime python's library documentation online In-Reply-To: <1562419390.4.0.81704201562.issue37514@roundup.psfhosted.org> Message-ID: <1624294228.21.0.15527585086.issue37514@roundup.psfhosted.org> Irit Katriel added the comment: This sentence is no longer there (with or without the typo). ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 12:56:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 16:56:24 +0000 Subject: [issue28661] Fix code example in Python 3.5 telnetlib documentation In-Reply-To: <1478805391.59.0.11862034954.issue28661@psf.upfronthosting.co.za> Message-ID: <1624294584.13.0.39379283475.issue28661@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 Mon Jun 21 13:06:44 2021 From: report at bugs.python.org (Oz Mouchtar) Date: Mon, 21 Jun 2021 17:06:44 +0000 Subject: [issue44478] I can't Message-ID: <1624295204.74.0.655904668148.issue44478@roundup.psfhosted.org> New submission from Oz Mouchtar : Hey I'm new to Python (just started to learn this magnificent language) and during my online course I tried to create a virtual environment and got the error on the attached file. I tried even to re-install Python and Visual Studio and yet I get this error. Can someone help me? I'm using Visual Studio code and Python version 3.9.5 ---------- components: Windows files: problem.jpg messages: 396272 nosy: oz1804, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: I can't type: crash versions: Python 3.9 Added file: https://bugs.python.org/file50123/problem.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:15:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 17:15:42 +0000 Subject: [issue27547] Crash or freeze trying to execute b'a' * 0xFFFFFFFFFFFFFFF In-Reply-To: <1468820344.69.0.285015698444.issue27547@psf.upfronthosting.co.za> Message-ID: <1624295742.85.0.389234671638.issue27547@roundup.psfhosted.org> Irit Katriel added the comment: I get a MemoryError on Windows 10: >>> float(array.array("L",b"a"*0xFFFFFFFFFFFFFFF+100000**8000000000)) Traceback (most recent call last): File "", line 1, in MemoryError >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:19:53 2021 From: report at bugs.python.org (Brian Curtin) Date: Mon, 21 Jun 2021 17:19:53 +0000 Subject: [issue44476] "subprocess not supported for isolated subinterpreters" when running venv In-Reply-To: <1624290777.25.0.989735208414.issue44476@roundup.psfhosted.org> Message-ID: <1624295993.02.0.742071624757.issue44476@roundup.psfhosted.org> Brian Curtin added the comment: I think there was either something stale that got linked wrong or some other kind of build failure, as I just built v3.10.0b3 tag again from a properly cleaned environment and this is no longer occurring. Sorry for the noise. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:21:01 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 21 Jun 2021 17:21:01 +0000 Subject: [issue44478] I can't In-Reply-To: <1624295204.74.0.655904668148.issue44478@roundup.psfhosted.org> Message-ID: <1624296061.61.0.412390533005.issue44478@roundup.psfhosted.org> Zachary Ware added the comment: This site is not a help forum, it is for tracking bugs in the implementation of the CPython reference interpreter. You'll have better luck somewhere like https://discuss.python.org/c/users/7, the python-list at python.org mailing list, or the #python IRC channel on Libera.Chat. If you take your query to one of these other forums, it's best to copy and paste error messages as text to avoid excluding people who can help you but either can't see a posted image or refuse to open an image that could turn out to be anything at all :) That said, my suspicion is that things are going wrong with OneDrive somehow, or possibly (but less likely) with the non-ascii path. Try creating your venv somewhere like `C:\Users\oz180\venv_test` instead. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:26:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 17:26:27 +0000 Subject: [issue25381] Doc: Use of old description of raise in Python3 In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624296387.96.0.553924928665.issue25381@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: -patch versions: +Python 3.11 -Python 3.5, Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:27:16 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 21 Jun 2021 17:27:16 +0000 Subject: [issue44477] Remove ma_version_tag in dict? In-Reply-To: <1624291714.04.0.676545373232.issue44477@roundup.psfhosted.org> Message-ID: <1624296436.28.0.0797172822908.issue44477@roundup.psfhosted.org> Ken Jin added the comment: Closing this for now as it seems PEP 509 may need to be repealed: https://github.com/faster-cpython/ideas/issues/30#issuecomment-858615678 Sorry for the noise everyone :(. ---------- resolution: -> postponed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:33:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 17:33:50 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624296830.37.0.498680325628.issue13814@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 Mon Jun 21 13:37:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 21 Jun 2021 17:37:18 +0000 Subject: [issue27547] Crash or freeze trying to execute b'a' * 0xFFFFFFFFFFFFFFF In-Reply-To: <1468820344.69.0.285015698444.issue27547@psf.upfronthosting.co.za> Message-ID: <1624297038.84.0.3164138038.issue27547@roundup.psfhosted.org> Serhiy Storchaka added the comment: Concur with Martin. Most likely it is an OS bug, the same as issue5614. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Malloc errors in test_io _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:38:49 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Jun 2021 17:38:49 +0000 Subject: [issue22472] OSErrors should use str and not repr on paths In-Reply-To: <1411504485.58.0.497867466453.issue22472@psf.upfronthosting.co.za> Message-ID: <1624297129.27.0.0617650946893.issue22472@roundup.psfhosted.org> Antoine Pitrou added the comment: I'll close as rejected. Unfortunately, we have to make an exclusive choice here :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 13:38:59 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Mon, 21 Jun 2021 17:38:59 +0000 Subject: [issue22472] OSErrors should use str and not repr on paths In-Reply-To: <1411504485.58.0.497867466453.issue22472@psf.upfronthosting.co.za> Message-ID: <1624297139.25.0.835672706334.issue22472@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- resolution: -> rejected stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 14:16:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 18:16:03 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624271215.66.0.0541694058097.issue44468@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I agree with the OP, we can do better here. Ken, if you feel like it, a fix should not be too complicated, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 14:35:29 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 18:35:29 +0000 Subject: [issue25381] Doc: Use of old description of raise in Python3 In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624300529.64.0.751924945288.issue25381@roundup.psfhosted.org> Terry J. Reedy added the comment: Irit, it is unclear why you unchecked 'patch'. Because no PR? The keyword includes a patch file attached to an issue. Someone can convert it to a PR. From the tracker doc: "patch There is a patch or pull request attached to the issue." Because the 2nd patch was, in essence rejected as is? A different matter, though most .patch or .diff files attached need revision when made a PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 14:46:37 2021 From: report at bugs.python.org (Maxwell Ballenger) Date: Mon, 21 Jun 2021 18:46:37 +0000 Subject: [issue44466] faulthandler should indicate if the fault happened in garbage collection In-Reply-To: <1624220668.4.0.0473395523202.issue44466@roundup.psfhosted.org> Message-ID: <1624301197.42.0.401111856763.issue44466@roundup.psfhosted.org> Maxwell Ballenger added the comment: Thank you Victor, sounds great! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:27:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 21 Jun 2021 19:27:21 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624303641.84.0.517643361665.issue42588@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 5.0 -> 6.0 pull_requests: +25415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26834 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:33:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 21 Jun 2021 19:33:35 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624304015.04.0.747014934436.issue42588@roundup.psfhosted.org> Andrei Kulakov added the comment: I'm not sure it's worth it to complicate the logic by raising the error before iteration since iteration is normally done soon after method call. I agree the doc change is helpful, since the ticket was dormant for a ~month, I've put up a PR with this change as well as clarifying that an iterator obj is returned rather than an iterable. I've given credit to Ran in the PR description. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:36:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 21 Jun 2021 19:36:46 +0000 Subject: [issue22167] iglob() has misleading documentation (does indeed store names internally) In-Reply-To: <1407460141.27.0.298063472331.issue22167@psf.upfronthosting.co.za> Message-ID: <1624304206.37.0.708581159152.issue22167@roundup.psfhosted.org> Andrei Kulakov added the comment: I have put up a PR here: https://github.com/python/cpython/pull/25767 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:42:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 21 Jun 2021 19:42:03 +0000 Subject: [issue43905] dataclasses.astuple does deepcopy on all fields In-Reply-To: <1619007557.11.0.871267775065.issue43905@roundup.psfhosted.org> Message-ID: <1624304523.31.0.871266935215.issue43905@roundup.psfhosted.org> Andrei Kulakov added the comment: I've added a PR here: https://github.com/python/cpython/pull/26154 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:53:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 19:53:30 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624305210.09.0.695675282193.issue13814@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +25416 pull_request: https://github.com/python/cpython/pull/26835 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:54:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 19:54:08 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624305248.55.0.480449705168.issue13814@roundup.psfhosted.org> Terry J. Reedy added the comment: I added a simplified answer after a similar question about assignment and CMs. ---------- keywords: -easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:56:39 2021 From: report at bugs.python.org (Niklas Rosenstein) Date: Mon, 21 Jun 2021 19:56:39 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1624305399.5.0.744003658007.issue43749@roundup.psfhosted.org> Niklas Rosenstein added the comment: I just encountered the same behavior. Steps to reproduce: * Install Python 3 (I used 3.9.5) on Windows * Use the Admin console to create a python3.exe link, e.g. cd "c:/Users/niklas/AppData/Local/Programs/Python/Python39" mklink python3.exe python.exe * Use python3.exe to create a venv, e.g. python3 -m venv The environment is created up until the point _setup_pip() is called in venv, which causes the following error to be printed: Error: [WinError 2] The system cannot find the file specified Running venv from the interpreter gives the full stack trace. $ python3 -c 'import venv; venv.main([".venv"])' Traceback (most recent call last): File "", line 1, in File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\venv\__init__.py", line 491, in main builder.create(d) File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\venv\__init__.py", line 75, in create self._setup_pip(context) File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\venv\__init__.py", line 299, in _setup_pip subprocess.check_output(cmd, stderr=subprocess.STDOUT) File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\niklas\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified ---------- nosy: +n_rosenstein _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 15:58:48 2021 From: report at bugs.python.org (Niklas Rosenstein) Date: Mon, 21 Jun 2021 19:58:48 +0000 Subject: [issue43749] venv module does not copy the correct python exe In-Reply-To: <1617715625.46.0.74507922397.issue43749@roundup.psfhosted.org> Message-ID: <1624305528.3.0.036617230948.issue43749@roundup.psfhosted.org> Niklas Rosenstein added the comment: To complete my previous comment, patching the function to see the command that is invoked, you can see it tries to invoke 'python3.exe' (seemingly derived from sys.executable) in the venv but the venv only contains 'python.exe'. ['C:\\Users\\niklas\\dotfiles\\.venv\\Scripts\\python3.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip'] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 16:53:14 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 20:53:14 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1624308794.3.0.339855552096.issue43693@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 355f5dd36a0f53175517f35798aa874564d1113a by Guido van Rossum in branch 'main': bpo-43693: Turn localspluskinds into an object (GH-26749) https://github.com/python/cpython/commit/355f5dd36a0f53175517f35798aa874564d1113a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:14:18 2021 From: report at bugs.python.org (Daniel Lenski) Date: Mon, 21 Jun 2021 21:14:18 +0000 Subject: [issue30238] 2to3 doesn't detect or fix Exception indexing In-Reply-To: <1493753516.03.0.383972145792.issue30238@psf.upfronthosting.co.za> Message-ID: <1624310058.31.0.636783747856.issue30238@roundup.psfhosted.org> Daniel Lenski added the comment: > There is no way to know through static analysis that the subscript is on an object of type exception. I think this should be closed as won't fix. In almost all cases, the variable in question will receive its value via `except ... as e:`. try: ... except (Exception1, Exception2, ...) as e: e[0] Seems to me that it should be possible for 2to3 to handle this large subset of applicable cases via static analysis. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:23:38 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 21:23:38 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624310618.4.0.350312446227.issue13814@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25417 pull_request: https://github.com/python/cpython/pull/26836 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:23:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 21:23:36 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624310616.6.0.352717342978.issue13814@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 51f45d085dad3b708f6fe166af517aba69e7e9f7 by Terry Jan Reedy in branch 'main': bpo-13814: Explain why generators are not context managers (GH-26835) https://github.com/python/cpython/commit/51f45d085dad3b708f6fe166af517aba69e7e9f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:23:44 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 21:23:44 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624310624.51.0.568229028003.issue13814@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25418 pull_request: https://github.com/python/cpython/pull/26837 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:25:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 21:25:40 +0000 Subject: [issue25381] Doc: Use of old description of raise in Python3 In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624310740.32.0.50861190571.issue25381@roundup.psfhosted.org> Terry J. Reedy added the comment: On 2007 Aug 15, extending.rst was merged into master (early 2.6 alpha) and early 3.0 alpha. The only change to this paragraph since the initial 2.6 version was Serhiy changing "*NULL*" to "``NULL``" in 3.x on 2019 Oct 30. I will post a PR with what I think is true now. ---------- nosy: +iritkatriel versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:36:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 21:36:33 +0000 Subject: [issue25381] Doc: Use of old description of raise in Python3 In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624311393.12.0.552602614337.issue25381@roundup.psfhosted.org> Irit Katriel added the comment: Yes, I thought since we need a PR the keyword was wrong. Thanks for the correction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 17:55:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 21:55:09 +0000 Subject: [issue25381] Doc: Use of old description of raise in Python3 In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624312509.2.0.979174207575.issue25381@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- keywords: +patch pull_requests: +25419 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26838 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:02:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 22:02:50 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624312970.15.0.537201452077.issue13814@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 1e16217204c0e8e595c4d1e869c81899bfe3376b by Miss Islington (bot) in branch '3.10': bpo-13814: Explain why generators are not context managers (GH-26835) https://github.com/python/cpython/commit/1e16217204c0e8e595c4d1e869c81899bfe3376b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:03:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 22:03:09 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624312989.89.0.730161646813.issue13814@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset d881002fbdf12ddbd93db3e182dc5cdeb1f90386 by Miss Islington (bot) in branch '3.9': bpo-13814: Explain why generators are not context managers (GH-26835) https://github.com/python/cpython/commit/d881002fbdf12ddbd93db3e182dc5cdeb1f90386 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:03:33 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 21 Jun 2021 22:03:33 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624313013.25.0.0920878720717.issue13814@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 Mon Jun 21 18:30:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 22:30:32 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1624314632.03.0.505702763656.issue43693@roundup.psfhosted.org> Change by Guido van Rossum : ---------- pull_requests: +25420 pull_request: https://github.com/python/cpython/pull/26839 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:34:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 21 Jun 2021 22:34:11 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1624314851.61.0.640078308793.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25421 pull_request: https://github.com/python/cpython/pull/26840 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:46:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 21 Jun 2021 22:46:59 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1624315619.78.0.400152558794.issue28533@roundup.psfhosted.org> Irit Katriel added the comment: If the tests are the only thing blocking removal, does it make sense to move asyncore and asynchat to test.support and get on with removing them from the stdlib? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 18:59:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 22:59:20 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1624316360.51.0.0711501447355.issue41249@roundup.psfhosted.org> Guido van Rossum added the comment: Note that this issue is now only a problem of you use `from __future__ import annotations` -- we rolled the default behavior for 3.10 back to what it was in 3.9. I am out of time to argue about why we chose this behavior, alas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:02:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 23:02:30 +0000 Subject: [issue44479] Windows build doesn't regenerate some files Message-ID: <1624316550.78.0.114514197703.issue44479@roundup.psfhosted.org> Change by Guido van Rossum : ---------- components: Windows nosy: gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows build doesn't regenerate some files _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:02:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 23:02:15 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1624316535.03.0.0748412676706.issue28533@roundup.psfhosted.org> STINNER Victor added the comment: Irit: > If the tests are the only thing blocking removal, does it make sense to move asyncore and asynchat to test.support and get on with removing them from the stdlib? Yes, it makes sense and it can be done right now, since asynchat/asyncore is deprecated since Python 3.6. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:04:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 23:04:43 +0000 Subject: [issue44480] test_compile killed by signal 9 on AMD64 FreeBSD Non-Debug 3.x Message-ID: <1624316683.45.0.985202182274.issue44480@roundup.psfhosted.org> New submission from STINNER Victor : It looks like bpo-44360 which was a Linux OOM Killer issue since the Linux machine memory was too low. AMD64 FreeBSD Non-Debug 3.x: https://buildbot.python.org/all/#/builders/172/builds/387 ... test_single_statement (test.test_compile.TestSpecifics) ... ok test_stack_overflow (test.test_compile.TestSpecifics) ... *** Signal 9 Stop. make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build program finished with exit code 1 elapsedTime=855.058198 ---------- components: Tests messages: 396298 nosy: koobs, vstinner priority: normal severity: normal status: open title: test_compile killed by signal 9 on AMD64 FreeBSD Non-Debug 3.x versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:04:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 21 Jun 2021 23:04:58 +0000 Subject: [issue44479] Windows build doesn't regenerate some files Message-ID: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> New submission from Guido van Rossum : The new PCbuild\build.bat script is much better at regenerating necessary files. However I just found out that there are some more files that need to be regenerated occasionally: - Programs/test_frozenmain.h - Python/frozen_hello.h Could you add rules for these? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:26:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 23:26:12 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624317972.97.0.540986571164.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: inittab-bug.c uses the Python C API in 3 threads: * Thread A (init_proc) calls Py_InitializeFromConfig() * Thread B (run_proc) calls Py_RunMain() * The main thread (main) calls Py_FinalizeEx() Problem: the thread B (run_proc) doesn't hold the GIL and so I get a fatal error with Python built in debug mode: ------------ $ gcc inittab-bug.c -ggdb -pthread -lpython3.11d -L. -I. -I Include/ $ PYTHONPATH=$PWD/Lib LD_LIBRARY_PATH=$PWD ./a.out ------ Modules: ------ #0 'posix' #1 'errno' #2 'pwd' ---------------------- Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Run Python Script Fatal Python error: _PyMem_DebugMalloc: Python memory allocator called without holding the GIL Python runtime state: initialized Thread 0x00007f61ce5c1640 (most recent call first): Abandon (core dumped) ------------ If I remove the thread B (comment the comment), I get a similar error in the main thread which calls Py_FinalizeEx(). Please fix your usage of the GIL. For example, you can try to use: * https://docs.python.org/dev/c-api/init.html#c.PyGILState_Ensure * https://docs.python.org/dev/c-api/init.html#c.PyGILState_Release Usually, Python initialization and Python finalization is done in the same thread, but another thread can use the Python C API if it acquires the GIL using PyGILState_Ensure(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:44:11 2021 From: report at bugs.python.org (Jeff S) Date: Mon, 21 Jun 2021 23:44:11 +0000 Subject: [issue44481] Tkinter config() minor documentation bug for shorthand options Message-ID: <1624319051.28.0.321773416541.issue44481@roundup.psfhosted.org> New submission from Jeff S : The documentation page https://docs.python.org/3/library/tkinter.html states "Passing the config() method the name of a shorthand option will return a 2-tuple, not 5-tuple." While config() without argument does return a map that yields references like this, if config() is given the shorthand name as an argument, it follows the reference to the long option name and does yield the full 5-tuple. To demonstrate the difference: from tkinter import Tk Tk().config()['bg'] Tk().config('bg') ---------- components: Tkinter messages: 396301 nosy: spirko priority: normal severity: normal status: open title: Tkinter config() minor documentation bug for shorthand options type: behavior versions: Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:58:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 21 Jun 2021 23:58:27 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624319907.66.0.322867580756.issue44287@roundup.psfhosted.org> STINNER Victor added the comment: New changeset be1cb3214d09d4bf0288bc45f3c1f167f67e4514 by Victor Stinner in branch 'main': bpo-44287: asyncio test_popen() uses longer timeout (GH-26832) https://github.com/python/cpython/commit/be1cb3214d09d4bf0288bc45f3c1f167f67e4514 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:58:34 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 23:58:34 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624319914.38.0.872924624466.issue44287@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25422 pull_request: https://github.com/python/cpython/pull/26841 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 19:58:39 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 21 Jun 2021 23:58:39 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624319919.91.0.841334199359.issue44287@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25423 pull_request: https://github.com/python/cpython/pull/26842 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 20:22:10 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 00:22:10 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624321330.48.0.765843689428.issue44287@roundup.psfhosted.org> miss-islington added the comment: New changeset c032a12cbb7d6e2d6a292b0e9220c33ef7349d28 by Miss Islington (bot) in branch '3.10': bpo-44287: asyncio test_popen() uses longer timeout (GH-26832) https://github.com/python/cpython/commit/c032a12cbb7d6e2d6a292b0e9220c33ef7349d28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 20:29:25 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 00:29:25 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624321765.34.0.407597140624.issue44287@roundup.psfhosted.org> miss-islington added the comment: New changeset 0ff487b8abe70f091285acf367b795861eed8049 by Miss Islington (bot) in branch '3.9': bpo-44287: asyncio test_popen() uses longer timeout (GH-26832) https://github.com/python/cpython/commit/0ff487b8abe70f091285acf367b795861eed8049 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 22:53:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 22 Jun 2021 02:53:19 +0000 Subject: [issue25381] Update doc of three C exception values. In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624330399.28.0.887410693299.issue25381@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: patch review -> needs patch title: Doc: Use of old description of raise in Python3 -> Update doc of three C exception values. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 21 23:14:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 22 Jun 2021 03:14:24 +0000 Subject: [issue25381] Update doc of three C exception values. In-Reply-To: <1444637496.5.0.854563191712.issue25381@psf.upfronthosting.co.za> Message-ID: <1624331664.76.0.105410095893.issue25381@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: needs patch -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 01:28:41 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 22 Jun 2021 05:28:41 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624339721.13.0.382452201542.issue44439@roundup.psfhosted.org> Ma Lin added the comment: I am checking all the .py files in `Lib` folder. hmac.py has two len() bugs: https://github.com/python/cpython/blob/v3.10.0b3/Lib/hmac.py#L212 https://github.com/python/cpython/blob/v3.10.0b3/Lib/hmac.py#L214 I think PR 26764 is prepared, it fixes the len() bugs in bz2.py/lzma.py files. ---------- nosy: +christian.heimes title: PickleBuffer doesn't have __len__ method -> stdlib wrongly uses len() for bytes-like object _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 01:40:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 05:40:18 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations Message-ID: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> New submission from Serhiy Storchaka : There is possible resource leak in glob on alternate Python implementation witch do not use reference counting to immediate releasing resources. It is in the code names = list(_iterdir(dirname, dir_fd, dironly)) where _iterdir() is a generator function which calls os.scandir() and yields entry names after some filtering. If an exception happens inside _iterdir(), the scandir iterator will be immediately closed, because of using the with statement. But an exception can happens outside of _iterdir(), in the list constructor (MemoryError). In this case the generator will be closed immediately in CPython because of reference counting (newly created generator has only one reference), but on other implementation it can be deferred on arbitrary time. And even in CPython we rely on garbage collector if there reference loops in the generator frame. This issue has very small chance to occur but still. The right way is to close the generator explicitly: it = _iterdir(dirname, dir_fd, dironly) try: names = list(it) finally: it.close() or with contextlib.closing(_iterdir(dirname, dir_fd, dironly)) as it: names = list(it) We should analyze all other generator functions which acquire some resources and ensure that they are always properly closed. ---------- components: Library (Lib) messages: 396306 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal status: open title: Possible resource leeak in glob in non-refcount implementations type: resource usage versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 01:44:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 05:44:50 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624340690.1.0.392882510411.issue44482@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25424 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26843 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 02:32:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 06:32:26 +0000 Subject: [issue44483] Fatal error in type union Message-ID: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> New submission from Serhiy Storchaka : The following example crashes: class TypeVar: @property def __module__(self): 1/0 str | TypeVar() Output: Fatal Python error: _Py_CheckSlotResult: Slot | of type type succeeded with an exception set Python runtime state: initialized Traceback (most recent call last): File "", line 4, in __module__ ZeroDivisionError: division by zero Aborted (core dumped) The problem in Objects/unionobject.c is that is_typing_module() (and therefore is_typevar() and is_special_form()) can return not only 0 and 1, but -1 as a signal of error, but is_unionable() does not check results for error and interprets it as boolean true. ---------- assignee: serhiy.storchaka components: Interpreter Core messages: 396307 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Fatal error in type union type: crash versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 02:36:47 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Jun 2021 06:36:47 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624343807.37.0.331723765457.issue44458@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 92c2e91580521ba5c85aa3205a0211df5b48689b by Russell Keith-Magee in branch 'main': bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) https://github.com/python/cpython/commit/92c2e91580521ba5c85aa3205a0211df5b48689b ---------- message_count: 1.0 -> 2.0 nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25425 pull_request: https://github.com/python/cpython/pull/26844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 02:36:47 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Jun 2021 06:36:47 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624343807.37.0.331723765457.issue44458@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 92c2e91580521ba5c85aa3205a0211df5b48689b by Russell Keith-Magee in branch 'main': bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) https://github.com/python/cpython/commit/92c2e91580521ba5c85aa3205a0211df5b48689b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 02:46:51 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 22 Jun 2021 06:46:51 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624344411.92.0.980224381784.issue44458@roundup.psfhosted.org> Change by Ma Lin : ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:04:35 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 07:04:35 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624345475.33.0.912629378641.issue44439@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25426 pull_request: https://github.com/python/cpython/pull/26845 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:04:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 07:04:47 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624345487.78.0.0686308360853.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset bc6c12c72a9536acc96e7b9355fd69d1083a43c1 by Ma Lin in branch 'main': bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764) https://github.com/python/cpython/commit/bc6c12c72a9536acc96e7b9355fd69d1083a43c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:10:31 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Jun 2021 07:10:31 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624345831.25.0.876139618676.issue44458@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset cf739332bd039cd2303b58663a804f784883820d by Miss Islington (bot) in branch '3.10': bpo-44458: Ensure BUFFER_BLOCK_SIZE symbol is statically allocated. (GH-26808) (GH-26844) https://github.com/python/cpython/commit/cf739332bd039cd2303b58663a804f784883820d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:12:19 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 22 Jun 2021 07:12:19 +0000 Subject: [issue44458] Duplicate symbol _BUFFER_BLOCK_SIZE when statically linking multiple modules In-Reply-To: <1624073089.72.0.865720775518.issue44458@roundup.psfhosted.org> Message-ID: <1624345939.5.0.744481959394.issue44458@roundup.psfhosted.org> Gregory P. Smith added the comment: Good catch. We don't have buildbots statically linking the modules in these days, that'd be useful to prevent things like this from happening. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:13:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Tue, 22 Jun 2021 07:13:40 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624346020.38.0.254061943591.issue44439@roundup.psfhosted.org> Change by Christian Heimes : ---------- nosy: -christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 03:35:50 2021 From: report at bugs.python.org (Ma Lin) Date: Tue, 22 Jun 2021 07:35:50 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624347350.04.0.438248866733.issue44439@roundup.psfhosted.org> Change by Ma Lin : ---------- pull_requests: +25427 pull_request: https://github.com/python/cpython/pull/26846 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 04:31:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 22 Jun 2021 08:31:40 +0000 Subject: [issue44484] test_concurrent_futures: failure on Windows (x64) Message-ID: <1624350700.35.0.200169528157.issue44484@roundup.psfhosted.org> New submission from Erlend E. Aasland : https://github.com/python/cpython/pull/26840/checks?check_run_id=2879802998 2021-06-21T22:34:41.2973359Z Current runner version: '2.278.0' 2021-06-21T22:34:41.3112811Z ##[group]Operating System 2021-06-21T22:34:41.3113619Z Microsoft Windows Server 2019 2021-06-21T22:34:41.3114096Z 10.0.17763 2021-06-21T22:34:41.3114505Z Datacenter 2021-06-21T22:34:41.3115007Z ##[endgroup] 2021-06-21T22:34:41.3115466Z ##[group]Virtual Environment 2021-06-21T22:34:41.3116039Z Environment: windows-2019 2021-06-21T22:34:41.3116541Z Version: 20210616.0 2021-06-21T22:34:41.3117404Z Included Software: https://github.com/actions/virtual-environments/blob/win19/20210616.0/images/win/Windows2019-Readme.md 2021-06-21T22:34:41.3118637Z Image Release: https://github.com/actions/virtual-environments/releases/tag/win19%2F20210616.0 2021-06-21T22:38:24.0261439Z == CPython 3.11.0a0 (remotes/pull/26840/merge:b69c744, Jun 21 2021, 22:36:15) [MSC v.1929 64 bit (AMD64)] 2021-06-21T22:38:24.0262925Z == Windows-10-10.0.17763-SP0 little-endian 2021-06-21T22:38:24.0264290Z == cwd: D:\a\cpython\cpython\build\test_python_2792? 2021-06-21T22:38:24.0278874Z == CPU count: 2 2021-06-21T22:38:24.0284909Z == encodings: locale=cp1252, FS=utf-8 2021-06-21T22:41:30.6340389Z ====================================================================== 2021-06-21T22:41:30.6341414Z FAIL: test_cancel_futures_wait_false (test.test_concurrent_futures.ThreadPoolShutdownTest) 2021-06-21T22:41:30.6342422Z ---------------------------------------------------------------------- 2021-06-21T22:41:30.6343079Z Traceback (most recent call last): 2021-06-21T22:41:30.6343885Z File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 486, in test_cancel_futures_wait_false 2021-06-21T22:41:30.6344929Z rc, out, err = assert_python_ok('-c', """if True: 2021-06-21T22:41:30.6345751Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok 2021-06-21T22:41:30.6347111Z return _assert_python(True, *args, **env_vars) 2021-06-21T22:41:30.6348114Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python 2021-06-21T22:41:30.6348807Z res.fail(cmd_line) 2021-06-21T22:41:30.6349473Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail 2021-06-21T22:41:30.6350312Z raise AssertionError("Process return code is %d\n" 2021-06-21T22:41:30.6351066Z AssertionError: Process return code is 3221225477 2021-06-21T22:41:30.6353102Z command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if True:\n from concurrent.futures import ThreadPoolExecutor\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n t = ThreadPoolExecutor()\n t.submit(sleep_and_print, .1, "apple")\n t.shutdown(wait=False, cancel_futures=True)\n '] 2021-06-21T22:41:30.6354570Z 2021-06-21T22:41:30.6354966Z stdout: 2021-06-21T22:41:30.6355350Z --- 2021-06-21T22:41:30.6355742Z apple 2021-06-21T22:41:30.6356133Z --- 2021-06-21T22:41:30.6356402Z 2021-06-21T22:41:30.6356793Z stderr: 2021-06-21T22:41:30.6357161Z --- 2021-06-21T22:41:30.6357446Z 2021-06-21T22:41:30.6357812Z --- 2021-06-21T22:41:30.6358099Z 2021-06-21T22:41:30.6358545Z ====================================================================== 2021-06-21T22:41:30.6359427Z FAIL: test_hang_issue39205 (test.test_concurrent_futures.ThreadPoolShutdownTest) 2021-06-21T22:41:30.6360495Z shutdown(wait=False) doesn't hang at exit with running futures. 2021-06-21T22:41:30.6361234Z ---------------------------------------------------------------------- 2021-06-21T22:41:30.6361882Z Traceback (most recent call last): 2021-06-21T22:41:30.6362654Z File "D:\a\cpython\cpython\lib\test\test_concurrent_futures.py", line 393, in test_hang_issue39205 2021-06-21T22:41:30.6363427Z rc, out, err = assert_python_ok('-c', """if True: 2021-06-21T22:41:30.6364204Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 160, in assert_python_ok 2021-06-21T22:41:30.6365084Z return _assert_python(True, *args, **env_vars) 2021-06-21T22:41:30.6365860Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 145, in _assert_python 2021-06-21T22:41:30.6366552Z res.fail(cmd_line) 2021-06-21T22:41:30.6367198Z File "D:\a\cpython\cpython\lib\test\support\script_helper.py", line 72, in fail 2021-06-21T22:41:30.6367976Z raise AssertionError("Process return code is %d\n" 2021-06-21T22:41:30.6368677Z AssertionError: Process return code is 3221225477 2021-06-21T22:41:30.6371113Z command line: ['D:\\a\\cpython\\cpython\\PCbuild\\amd64\\python.exe', '-X', 'faulthandler', '-I', '-c', 'if True:\n from concurrent.futures import ThreadPoolExecutor\n from test.test_concurrent_futures import sleep_and_print\n if __name__ == "__main__":\n t = ThreadPoolExecutor(max_workers=3)\n t.submit(sleep_and_print, 1.0, "apple")\n t.shutdown(wait=False)\n '] 2021-06-21T22:41:30.6372592Z 2021-06-21T22:41:30.6373007Z stdout: 2021-06-21T22:41:30.6373379Z --- 2021-06-21T22:41:30.6373797Z apple 2021-06-21T22:41:30.6374176Z --- 2021-06-21T22:41:30.6374462Z 2021-06-21T22:41:30.6374848Z stderr: 2021-06-21T22:41:30.6375301Z --- 2021-06-21T22:41:30.6375594Z 2021-06-21T22:41:30.6375960Z --- 2021-06-21T22:41:30.6376249Z 2021-06-21T22:41:30.6376805Z ---------------------------------------------------------------------- 2021-06-21T22:41:30.6377249Z 2021-06-21T22:41:30.6377686Z Ran 226 tests in 99.406s 2021-06-21T22:41:30.6378011Z 2021-06-21T22:41:30.6378486Z FAILED (failures=2, skipped=111) 2021-06-21T22:41:30.6379080Z test test_concurrent_futures failed test_regrtest also times out (related? side-effect?): 2021-06-21T23:00:47.1024847Z Timeout (0:20:00)! 2021-06-21T23:00:47.1025489Z Thread 0x0000140c (most recent call first): 2021-06-21T23:00:47.1026155Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1493 in _readerthread 2021-06-21T23:00:47.1026928Z File "D:\a\cpython\cpython\lib\threading.py", line 946 in run 2021-06-21T23:00:47.1027633Z File "D:\a\cpython\cpython\lib\threading.py", line 1009 in _bootstrap_inner 2021-06-21T23:00:47.1028402Z File "D:\a\cpython\cpython\lib\threading.py", line 966 in _bootstrap 2021-06-21T23:00:47.1028829Z 2021-06-21T23:00:47.1029247Z Thread 0x00001990 (most recent call first): 2021-06-21T23:00:47.1029942Z File "D:\a\cpython\cpython\lib\threading.py", line 1099 in _wait_for_tstate_lock 2021-06-21T23:00:47.1030683Z File "D:\a\cpython\cpython\lib\threading.py", line 1083 in join 2021-06-21T23:00:47.1031396Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1522 in _communicate 2021-06-21T23:00:47.1032178Z File "D:\a\cpython\cpython\lib\subprocess.py", line 1148 in communicate 2021-06-21T23:00:47.1033029Z File "D:\a\cpython\cpython\lib\subprocess.py", line 503 in run 2021-06-21T23:00:47.1033763Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 522 in run_command 2021-06-21T23:00:47.1034561Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 547 in run_python 2021-06-21T23:00:47.1035300Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 602 in run_tests 2021-06-21T23:00:47.1036512Z File "D:\a\cpython\cpython\lib\test\test_regrtest.py", line 649 in test_tools_script_run_tests 2021-06-21T23:00:47.1037383Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 549 in _callTestMethod 2021-06-21T23:00:47.1038111Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 592 in run 2021-06-21T23:00:47.1038827Z File "D:\a\cpython\cpython\lib\unittest\case.py", line 652 in __call__ 2021-06-21T23:00:47.1039511Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-06-21T23:00:47.1040225Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-06-21T23:00:47.1040890Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-06-21T23:00:47.1041608Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-06-21T23:00:47.1042317Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 122 in run 2021-06-21T23:00:47.1042986Z File "D:\a\cpython\cpython\lib\unittest\suite.py", line 84 in __call__ 2021-06-21T23:00:47.1043715Z File "D:\a\cpython\cpython\lib\unittest\runner.py", line 176 in run 2021-06-21T23:00:47.1044409Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 960 in _run_suite 2021-06-21T23:00:47.1045522Z File "D:\a\cpython\cpython\lib\test\support\__init__.py", line 1083 in run_unittest 2021-06-21T23:00:47.1046305Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 210 in _test_module 2021-06-21T23:00:47.1047201Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 246 in _runtest_inner2 2021-06-21T23:00:47.1048077Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 282 in _runtest_inner 2021-06-21T23:00:47.1048889Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 141 in _runtest 2021-06-21T23:00:47.1049727Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest.py", line 194 in runtest 2021-06-21T23:00:47.1050546Z File "D:\a\cpython\cpython\lib\test\libregrtest\runtest_mp.py", line 81 in run_tests_worker 2021-06-21T23:00:47.1051374Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 661 in _main 2021-06-21T23:00:47.1052149Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 641 in main 2021-06-21T23:00:47.1052882Z File "D:\a\cpython\cpython\lib\test\libregrtest\main.py", line 719 in main 2021-06-21T23:00:47.1053632Z File "D:\a\cpython\cpython\lib\test\regrtest.py", line 43 in _main 2021-06-21T23:00:47.1054425Z File "D:\a\cpython\cpython\lib\test\regrtest.py", line 47 in 2021-06-21T23:00:47.1055141Z File "D:\a\cpython\cpython\lib\runpy.py", line 86 in _run_code 2021-06-21T23:00:47.1055833Z File "D:\a\cpython\cpython\lib\runpy.py", line 196 in _run_module_as_main 2021-06-21T23:00:47.1056566Z 0:22:23 load avg: 0.00 [427/427/2] test_regrtest crashed (Exit code 1) ---------- components: Tests messages: 396312 nosy: erlendaasland priority: normal severity: normal status: open title: test_concurrent_futures: failure on Windows (x64) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 04:42:57 2021 From: report at bugs.python.org (Chris Trent) Date: Tue, 22 Jun 2021 08:42:57 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation Message-ID: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> New submission from Chris Trent : The documentation pages for the tkinter module are not actually documentation. They are tutorials, which belong on the wiki. "Documentation" is not documentation if it does not provide at bare minimum a structured list of all names exposed by the module's public interface. Python's official docs should be the sole authoritative source for full, complete, useful documentation of everything one could need to know about a module, but instead, We're forced to go to 3rd party sites of dubious provenance and questionable accuracy, instead of being able to just go to the source, and find a page to, I don't know, find out what kinds of panels we have to work with. ---------- assignee: docs at python components: Documentation messages: 396313 nosy: arkevorkhat, docs at python priority: normal severity: normal status: open title: TKinter docs page does not provide actual documentation versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 04:55:21 2021 From: report at bugs.python.org (Chris Trent) Date: Tue, 22 Jun 2021 08:55:21 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation In-Reply-To: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> Message-ID: <1624352121.89.0.936091405328.issue44485@roundup.psfhosted.org> Change by Chris Trent : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 05:08:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Jun 2021 09:08:41 +0000 Subject: [issue44287] test_asyncio: test_popen() failed on AMD64 Windows8.1 Refleaks 3.9 In-Reply-To: <1622644443.7.0.37477111657.issue44287@roundup.psfhosted.org> Message-ID: <1624352921.1.0.930047742825.issue44287@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 05:09:07 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 22 Jun 2021 09:09:07 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation In-Reply-To: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> Message-ID: <1624352947.78.0.665709457587.issue44485@roundup.psfhosted.org> Steven D'Aprano added the comment: Are you referring to this? https://docs.python.org/3/library/tkinter.html I acknowledge that there are legitimate criticism of the tkinter docs, and its weaknesses, but you overstate your case. - Tutorials are documentation, they just aren't *reference* documentation; there are other kinds of documentation, such as Quick Start Guides, How Tos, tutorials, FAQs, man pages, doc strings, etc. - Tutorials don't necessarily belong on a wiki. - A structured list of names in the public interface is certainly nice to have, but it shouldn't be taken as the one feature that defines documentation. - That our docs "... should be the sole authoritative source" is nice to aspire to, but probably not practical in the case of tkinter. Having said all that, please do submit patches with concrete improvements. Don't feel that you must completely redesign the entire tkinter docs. Incremental improvements are welcome as well. "3rd party sites of dubious provenance and questionable accuracy" I don't think that tkdocs.com is any more dubious or questionable than anything we could write; and the tcl/tk documentation at tcl.tk is the one source of truth for tcl/tk. Tkinter is just a third-party interface to it. ---------- nosy: +steven.daprano type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 05:43:19 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 09:43:19 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624354999.0.0.259418417831.issue44468@roundup.psfhosted.org> Ken Jin added the comment: > Ken, if you feel like it, a fix should not be too complicated, right? Yup. Will's proposal is to change the try-except to: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) @Will, would you like to submit a PR for this? You'd need to sign a CLA. However, if you'd prefer I do it instead I'm happy to make the change. 3.10.0 beta 4 is releasing on 2021-07-10, so preferably we should get the change in by then. It's the last beta before the release candidates. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 05:53:42 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Jun 2021 09:53:42 +0000 Subject: [issue44486] Modules should alway have a dictionary Message-ID: <1624355622.79.0.135643740949.issue44486@roundup.psfhosted.org> New submission from Mark Shannon : It is possible to create a module without a dictionary: m = types.ModuleType.__new__(types.ModuleType) But that is the only way to create to a module without a dict; all other means of creating a module, both in Python and in the C API, result in a fully formed module. Existing code expects that modules will always have a dictionary, e.g. https://github.com/python/cpython/blob/3.10/Include/internal/pycore_moduleobject.h#L35 We should change types.ModuleType.__new__ to properly initialize the module. ---------- assignee: Mark.Shannon messages: 396316 nosy: Mark.Shannon priority: normal severity: normal status: open title: Modules should alway have a dictionary type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 06:00:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 22 Jun 2021 10:00:48 +0000 Subject: [issue44486] Modules should alway have a dictionary In-Reply-To: <1624355622.79.0.135643740949.issue44486@roundup.psfhosted.org> Message-ID: <1624356048.5.0.465240276629.issue44486@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25428 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26847 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 06:04:58 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 10:04:58 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624356298.12.0.142061810607.issue38291@roundup.psfhosted.org> Ken Jin added the comment: That specific buildbot is now green. Thanks everyone :)! https://dev.azure.com/Python/cpython/_build/results?buildId=82931&view=results I'm closing the issue now as it seems there isn't anything left to do. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 06:24:16 2021 From: report at bugs.python.org (Erik Faye-Lund) Date: Tue, 22 Jun 2021 10:24:16 +0000 Subject: [issue44487] Regression Message-ID: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> New submission from Erik Faye-Lund : This commit lead to a regression when using Meson on Windows to build the Mesa project: https://github.com/python/cpython/commit/4827483f47906fecee6b5d9097df2a69a293a85c The reason is that pathlib.read_text now uses the locale as the encoding when reading files when there's no encoding explicitly passed in. That means that C++ source files are attempted read as CP1252 on Windows, which throws exceptions when source files contain UTF-8 code-points. ---------- components: Library (Lib) messages: 396318 nosy: kusma priority: normal severity: normal status: open title: Regression versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 06:31:16 2021 From: report at bugs.python.org (Erik Faye-Lund) Date: Tue, 22 Jun 2021 10:31:16 +0000 Subject: [issue44487] Regression in pathlib.path.read_text In-Reply-To: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> Message-ID: <1624357876.09.0.771689739542.issue44487@roundup.psfhosted.org> Change by Erik Faye-Lund : ---------- title: Regression -> Regression in pathlib.path.read_text _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 06:45:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 10:45:07 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1624358707.69.0.959246095221.issue28533@roundup.psfhosted.org> Irit Katriel added the comment: There is actually one usage outside of the tests: Lib/smtpd.py There is a note in the doc saying " The aiosmtpd package is a recommended replacement for this module. It is based on asyncio and provides a more straightforward API. smtpd should be considered deprecated." https://docs.python.org/3/library/smtpd.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:10:05 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 11:10:05 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624360205.88.0.0598198606056.issue44483@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch nosy: +kj nosy_count: 1.0 -> 2.0 pull_requests: +25429 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:11:10 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 11:11:10 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624360270.42.0.130260751731.issue44483@roundup.psfhosted.org> Ken Jin added the comment: A possible simple fix is to change these lines https://github.com/python/cpython/blob/main/Objects/unionobject.c#L294-L301 to: ``` return ( is_typevar(obj) | is_new_type(obj) | is_special_form(obj) | PyType_Check(obj) | PyObject_TypeCheck(obj, &Py_GenericAliasType) | (int)(type == &_Py_UnionType)); ``` However, that may slow down union a little since we lose the short-circuiting that `||` provides over `|`, and all checks have to be evaluated. Checking each result individually and mimicking the short circuiting behavior works too, so I did that. What do you think Serhiy? ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:21:58 2021 From: report at bugs.python.org (Chris Trent) Date: Tue, 22 Jun 2021 11:21:58 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation In-Reply-To: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> Message-ID: <1624360918.66.0.791064591784.issue44485@roundup.psfhosted.org> Chris Trent added the comment: To put it bluntly, having me submit patches to that section of the docs is just about the last thing you want. I know precious little about TKinter, which is precisely why I'm calling for something more than a half-assed tutorial. Regarding using the TCL/TK docs, not happening. I don't have the time nor patience to learn a dead scripting language just to read docs, if I wanted to do that, I'd learn Javascript. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:25:22 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Tue, 22 Jun 2021 11:25:22 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624361122.61.0.203425254441.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: Ken: We still need to remove these modules in Python 3.12+. Should we open a separate issue, reopen this one, or just handle it after the Python 3.11 branch has been created? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:32:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 22 Jun 2021 11:32:50 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1624361570.72.0.478191644328.issue28533@roundup.psfhosted.org> STINNER Victor added the comment: So the first step is to decide if it's ok to remove smtpd right now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:44:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 11:44:05 +0000 Subject: [issue28533] Replace asyncore In-Reply-To: <1477420324.44.0.338895938894.issue28533@psf.upfronthosting.co.za> Message-ID: <1624362245.92.0.32363409577.issue28533@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 07:57:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 11:57:27 +0000 Subject: [issue32005] multiprocessing.Array misleading error message in slice assignment In-Reply-To: <1510357988.91.0.213398074469.issue32005@psf.upfronthosting.co.za> Message-ID: <1624363047.37.0.644347056361.issue32005@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 08:04:26 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 22 Jun 2021 12:04:26 +0000 Subject: [issue44487] Regression in pathlib.path.read_text In-Reply-To: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> Message-ID: <1624363466.99.0.414331827438.issue44487@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +methane, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 08:14:51 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 12:14:51 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1624364091.12.0.134716380923.issue38291@roundup.psfhosted.org> Ken Jin added the comment: @Sebastian, Woops, thanks for the reminder. I think both options are fine. But I'm leaning towards creating a new issue. The title of the current issue is "Deprecate the typing.io and typing.re pseudo-modules" not "Remove the typing.io and typing.re pseudo-modules" after all ;-). Jokes aside, the actual removal of a large chunk of code is usually quite contentious. And usually a lot of discussion happens when the time comes to remove it. So IMO having a separate issue for that when the time comes is better. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 08:24:26 2021 From: report at bugs.python.org (NIKDISSV) Date: Tue, 22 Jun 2021 12:24:26 +0000 Subject: [issue44488] ERROR: No matching distribution found for kivy Message-ID: <1624364666.6.0.0593631097252.issue44488@roundup.psfhosted.org> New submission from NIKDISSV : An error occurred when installing kiwi on python 3.10.0b3, on Python 3.9.5 there are no errors, but on 3.10 there are: Collecting kivy Using cached Kivy-2.0.0.tar.gz (23.7 MB) Installing build dependencies ... error ERROR: Command errored out with exit status 1: command: 'c:\users\shikardosik\appdata\local\programs\python\python310\python.exe' 'C:\Users\shikardosik\AppData\Local\Temp\pip-standalone-pip-vfw34azi\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\shikardosik\AppData\Local\Temp\pip-build-env-lxpt2_oy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.24,<=0.29.21,!=0.27,!=0.27.2' 'kivy_deps.gstreamer_dev~=0.3.1; sys_platform == "win32"' 'kivy_deps.sdl2_dev~=0.3.1; sys_platform == "win32"' 'kivy_deps.glew_dev~=0.3.0; sys_platform == "win32"' 'kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"' 'kivy_deps.sdl2~=0.3.1; sys_platform == "win32"' 'kivy_deps.glew~=0.3.0; sys_platform == "win32"' cwd: None Complete output (8 lines): Collecting setuptools Using cached setuptools-57.0.0-py3-none-any.whl (821 kB) Collecting wheel Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB) Collecting cython!=0.27,!=0.27.2,<=0.29.21,>=0.24 Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB) ERROR: Could not find a version that satisfies the requirement kivy_deps.gstreamer_dev~=0.3.1 (from versions: none) ERROR: No matching distribution found for kivy_deps.gstreamer_dev~=0.3.1 ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/12/96/091ddacafb84dd18555a32d860dbfaf9c806147aa30c6f3c8b93cb7bab97/Kivy-2.0.0.tar.gz#sha256=d25e44eb44e43762b2fd0c5874e51954e0f1181fd9800d8a6756be6d084812d8 (from https://pypi.org/simple/kivy/). Command errored out with exit status 1: 'c:\users\shikardosik\appdata\local\programs\python\python310\python.exe' 'C:\Users\shikardosik\AppData\Local\Temp\pip-standalone-pip-vfw34azi\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\shikardosik\AppData\Local\Temp\pip-build-env-lxpt2_oy\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.24,<=0.29.21,!=0.27,!=0.27.2' 'kivy_deps.gstreamer_dev~=0.3.1; sys_platform == "win32"' 'kivy_deps.sdl2_dev~=0.3.1; sys_platform == "win32"' 'kivy_deps.glew_dev~=0.3.0; sys_platform == "win32"' 'kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"' 'kivy_deps.sdl2~=0.3.1; sys_platform == "win32"' 'kivy_deps.glew~=0.3.0; sys_platform == "win32"' Check the logs for full command output. Using cached Kivy-1.11.1.tar.gz (23.6 MB) ---------- components: Installation messages: 396325 nosy: nikdissv_forever priority: normal severity: normal status: open title: ERROR: No matching distribution found for kivy type: crash versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 08:36:35 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 22 Jun 2021 12:36:35 +0000 Subject: [issue44488] ERROR: No matching distribution found for kivy In-Reply-To: <1624364666.6.0.0593631097252.issue44488@roundup.psfhosted.org> Message-ID: <1624365395.68.0.781550588468.issue44488@roundup.psfhosted.org> Mark Dickinson added the comment: I'd suggest reporting this on the kivy bug tracker: https://github.com/kivy/kivy This tracker is for the Python core language, and this doesn't look like a problem caused by a bug in Python. ---------- nosy: +mark.dickinson resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 08:57:06 2021 From: report at bugs.python.org (Ron Serruya) Date: Tue, 22 Jun 2021 12:57:06 +0000 Subject: [issue44489] _handle_existing_loggers should respect loggers that were manually disabled Message-ID: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> New submission from Ron Serruya : The method `_handle_existing_loggers` in the logging lib (called when configuring loggers using dictConfig) iterates over all existing loggers and sets their .disabled attribute according to the `disable_existing_loggers` parameter (usually set to false) However this only lets the user completely disable/enable all existing loggers, and there is no way to tell the function to keep the value to what it was This example was how I found about it 1. Imported the pkg ddtrace, which writes some logs that I'm not interested in 2. Disabled the ddtrace logger `logging.getLogger('ddtrace.internal.writer').disabled = True` 3. Imported the pkg Sanic, which configures its logging using `logging.configure.dictConfig()`, with `disable_existing_loggers` set to False, as it doesn't want to disable all of the loggers that were created before it 4. `_handle_existing_loggers` re-enabled the logger that I manually disabled before Ps. apologies if this is not the correct place, I don't really see this as a bug, more like a feature request, however the only place I found for feature requests were PEPs, which this obviously isnt ---------- components: Library (Lib) messages: 396327 nosy: ronserruya2 priority: normal severity: normal status: open title: _handle_existing_loggers should respect loggers that were manually disabled versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:05:49 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 22 Jun 2021 13:05:49 +0000 Subject: [issue44489] _handle_existing_loggers should respect loggers that were manually disabled In-Reply-To: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> Message-ID: <1624367149.57.0.906893736585.issue44489@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:16:51 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 22 Jun 2021 13:16:51 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624367811.77.0.728138420984.issue41621@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- title: defaultdict miss behave when using default_factory passed as kwargs -> Document collections.defaultdict parameter default_factory versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:29:19 2021 From: report at bugs.python.org (Erik Faye-Lund) Date: Tue, 22 Jun 2021 13:29:19 +0000 Subject: [issue44487] Regression in pathlib.path.read_text In-Reply-To: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> Message-ID: <1624368559.06.0.474479225077.issue44487@roundup.psfhosted.org> Erik Faye-Lund added the comment: After digging some more, I no longer suspect that this commit is to blame, but instead some logic in Meson that effectively disabled the problematic code under in our use-case before we upgraded our Visual Studio version. The reason is that I was able to reproduce this using Python 3.9, and as far as I can tell that doesn't contain this change. So, sorry for the noise. I'll close this, and rather reopen if I find out I'm wrong. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:29:59 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 13:29:59 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ Message-ID: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> New submission from Ken Jin : Recently I noticed that the new PEP 604 Union type doesn't collect type variables: from typing import TypeVar T = TypeVar('T') (int | list[T]).__parameters__ Traceback (most recent call last): File "", line 1, in AttributeError: 'types.Union' object has no attribute '__parameters__' Whereas the typing.Union version has __parameters__. Is this behavior intentional? The downside to this is that things like this don't work: alias: TypeAlias = int | list[T] alias[str] # Error! ---------- messages: 396329 nosy: Jelle Zijlstra, gvanrossum, kj, levkivskyi priority: normal severity: normal status: open title: PEP 604 Union (int | str) doesn't have __parameters__ versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:38:07 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Jun 2021 13:38:07 +0000 Subject: [issue44487] Regression in pathlib.path.read_text In-Reply-To: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> Message-ID: <1624369087.21.0.166409228198.issue44487@roundup.psfhosted.org> Inada Naoki added the comment: Please write a link to the original issue next time. https://github.com/mesonbuild/meson/issues/8916 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:40:22 2021 From: report at bugs.python.org (Inada Naoki) Date: Tue, 22 Jun 2021 13:40:22 +0000 Subject: [issue44487] Regression in pathlib.path.read_text In-Reply-To: <1624357456.42.0.547216936781.issue44487@roundup.psfhosted.org> Message-ID: <1624369222.84.0.0256364719055.issue44487@roundup.psfhosted.org> Inada Naoki added the comment: Another upstream issue: https://github.com/mesonbuild/meson/issues/8263 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:42:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 13:42:59 +0000 Subject: [issue26545] [doc] os.walk is limited by python's recursion limit In-Reply-To: <1457744340.04.0.931517157669.issue26545@psf.upfronthosting.co.za> Message-ID: <1624369379.21.0.0734984474045.issue26545@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: os.walk is limited by python's recursion limit -> [doc] os.walk is limited by python's recursion limit versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:49:25 2021 From: report at bugs.python.org (Felix C. Stegerman) Date: Tue, 22 Jun 2021 13:49:25 +0000 Subject: [issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds) In-Reply-To: <1616102738.26.0.451702371832.issue43547@roundup.psfhosted.org> Message-ID: <1624369765.97.0.465081757807.issue43547@roundup.psfhosted.org> Felix C. Stegerman added the comment: https://github.com/obfusk/apksigcopier currently produces reproducible ZIP files identical to those produced by apksigner using this code: DATETIMEZERO = (1980, 0, 0, 0, 0, 0) class ReproducibleZipInfo(zipfile.ZipInfo): """Reproducible ZipInfo hack.""" _override = {} # type: Dict[str, Any] def __init__(self, zinfo, **override): if override: self._override = {**self._override, **override} for k in self.__slots__: if hasattr(zinfo, k): setattr(self, k, getattr(zinfo, k)) def __getattribute__(self, name): if name != "_override": try: return self._override[name] except KeyError: pass return object.__getattribute__(self, name) class APKZipInfo(ReproducibleZipInfo): """Reproducible ZipInfo for APK files.""" _override = dict( compress_type=8, create_system=0, create_version=20, date_time=DATETIMEZERO, external_attr=0, extract_version=20, flag_bits=0x800, ) def patch_meta(...): ... with zipfile.ZipFile(output_apk, "a") as zf_out: info_data = [(APKZipInfo(info, date_time=date_time), data) for info, data in extracted_meta] _write_to_zip(info_data, zf_out) if sys.version_info >= (3, 7): def _write_to_zip(info_data, zf_out): for info, data in info_data: zf_out.writestr(info, data, compresslevel=9) else: def _write_to_zip(info_data, zf_out): old = zipfile._get_compressor zipfile._get_compressor = lambda _: zlib.compressobj(9, 8, -15) try: for info, data in info_data: zf_out.writestr(info, data) finally: zipfile._get_compressor = old ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:54:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 13:54:51 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624370091.92.0.54862181386.issue44483@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset adfa1ba398c74720b42f16f06fd3ec0353599fa5 by Ken Jin in branch 'main': bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) https://github.com/python/cpython/commit/adfa1ba398c74720b42f16f06fd3ec0353599fa5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:57:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 13:57:50 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624370270.05.0.469355647996.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 8bc26d8c9d092840054f57f9b4620de0d40d8423 by Ma Lin in branch '3.9': bpo-44439: BZ2File.write()/LZMAFile.write() handle length correctly (GH-26846) https://github.com/python/cpython/commit/8bc26d8c9d092840054f57f9b4620de0d40d8423 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 09:59:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 13:59:17 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624370357.54.0.306792337359.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your contribution Ma Lin. ---------- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:00:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 22 Jun 2021 14:00:01 +0000 Subject: [issue44439] stdlib wrongly uses len() for bytes-like object In-Reply-To: <1623906324.37.0.876825919891.issue44439@roundup.psfhosted.org> Message-ID: <1624370401.27.0.866227348566.issue44439@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 01858fbe31e8e0185edfbd3f10172f7c61391c9d by Miss Islington (bot) in branch '3.10': bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764) (GH-26845) https://github.com/python/cpython/commit/01858fbe31e8e0185edfbd3f10172f7c61391c9d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:00:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 14:00:15 +0000 Subject: [issue22654] issue with PYTHON_FOR_BUILD In-Reply-To: <1413493795.91.0.752363282337.issue22654@psf.upfronthosting.co.za> Message-ID: <1624370415.32.0.701498597251.issue22654@roundup.psfhosted.org> Irit Katriel added the comment: There has been no followup in over 6 years, so I am closing. If you are still having this problem with a current python version, please create a new issue. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:02:44 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 14:02:44 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1624370564.47.0.822382990516.issue38323@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 10.0 -> 11.0 pull_requests: +25430 pull_request: https://github.com/python/cpython/pull/26848 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:06:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 14:06:00 +0000 Subject: [issue25947] Installation problem In-Reply-To: Message-ID: <1624370760.39.0.984641998774.issue25947@roundup.psfhosted.org> Irit Katriel added the comment: Version 3.5 is no longer supported. If you are having issues installing a current version (3.9+) please create a new issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:16:37 2021 From: report at bugs.python.org (Joe) Date: Tue, 22 Jun 2021 14:16:37 +0000 Subject: [issue39232] asyncio crashes when tearing down the proactor event loop In-Reply-To: <1578335360.75.0.333919607495.issue39232@roundup.psfhosted.org> Message-ID: <1624371397.65.0.513534814217.issue39232@roundup.psfhosted.org> Joe added the comment: We are running into this all the time, ever since the Proactor became the default on Windows in 3.8. Usually it comes up when the program terminates due to an unhandled exception during a highly concurrent operation. The resulting cascade of RuntimeErrors often obscures the real reason for failure, which makes debugging more painful than it should be. But sometimes this cascade of RuntimeErrors will occur even when the program otherwise executes successfully. So it can be difficult to know if the program actually blew up or if it's just benign event loop vomit. Converting this particular error to a warning would be great, but eliminating the call to the event loop in __del__ would be even better. I understand that's easier said than done, or else ProactorBasePipeTransport wouldn't be leaning on __del__ in the first place. ---------- nosy: +lawsonjl.ornl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:19:34 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 14:19:34 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624371574.54.0.11524935801.issue41621@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25431 pull_request: https://github.com/python/cpython/pull/26850 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:19:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 22 Jun 2021 14:19:34 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624371574.26.0.614166899684.issue41621@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset d1ae57027fc39ff60dcfc1b63881400e5ca3ce56 by Dennis Sweeney in branch 'main': bpo-41621: Document defaultdict's default_factory parameter (GH-21945) https://github.com/python/cpython/commit/d1ae57027fc39ff60dcfc1b63881400e5ca3ce56 ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:19:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 14:19:40 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624371580.2.0.720863834672.issue41621@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25432 pull_request: https://github.com/python/cpython/pull/26851 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:22:34 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:22:34 +0000 Subject: [issue38829] Make the function flush_io accessible in the C-API In-Reply-To: <1573991525.07.0.835950836621.issue38829@roundup.psfhosted.org> Message-ID: <1624371754.75.0.867063701942.issue38829@roundup.psfhosted.org> Petr Viktorin added the comment: To follow up on the StackOverflow discussion: A call to PyErr_Print should invoke sys.excepthook. Unless sys.excepthook was changed, this should print the message *and* flush standard output. If it doesn't, I recommend investigating why. If that does not work, you can flush stderr with two function calls: sys_stderr = PySys_GetObject("stderr"); PyObject_CallMethodNoArgs(sys_stderr, "flush"); plus the necessary error handling if any returns NULL, of course. And/or the same thing with stdout. The flush_io function does exactly this (for both stdout and stderr). I don't think this is general enough to expose as an API -- IMO it's better to be explicit and call the flush method as above. ---------- nosy: +petr.viktorin resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:29:01 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:29:01 +0000 Subject: [issue39078] __function.__defaults__ breaks for __init__ of dataclasses with default factory In-Reply-To: <1576605114.21.0.115662739436.issue39078@roundup.psfhosted.org> Message-ID: <1624372141.22.0.543211499065.issue39078@roundup.psfhosted.org> Change by Petr Viktorin : ---------- components: +Library (Lib) -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:32:48 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 22 Jun 2021 14:32:48 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1624372368.57.0.364261176956.issue38323@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: -25430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:37:28 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 14:37:28 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624372648.61.0.917774226986.issue44483@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25433 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26852 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:38:28 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:38:28 +0000 Subject: [issue39123] PyThread_xxx() not available when using limited API In-Reply-To: <1577111024.93.0.368390768924.issue39123@roundup.psfhosted.org> Message-ID: <1624372708.83.0.381164982819.issue39123@roundup.psfhosted.org> Petr Viktorin added the comment: In Python 3.10, the functions: PyThread_allocate_lock, PyThread_exit_thread, PyThread_free_lock, PyThread_get_stacksize, PyThread_get_thread_ident, PyThread_get_thread_native_id, PyThread_init_thread, PyThread_release_lock, PyThread_set_stacksize, PyThread_start_new_thread are exported as part of the stable ABI. They were added in bpo-42545 and bpo-43795 (PEP 652). Sorry for the delay. ---------- nosy: +petr.viktorin resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:40:32 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:40:32 +0000 Subject: =?utf-8?q?=5Bissue39355=5D_The_Python_library_will_not_compile_with_a_C++?= =?utf-8?q?2020_compiler_because_the_code_uses_the_reserved_=E2=80=9Cmodul?= =?utf-8?b?ZeKAnSBrZXl3b3Jk?= In-Reply-To: <1579166721.74.0.203064876936.issue39355@roundup.psfhosted.org> Message-ID: <1624372832.18.0.0423818896435.issue39355@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:42:14 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:42:14 +0000 Subject: [issue39620] PyObject_GetAttrString and tp_getattr do not agree In-Reply-To: <1581564218.88.0.011311131475.issue39620@roundup.psfhosted.org> Message-ID: <1624372934.57.0.0994843547732.issue39620@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:42:49 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 22 Jun 2021 14:42:49 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624372969.27.0.492375863628.issue41621@roundup.psfhosted.org> miss-islington added the comment: New changeset a65df3f9fc9a51f3e8d710492aafe07b13f0be0f by Miss Islington (bot) in branch '3.9': bpo-41621: Document defaultdict's default_factory parameter (GH-21945) https://github.com/python/cpython/commit/a65df3f9fc9a51f3e8d710492aafe07b13f0be0f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:43:45 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 14:43:45 +0000 Subject: [issue39767] create multiprocessing.SharedMemory by pointing to existing memoryview In-Reply-To: <1582760791.31.0.349985357098.issue39767@roundup.psfhosted.org> Message-ID: <1624373025.74.0.625846157691.issue39767@roundup.psfhosted.org> Change by Petr Viktorin : ---------- components: +Library (Lib) -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:45:28 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 22 Jun 2021 14:45:28 +0000 Subject: [issue39078] __function.__defaults__ breaks for __init__ of dataclasses with default factory In-Reply-To: <1576605114.21.0.115662739436.issue39078@roundup.psfhosted.org> Message-ID: <1624373128.0.0.66788244944.issue39078@roundup.psfhosted.org> Eric V. Smith added the comment: I don't think there's any action to be done here, so I'm going to close this. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 10:59:21 2021 From: report at bugs.python.org (Peter V) Date: Tue, 22 Jun 2021 14:59:21 +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: <1624373961.84.0.139083984689.issue41255@roundup.psfhosted.org> Peter V added the comment: I'm new to Python bugtracker and I may misunderstand the discussion. But I think this is a real bug in argparse, not a documentation problem. My usecase was that I wanted to add argparse to a GUI application where print and exit is a wrong option. So I set `argparse.ArgumentParser(exit_on_error=False)` but I failed with that, system exited whatever I tried. Exit in this case is not an option, I expected a dedicated exception after that. Digging a bit deeper I found that I can create a custom class and overwrite the `ArgumentParser.exit(status=0, message=None)` but still, as a simple user of the standard library why should I do that? This would be a minimalist example how this can be solved in argparse code: def exit(self, status=0, message=None): if message: self._print_message(message, _sys.stderr) if self.exit_on_error: _sys.exit(status) else: raise ArgumentError(...) But considering GUI or interactive usage this is still not enough, sys.stdout and sys.stderr is written, that do not exists in GUI case, so these parts also need some re-design. ---------- nosy: +bigbird _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:00:20 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 22 Jun 2021 15:00:20 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1624374020.28.0.104947228336.issue44490@roundup.psfhosted.org> Jelle Zijlstra added the comment: I agree that this is a bug. `types.Union` is also missing a __getitem__ implementation. And `typing.Union` supports pickling while `types.Union` doesn't: >>> pickle.loads(pickle.dumps(int | str)) Traceback (most recent call last): File "", line 1, in TypeError: cannot pickle 'types.Union' object >>> pickle.loads(pickle.dumps(Union[int, str])) typing.Union[int, str] I don't have a use case for pickling types but someone might. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:40:39 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 15:40:39 +0000 Subject: [issue40939] Remove the old parser In-Reply-To: <1591788317.65.0.969058655213.issue40939@roundup.psfhosted.org> Message-ID: <1624376439.93.0.318702500998.issue40939@roundup.psfhosted.org> Change by Petr Viktorin : ---------- nosy: +petr.viktorin nosy_count: 11.0 -> 12.0 pull_requests: +25434 pull_request: https://github.com/python/cpython/pull/26855 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:41:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 15:41:43 +0000 Subject: [issue22329] Windows installer can't recover partially installed state In-Reply-To: <1409703967.84.0.334306520264.issue22329@psf.upfronthosting.co.za> Message-ID: <1624376503.93.0.831106890895.issue22329@roundup.psfhosted.org> Irit Katriel added the comment: > This does not affect Python 3.5 or later. Closing as out of date as 3.4 is no longer maintained. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:44:55 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 22 Jun 2021 15:44:55 +0000 Subject: [issue40939] Remove the old parser In-Reply-To: <1591788317.65.0.969058655213.issue40939@roundup.psfhosted.org> Message-ID: <1624376695.74.0.0691732723239.issue40939@roundup.psfhosted.org> Petr Viktorin added the comment: - The removed functions are still listed in the documentation; this is confusing. - `struct _node` is not very usable in the C API, but what I saw in mod_wsgi was giving gave PyParser_* output to PyNode_Compile. I tried to write porting notes for this usage. It should also help with the "compile to check for syntax errors" case in unbound. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:46:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 15:46:20 +0000 Subject: [issue24425] Installer Vender Issue In-Reply-To: <1433951061.45.0.0884040195007.issue24425@psf.upfronthosting.co.za> Message-ID: <1624376780.55.0.903541503713.issue24425@roundup.psfhosted.org> Irit Katriel added the comment: Closing as 3.4 and 2.7 are no longer maintained and the installer was rewritten for 3.5. ---------- nosy: +iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:47:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 15:47:45 +0000 Subject: [issue24499] Python Installer text piles up during installation process In-Reply-To: <1435161571.8.0.161419365704.issue24499@psf.upfronthosting.co.za> Message-ID: <1624376865.73.0.343074636807.issue24499@roundup.psfhosted.org> Irit Katriel added the comment: Version 3.5 is no longer maintained. Are you seeing this in current (3.9+) versions? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:55:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Jun 2021 15:55:18 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1624377318.41.0.357621764444.issue44490@roundup.psfhosted.org> Guido van Rossum added the comment: Let's first see whether the type (int | list[T]) is accepted by static checkers. IMO introspecting unions should be done by looking at __args__, nothing more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 11:57:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 15:57:13 +0000 Subject: [issue22782] Python 3.4.2 Windows installer - cannot install 32 bit then 64 bit version In-Reply-To: <1414865378.95.0.654751043147.issue22782@psf.upfronthosting.co.za> Message-ID: <1624377433.37.0.843466555608.issue22782@roundup.psfhosted.org> Irit Katriel added the comment: Steve, if this was fixed post-3.4 can we close this? ---------- nosy: +iritkatriel status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 12:13:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 16:13:50 +0000 Subject: [issue24836] Consistent failure in test_email on OS X Snow Leopard buildbot for Python 3.5 In-Reply-To: <1439116162.62.0.659790998501.issue24836@psf.upfronthosting.co.za> Message-ID: <1624378430.92.0.780760232847.issue24836@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 12:24:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 16:24:42 +0000 Subject: [issue12681] unittest expectedFailure could take a message argument like skip does In-Reply-To: <1312285316.59.0.648531105022.issue12681@psf.upfronthosting.co.za> Message-ID: <1624379082.79.0.695269307284.issue12681@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 12:29:49 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 22 Jun 2021 16:29:49 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624379389.58.0.870098300574.issue40528@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 35ad425866d591c33d7f2be2b9da8bce2bff9523 by Batuhan Taskaya in branch 'main': bpo-40528: Implement a metadata system for ASDL Generator (GH-20193) https://github.com/python/cpython/commit/35ad425866d591c33d7f2be2b9da8bce2bff9523 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 13:31:42 2021 From: report at bugs.python.org (Andre Roberge) Date: Tue, 22 Jun 2021 17:31:42 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624383102.06.0.671490953559.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: I can confirm that, if the existing line type, value, tb = sys.exc_info() in pyshell.ModifiedInterpreter.showsyntaxerror is replaced by e_type, value, tb = sys.exc_info() err = str((type(e_type).__name__, *value)+'\n' linecache.cache[""] = (len(err), 0, [err], "") then all the required information to analyze the cause of the error can be retrieved using rpc. ==== Aside: In doing various tests, I noticed that "IndentationError" are simply reported as "SyntaxError" in Idle, since at least Python 3.6. This is just a cosmetic issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 13:52:31 2021 From: report at bugs.python.org (E. Paine) Date: Tue, 22 Jun 2021 17:52:31 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation In-Reply-To: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> Message-ID: <1624384351.5.0.348965526035.issue44485@roundup.psfhosted.org> E. Paine added the comment: > full, complete, useful documentation of everything Please see msg384022 on why I'm personally against such changes. I was working on 'translating' the Tk man pages into something (hopefully) understandable by tkinter users (as reference documentation), however lost steam after completing only ~2/3 of the canvas methods (due to the size of such a project). > at bare minimum a structured list of all names exposed by the module's public interface Like Steven, I think this would probably be a helpful change, however, this is of limited use without an accompanying description. ---------- nosy: +epaine _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 14:03:09 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 22 Jun 2021 18:03:09 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624384989.29.0.8335740482.issue40528@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25435 pull_request: https://github.com/python/cpython/pull/26858 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 14:14:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 22 Jun 2021 18:14:45 +0000 Subject: [issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton. In-Reply-To: <1621659583.31.0.989908134751.issue44213@roundup.psfhosted.org> Message-ID: <1624385685.28.0.294801118006.issue44213@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25436 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26859 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 14:18:01 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 22 Jun 2021 18:18:01 +0000 Subject: [issue44213] LIST_TO_TUPLE placed below the sentence "all of the following use their opcodes" in dis library documentaiton. In-Reply-To: <1621659583.31.0.989908134751.issue44213@roundup.psfhosted.org> Message-ID: <1624385881.13.0.588159975365.issue44213@roundup.psfhosted.org> Andrei Kulakov added the comment: I think the arg to dict_merge was just missing, I've put up a PR that adds it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 14:20:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 18:20:04 +0000 Subject: [issue16386] imp.find_module does not specify registry key it searches on windows In-Reply-To: <1351859767.89.0.815277454803.issue16386@psf.upfronthosting.co.za> Message-ID: <1624386004.38.0.420931469623.issue16386@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 14:58:45 2021 From: report at bugs.python.org (Norman Lorrain) Date: Tue, 22 Jun 2021 18:58:45 +0000 Subject: [issue28661] Fix code example in Python 3.5 telnetlib documentation In-Reply-To: <1478805391.59.0.11862034954.issue28661@psf.upfronthosting.co.za> Message-ID: <1624388325.4.0.907449199422.issue28661@roundup.psfhosted.org> Norman Lorrain added the comment: How about a simpler example (this relies on an outside service, fwiw) See attached file. ---------- nosy: +Norman Lorrain Added file: https://bugs.python.org/file50124/weather.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 15:10:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Jun 2021 19:10:18 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624389018.08.0.536335150978.issue44482@roundup.psfhosted.org> Guido van Rossum added the comment: So this is a problem because the generator owns a resource that it will only release once its .close() method is called, right? And we have no control over when that happens -- we can't make it the responsibility of list() to close the iterator passed into it. It is indeed a painful thing. I wonder if we should put a warning somewhere in the docs and tutorials for generators? The PR looks good. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 15:36:39 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 22 Jun 2021 19:36:39 +0000 Subject: [issue22782] Python 3.4.2 Windows installer - cannot install 32 bit then 64 bit version In-Reply-To: <1414865378.95.0.654751043147.issue22782@psf.upfronthosting.co.za> Message-ID: <1624390599.96.0.388456251027.issue22782@roundup.psfhosted.org> Zachary Ware added the comment: Yes, this is out of date. ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:04:48 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 22 Jun 2021 20:04:48 +0000 Subject: [issue44485] TKinter docs page does not provide actual documentation In-Reply-To: <1624351377.85.0.40142939191.issue44485@roundup.psfhosted.org> Message-ID: <1624392288.35.0.919360466858.issue44485@roundup.psfhosted.org> Zachary Ware added the comment: I'm closing this as a duplicate of bpo-42560 (and probably several others). Chris: in short, we know the Tkinter docs are incomplete and we welcome improvements to them, but it costs just as much to say "I don't have the time to spend on this" as it does to say "you have to make this easier for me for free" :). As far as using the official Tk docs for Tkinter: their documentation is fairly comprehensive and easily translatable, because Tkinter as a translation layer tries to be as thin as possible. You don't have to know Tcl to use their documentation beyond some very basic syntax. To add full documentation of Tkinter, we would basically have to copy all of Tk's documentation. At that point, it feels pretty pointless to do so when we can just point there in the first place (as we already do). ---------- nosy: +zach.ware resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Improve Tkinter Documentation _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:09:50 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Tue, 22 Jun 2021 20:09:50 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624392590.05.0.784163885267.issue44297@roundup.psfhosted.org> Shreyan Avigyan added the comment: Here presumably the error is occurring somewhere near unittest. I've tested this and wrote a minimal reproducible example. ``` import unittest class TestingError(unittest.TestCase): def test_negative_one(self): with self.assertRaisesRegex(AssertionError, "xxxxx"): self.assertEqual(1, 2) ``` Running this with `unittest discover` or in any other command-line way (like -c) results in frame with -1 while running it from script (with unittest.main probably) does not. Hope this helps. ---------- nosy: +shreyanavigyan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:28:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 20:28:48 +0000 Subject: [issue20859] Context of documentation for conditional expressions In-Reply-To: <1394131680.82.0.565875959506.issue20859@psf.upfronthosting.co.za> Message-ID: <1624393728.04.0.512519067868.issue20859@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.3, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:31:48 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 22 Jun 2021 20:31:48 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash In-Reply-To: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> Message-ID: <1624393908.85.0.631843252636.issue44140@roundup.psfhosted.org> Andrei Kulakov added the comment: Maybe I am misunderstanding, but if an object is deleted, and another object created with the same ID, wouldn't WeakRefDict now be pointing to the wrong object? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:44:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 20:44:15 +0000 Subject: [issue24466] extend_path explanation in documentation is ambiguous In-Reply-To: <1434637996.53.0.698059319376.issue24466@psf.upfronthosting.co.za> Message-ID: <1624394655.33.0.232955531911.issue24466@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 16:46:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 20:46:20 +0000 Subject: [issue25050] windows installer does not allow 32 and 64 installs side by side In-Reply-To: <1441873383.62.0.21526123437.issue25050@psf.upfronthosting.co.za> Message-ID: <1624394780.89.0.87498027681.issue25050@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python 3.4.2 Windows installer - cannot install 32 bit then 64 bit version _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:01:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 22 Jun 2021 21:01:15 +0000 Subject: [issue43918] anext builtin docstring has no signature text or info about default argument In-Reply-To: <1619148606.41.0.129428714687.issue43918@roundup.psfhosted.org> Message-ID: <1624395675.95.0.237830145475.issue43918@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 6af4e6b266cb19d646ad7e4051fc7974c3096d23 by Erik Welch in branch 'main': bpo-43918: document signature and default argument of `anext` builtin (#25551) https://github.com/python/cpython/commit/6af4e6b266cb19d646ad7e4051fc7974c3096d23 ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:16:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:16:18 +0000 Subject: [issue27074] Confusing text about __all__ in __init__.py in tutorial In-Reply-To: <1463816705.73.0.630465423608.issue27074@psf.upfronthosting.co.za> Message-ID: <1624396578.47.0.735829139453.issue27074@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:25:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:25:38 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624397138.55.0.44897024492.issue28395@roundup.psfhosted.org> Irit Katriel added the comment: The patch needs to be converted to a github PR. ---------- keywords: +easy nosy: +iritkatriel title: Remove unnecessary semicolons -> Remove unnecessary semicolons in tests versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:31:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:31:52 +0000 Subject: [issue28953] Use `raise from` when raising new IncompleteRead In-Reply-To: <1481578993.98.0.52471260982.issue28953@psf.upfronthosting.co.za> Message-ID: <1624397512.61.0.0501923797433.issue28953@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:34:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:34:27 +0000 Subject: [issue29422] add socket independent timeout to httplib/http.client read In-Reply-To: <1486054294.14.0.838994744532.issue29422@psf.upfronthosting.co.za> Message-ID: <1624397667.28.0.276361264495.issue29422@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:41:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:41:50 +0000 Subject: [issue30889] distutils extra_link_args not working because it is added to cmd last. should before -llibs In-Reply-To: <1499662616.73.0.0979391647369.issue30889@psf.upfronthosting.co.za> Message-ID: <1624398110.78.0.524116370222.issue30889@roundup.psfhosted.org> Irit Katriel added the comment: Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools ---------- components: +Distutils nosy: +dstufft, eric.araujo, iritkatriel stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 17:56:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 21:56:34 +0000 Subject: [issue32079] version install 3.6.3 hangs in test_socket In-Reply-To: <1511155515.69.0.213398074469.issue32079@psf.upfronthosting.co.za> Message-ID: <1624398994.15.0.865650520092.issue32079@roundup.psfhosted.org> Irit Katriel added the comment: There isn't enough information here to know what the cause was, and version 3.6 is no longer maintained. So I am closing the issue and request that you create a new one 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 Tue Jun 22 18:04:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:04:34 +0000 Subject: [issue32855] Add documention stating supported Platforms In-Reply-To: <1518748416.8.0.467229070634.issue32855@psf.upfronthosting.co.za> Message-ID: <1624399474.66.0.774700395235.issue32855@roundup.psfhosted.org> Irit Katriel added the comment: We have this: https://pythondev.readthedocs.io/platforms.html ---------- nosy: +iritkatriel resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:06:11 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:06:11 +0000 Subject: [issue32948] clang compiler warnings on Travis In-Reply-To: <1519565319.33.0.467229070634.issue32948@psf.upfronthosting.co.za> Message-ID: <1624399571.12.0.427815640627.issue32948@roundup.psfhosted.org> Irit Katriel added the comment: 2.7-specific issue. ---------- nosy: +iritkatriel resolution: -> out of date stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:13:28 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:13:28 +0000 Subject: [issue23316] Incorrect evaluation order of function arguments with *args In-Reply-To: <1422200816.31.0.910655700205.issue23316@psf.upfronthosting.co.za> Message-ID: <1624400008.01.0.480096535307.issue23316@roundup.psfhosted.org> Irit Katriel added the comment: See also issue33492. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:20:43 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:20:43 +0000 Subject: [issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg In-Reply-To: <1534102337.9.0.56676864532.issue34389@psf.upfronthosting.co.za> Message-ID: <1624400443.82.0.335948417102.issue34389@roundup.psfhosted.org> Irit Katriel added the comment: Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools ---------- components: +Distutils nosy: +dstufft, eric.araujo, iritkatriel resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:27:04 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 22 Jun 2021 22:27:04 +0000 Subject: [issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg In-Reply-To: <1534102337.9.0.56676864532.issue34389@psf.upfronthosting.co.za> Message-ID: <1624400824.76.0.976695113671.issue34389@roundup.psfhosted.org> ?ric Araujo added the comment: This one is about Python?s build itself, that still uses parts of distutils, so probably should stay open if reproducible. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:30:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:30:59 +0000 Subject: [issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg In-Reply-To: <1534102337.9.0.56676864532.issue34389@psf.upfronthosting.co.za> Message-ID: <1624401059.44.0.134327074883.issue34389@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: out of date -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:39:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:39:05 +0000 Subject: [issue41636] distutils.util.strtobool documented behaviour In-Reply-To: <1598402882.51.0.310018876035.issue41636@roundup.psfhosted.org> Message-ID: <1624401545.62.0.440420729323.issue41636@roundup.psfhosted.org> Irit Katriel added the comment: Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils. If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools ---------- components: +Distutils nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:48:08 2021 From: report at bugs.python.org (Brett Cannon) Date: Tue, 22 Jun 2021 22:48:08 +0000 Subject: [issue20109] TestProgram is mentioned in the unittest docs but is not documented In-Reply-To: <1388685707.72.0.688331916968.issue20109@psf.upfronthosting.co.za> Message-ID: <1624402088.35.0.818545807034.issue20109@roundup.psfhosted.org> Change by Brett Cannon : ---------- nosy: +brett.cannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:50:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 22:50:24 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1624402224.22.0.283956686588.issue35183@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) keywords: +easy versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 18:57:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 22 Jun 2021 22:57:35 +0000 Subject: [issue20178] Derby #9: Convert 52 sites to Argument Clinic across 11 files In-Reply-To: <1389140078.91.0.720761635456.issue20178@psf.upfronthosting.co.za> Message-ID: <1624402655.76.0.730964057683.issue20178@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, sqlite3 was converted to Argument Clinic in bpo-40956. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:11:30 2021 From: report at bugs.python.org (Will Chen) Date: Tue, 22 Jun 2021 23:11:30 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624403490.3.0.622890690921.issue44468@roundup.psfhosted.org> Change by Will Chen : ---------- keywords: +patch pull_requests: +25437 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:30:45 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 22 Jun 2021 23:30:45 +0000 Subject: [issue44491] [sqlite3] allow clearing the authoriser callback Message-ID: <1624404645.88.0.222168479229.issue44491@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, it is possible to clear both the sqlite3 trace callback and progress handler by passing 'None' as the callback/handler, however it is not possible to clear the authoriser callback. Suggesting to allow clearing the authoriser callback with set_authorizer(None). See also https://sqlite.org/c3ref/set_authorizer.html ---------- assignee: erlendaasland components: Extension Modules messages: 396374 nosy: erlendaasland priority: low severity: normal status: open title: [sqlite3] allow clearing the authoriser callback type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:30:48 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 22 Jun 2021 23:30:48 +0000 Subject: [issue32855] Add documention stating supported Platforms In-Reply-To: <1518748416.8.0.467229070634.issue32855@psf.upfronthosting.co.za> Message-ID: <1624404648.17.0.594299410124.issue32855@roundup.psfhosted.org> Ned Deily added the comment: While there's is useful information on that web page, I don't think it is a satisfactory answer to what I believe is being requrested here, namely, "How do I determine to what extent platform X is supported by cPython?" First, the information on the web pate is somewhat out-of-date. But more importantly, the web page is not part of the official Python documentation or python.org web site. If we are going to better document what we support and in a way that implies some commitment on behalf of the cPython project, it needs to be published under the review and ultimate control of the steering council, like all other official documentation. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:31:37 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 22 Jun 2021 23:31:37 +0000 Subject: [issue44491] [sqlite3] allow clearing the authoriser callback In-Reply-To: <1624404645.88.0.222168479229.issue44491@roundup.psfhosted.org> Message-ID: <1624404697.78.0.265673370332.issue44491@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25438 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26863 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:33:18 2021 From: report at bugs.python.org (Will Chen) Date: Tue, 22 Jun 2021 23:33:18 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624404798.59.0.88027765607.issue44468@roundup.psfhosted.org> Will Chen added the comment: I opened a PR with a fix and a couple comments on its method: https://github.com/python/cpython/pull/26862 I also *think* I signed the CLA correctly. Not sure. I used my login name here, rather than my Github login, but my account is linked. Didn't add any blurb/changelog notes. Would that be needed? Thanks for looking at this issue quickly! Let me know if there's anything else I can or should do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:34:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 22 Jun 2021 23:34:21 +0000 Subject: [issue32855] Add documention stating supported Platforms In-Reply-To: <1518748416.8.0.467229070634.issue32855@psf.upfronthosting.co.za> Message-ID: <1624404861.48.0.846302590844.issue32855@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: works for me -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 19:53:18 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 22 Jun 2021 23:53:18 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1624405998.13.0.665230427914.issue43977@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +25439 pull_request: https://github.com/python/cpython/pull/26864 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 20:43:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 00:43:03 +0000 Subject: [issue41636] distutils.util.strtobool documented behaviour In-Reply-To: <1598402882.51.0.310018876035.issue41636@roundup.psfhosted.org> Message-ID: <1624408983.17.0.710219142847.issue41636@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 20:52:48 2021 From: report at bugs.python.org (Phil Thompson) Date: Wed, 23 Jun 2021 00:52:48 +0000 Subject: [issue44492] Building a C extension on Big Sur and SDK v10.15 fails Message-ID: <1624409568.36.0.590312520398.issue44492@roundup.psfhosted.org> New submission from Phil Thompson : I am running macOS v11 (Big Sur) and using Xcode v12.1 (because this is the latest that includes SDK v10.15 rather than v11) to build a C extension. I'm using the older SDK because of 3rd party libraries that are not tested against the newer SDK. This version of Xcode/SDK does not support universal2 binaries. However because _supports_arm64_builds() in _osx_support only tests the macOS version and not the SDK version it returns True which means that distutils does not call compiler_fixup() to remove the '-arch arm64'. The compilation then fails. Should this work, or does Python v3.10 require SDK v11? ---------- components: Distutils messages: 396377 nosy: dstufft, eric.araujo, philthompson10 priority: normal severity: normal status: open title: Building a C extension on Big Sur and SDK v10.15 fails type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 22:47:14 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 23 Jun 2021 02:47:14 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1624416434.54.0.216522122133.issue44175@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 4.0 -> 5.0 pull_requests: +25440 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26865 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 22:50:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 23 Jun 2021 02:50:12 +0000 Subject: [issue44175] What do "cased" and "uncased" mean? In-Reply-To: <1621395940.01.0.564984916212.issue44175@roundup.psfhosted.org> Message-ID: <1624416612.34.0.324206390325.issue44175@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up a PR that adds a footnote, clarifies 'uncased' meaning and also adds notes in regard to discrepancy between standard publishing definition of "title case" and what we use in the four title-related methods. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 23:08:23 2021 From: report at bugs.python.org (ty) Date: Wed, 23 Jun 2021 03:08:23 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un Message-ID: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> New submission from ty : https://github.com/python/cpython/blob/main/Modules/socketmodule.c#L1700 ---------- components: Library (Lib) messages: 396379 nosy: zonyitoo priority: normal severity: normal status: open title: Missing terminated NUL in the length of sockaddr_un type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 23:09:22 2021 From: report at bugs.python.org (ty) Date: Wed, 23 Jun 2021 03:09:22 +0000 Subject: [issue44493] Missing terminated NUL in the length of sockaddr_un In-Reply-To: <1624417703.28.0.996748207886.issue44493@roundup.psfhosted.org> Message-ID: <1624417762.61.0.416812690542.issue44493@roundup.psfhosted.org> Change by ty : ---------- keywords: +patch pull_requests: +25441 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26866 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 22 23:29:41 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 03:29:41 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst Message-ID: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> New submission from Jack DeVries : I made a proposal on discourse to redraft Doc/library/__main__.rst as it is currently quite terse and there have been a series of bpo's asking for more. See my discourse post: https://discuss.python.org/t/proposed-overhaul-of-main-py-documentation-doc-library-main-rst/9344 ================ There have been many complaints about the shortcoming of the documentation towards informing users about __main__. Both the popular __name__ == '__main__' construct, and the role of __main__.py in a python module. bpo-17359 bpo-24632 bpo-38452 I propose a broad overhaul of Doc/library/__main__.rst to address these shortcomings and to provide a single source of truth on __main__ (in general!). This is an appropriate place to put this information. Both the __name__ == '__main__' and fooModule/__main__.py constructs reasonably fall under the category of ?Python Runtime Services,? because they both control the way that programs run depending on how they are used (command-line versus import versus running directly). The new Doc/library/__main__.rst should have a new synopsis of, ?CLIs, import-time behavior, and if __name__ == ?__main__??, reflecting its new and broader focus. Additionally, the new docs should have the following distinct sections: Differentiating between __name__ == ?__main__? and __main.__.py __main__.py and the -m flag (this is roughly what is there already, although it?s not as descriptive as it should be). __name__ and the if __name__ == '__main__' construct. If there is interest, I would be happy to open uptake this work on as soon as there is consensus around this plan. I?m looking forward to hearing what you think! ================ Anyway, I have a first draft ready. I'm sure there will be plenty of feedback, so let it rip! I will open a GitHub PR and attach it to this bpo in just a moment. ---------- assignee: docs at python components: Documentation messages: 396380 nosy: docs at python, jack__d priority: normal severity: normal status: open title: Overhaul of Doc/library/__main__.rst 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 Tue Jun 22 23:35:28 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 03:35:28 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624419328.0.0.718760615731.issue44494@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25442 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26867 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 02:15:19 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 06:15:19 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624428919.1.0.861030203603.issue28395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 nosy_count: 3.0 -> 4.0 pull_requests: +25443 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26868 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 02:22:13 2021 From: report at bugs.python.org (Maarten Derickx) Date: Wed, 23 Jun 2021 06:22:13 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624429333.12.0.228010333139.issue24339@roundup.psfhosted.org> Maarten Derickx added the comment: Is there any way to contact John Helour? I would still very much like to put this package on github and pypi. And would like to ask him permission for licensing. Or is there some standard open source license under which all code uploaded to https://bugs.python.org/ can automatically be distributed? https://www.python.org/about/legal/ seems to indicate so, but doesn't mention an explicit license just the things you can do with it. ---------- nosy: +koffie _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 02:55:14 2021 From: report at bugs.python.org (Maciej Misiak) Date: Wed, 23 Jun 2021 06:55:14 +0000 Subject: [issue44495] wrong FNAME in tarfile if tgz extension is used Message-ID: <1624431314.4.0.407283752721.issue44495@roundup.psfhosted.org> New submission from Maciej Misiak : This code is incomplete: def _init_write_gz(self): ... if self.name.endswith(".gz"): self.name = self.name[:-3] # RFC1952 says we must use ISO-8859-1 for the FNAME field. self.__write(self.name.encode("iso-8859-1", "replace") + NUL) If it is used in following way '.gz' is stripped properly and FNAME='somefile.tar': tarfile.open('somefile.tar.gz', 'w:gz') but with tarfile.open('somefile.tgz', 'w:gz') FNAME is incorrectly prepared as somefile.tgz ---------- components: Library (Lib) messages: 396382 nosy: maciej.mm.misiak priority: normal severity: normal status: open title: wrong FNAME in tarfile if tgz extension is used 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 Jun 23 03:26:04 2021 From: report at bugs.python.org (Aschwin) Date: Wed, 23 Jun 2021 07:26:04 +0000 Subject: [issue44496] string.Formatter class not allowing {.field} Message-ID: <1624433164.24.0.876705812645.issue44496@roundup.psfhosted.org> New submission from Aschwin : I expected the custom Formatter to behave the same as the normal "".format() function, but unnamed args or not supported. Below is an example, which fails at a KeyError. from string import Formatter class test(): def __init__(self): self.msg = "OK" t = test() print("Normal format() is {.msg}".format(t)) f = Formatter() print(f.format("Formatter.format() is {.msg}", t)) ---------- components: Library (Lib) messages: 396383 nosy: avdwoude priority: normal severity: normal status: open title: string.Formatter class not allowing {.field} type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 03:49:39 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 23 Jun 2021 07:49:39 +0000 Subject: [issue44489] _handle_existing_loggers should respect loggers that were manually disabled In-Reply-To: <1624366626.62.0.782556758458.issue44489@roundup.psfhosted.org> Message-ID: <1624434579.24.0.57552285877.issue44489@roundup.psfhosted.org> Change by Vinay Sajip : ---------- type: -> enhancement versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:08:57 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Wed, 23 Jun 2021 08:08:57 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624435737.18.0.219711007106.issue24339@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: Maarten, the code posted on bugs is copyrighted by the person who wrote it. We can only accept it for inclusion in Python after the CLA has been signed, since then we are allowed to relicense it. As a result you can only take John's code and post it elsewhere, if John permits you to do so, since the files don't include a license. Note: Creating a character map based codec is not hard using gencodec.py from the Tools/unicode/ dir and perhaps some added extra logic. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:11:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 23 Jun 2021 08:11:38 +0000 Subject: [issue44496] string.Formatter class not allowing {.field} In-Reply-To: <1624433164.24.0.876705812645.issue44496@roundup.psfhosted.org> Message-ID: <1624435898.33.0.0380982142454.issue44496@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:27:13 2021 From: report at bugs.python.org (kryheb) Date: Wed, 23 Jun 2021 08:27:13 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624436833.94.0.26990535953.issue44441@roundup.psfhosted.org> kryheb added the comment: Hi vstinner, I apologize for the inaccurate code sample. Please find a simplified example without threads `inittab-bug_no-threads.c` in attachments. Please notice that __main__.py has changed, there is no infinite loop anymore. Steps to reproduce: 1. Append embedded module 2. Initialize Python from config with run_filename 3. Run main 4. Finalize 5. Repeat all above Observed behavior: The script is executed at the first iteration, but re-initialization fails with a segmentation fault: gdb) r Starting program: /home/kheb/proj/tmp/pyc/a.out [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Run Python Script >>> This is the python script Python Script completed (0) Program received signal SIGSEGV, Segmentation fault. __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65 65 VPCMPEQ (%rdi), %ymm0, %ymm1 Missing separate debuginfos, use: dnf debuginfo-install libxcrypt-4.4.20-2.fc33.x86_64 (gdb) bt #0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65 #1 0x00007ffff7d039f0 in PyUnicode_FromString ( u=0xdddddddddddddddd ) at Objects/unicodeobject.c:2309 #2 0x00007ffff7dbf049 in list_builtin_module_names () at ./Python/sysmodule.c:2056 #3 0x00007ffff7dc1777 in _PySys_InitCore (tstate=tstate at entry=0x422ac0, sysdict=sysdict at entry=0x7fffea221070) at ./Python/sysmodule.c:2813 #4 0x00007ffff7dc36ef in _PySys_Create (tstate=tstate at entry=0x422ac0, sysmod_p=sysmod_p at entry=0x7fffffffd9d8) at ./Python/sysmodule.c:3087 #5 0x00007ffff7da9b32 in pycore_interp_init (tstate=0x422ac0) at Python/pylifecycle.c:824 #6 0x00007ffff7da9c8e in pyinit_config (runtime=runtime at entry=0x7ffff7fbe820 <_PyRuntime>, tstate_p=tstate_p at entry=0x7fffffffdca8, config=config at entry=0x7fffffffdac0) at Python/pylifecycle.c:866 #7 0x00007ffff7daba3e in pyinit_core (runtime=runtime at entry=0x7ffff7fbe820 <_PyRuntime>, src_config=src_config at entry=0x7fffffffdd40, tstate_p=tstate_p at entry=0x7fffffffdca8) at Python/pylifecycle.c:1029 #8 0x00007ffff7dabb18 in Py_InitializeFromConfig (config=0x7fffffffdd40) at Python/pylifecycle.c:1214 #9 0x00000000004012d3 in main (argc=1, argv=0x7fffffffdfc8) at inittab-bug_no-threads.c:45 I hope this example helps. Best regards, Krystian ---------- Added file: https://bugs.python.org/file50125/inittab-bug_no-threads.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:33:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 08:33:52 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624437232.08.0.681298091724.issue44494@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +cameron _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:37:19 2021 From: report at bugs.python.org (Karolina Surma) Date: Wed, 23 Jun 2021 08:37:19 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624437439.36.0.255499140893.issue44426@roundup.psfhosted.org> Karolina Surma added the comment: It looks good on my end, documentation builds just fine. Thank you! ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:46:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 08:46:07 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624437967.89.0.0605433221064.issue44494@roundup.psfhosted.org> Irit Katriel added the comment: Hi Jack, I'm not sure it's necessary to create a new issue for "Overhaul of Doc/library/__main__.rst" when we already have Issue39452 to "Improve the __main__ module documentation" and Issue24632 to "Improve documentation about __main__.py". What we really need to is close all but one of them as duplicates and consolidate the work. Also, the people who are on the nosy lists of the previous issues will not necessarily see the discussion you opened on this one if you won't alert them to it. Have you looked at the open PR on issue39452? I think there may be some overlap with what you did here (but I didn't check in any detail). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:46:44 2021 From: report at bugs.python.org (Phil Thompson) Date: Wed, 23 Jun 2021 08:46:44 +0000 Subject: [issue44492] Building a C extension on Big Sur and SDK v10.15 fails In-Reply-To: <1624409568.36.0.590312520398.issue44492@roundup.psfhosted.org> Message-ID: <1624438004.05.0.966244852624.issue44492@roundup.psfhosted.org> Phil Thompson added the comment: Another aspect of this is when building a Python v3.10 C extension on macOS v10.15 (Catalina) with SDK 10.15, the wheel has the 'universal2' platform tag when it actually only contains an x86_64 implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:49:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 08:49:35 +0000 Subject: [issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1624438175.34.0.0820593906937.issue39947@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25444 pull_request: https://github.com/python/cpython/pull/26869 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:59:16 2021 From: report at bugs.python.org (Janus) Date: Wed, 23 Jun 2021 08:59:16 +0000 Subject: [issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths In-Reply-To: <1387347011.06.0.0464883312921.issue20012@psf.upfronthosting.co.za> Message-ID: <1624438756.56.0.165130672853.issue20012@roundup.psfhosted.org> Janus added the comment: This issue is being addressed in #40358 which has open PR for v3.11 ---------- nosy: +Japanuspus _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 04:59:12 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Wed, 23 Jun 2021 08:59:12 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624438752.3.0.2378449001.issue44297@roundup.psfhosted.org> Shreyan Avigyan added the comment: Oh it is also occurring when running from script (I ran it from IDLE and it always results in correct lineno). I wrote example similar to how unittests work and the frame with -1 lineno is also occurring there. Here is the code - ``` class A: def __enter__(self): return self def __exit__(self, *args, **kwargs): raise Exception("Frame is -1 if program is run from command line") with A(): raise Exception("Normal Error") ``` Also, unsurprisingly, pdb fails with a "TypeError: '>=' not supported between instances of 'NoneType' and 'int'". Full pdb log - Traceback (most recent call last): File "C:\Users\shrey\Desktop\line_negative_one.py", line -1, in File "C:\github\cpython\lib\bdb.py", line 96, in trace_dispatch return self.dispatch_exception(frame, arg) File "C:\github\cpython\lib\bdb.py", line 169, in dispatch_exception if self.stop_here(frame): File "C:\github\cpython\lib\bdb.py", line 212, in stop_here return frame.f_lineno >= self.stoplineno TypeError: '>=' not supported between instances of 'NoneType' and 'int' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:00:51 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 23 Jun 2021 09:00:51 +0000 Subject: [issue44486] Modules should alway have a dictionary In-Reply-To: <1624355622.79.0.135643740949.issue44486@roundup.psfhosted.org> Message-ID: <1624438851.79.0.646438308662.issue44486@roundup.psfhosted.org> Mark Shannon added the comment: New changeset c3f52b4d707a78eb342372a2be00f3eb846a05b9 by Mark Shannon in branch 'main': bpo-44486: Make sure that modules always have a dictionary. (GH-26847) https://github.com/python/cpython/commit/c3f52b4d707a78eb342372a2be00f3eb846a05b9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:01:10 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 09:01:10 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624438870.5.0.155147887359.issue28395@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 5a3108044d2e5b694da2d1f4176c9bbaef15c142 by Dong-hee Na in branch 'main': bpo-28395: Remove unnecessary semicolons in tests (GH-26868) https://github.com/python/cpython/commit/5a3108044d2e5b694da2d1f4176c9bbaef15c142 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:01:26 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 09:01:26 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624438886.97.0.923157791797.issue28395@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25445 pull_request: https://github.com/python/cpython/pull/26870 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:01:32 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 09:01:32 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624438892.77.0.425173130215.issue28395@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25446 pull_request: https://github.com/python/cpython/pull/26871 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:12:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 23 Jun 2021 09:12:41 +0000 Subject: [issue44426] Docs fail to build with Sphinx 4 due to Invalid C declaration In-Reply-To: <1623760949.4.0.2341930076.issue44426@roundup.psfhosted.org> Message-ID: <1624439561.86.0.921094978202.issue44426@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks! Closing. ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:20:31 2021 From: report at bugs.python.org (Sorin Sbarnea) Date: Wed, 23 Jun 2021 09:20:31 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) Message-ID: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> New submission from Sorin Sbarnea : As the results of investigating a very poor performance of pip while trying to install some code I was able to identify that the root cause was the current implementation of distutils.filelist.findall or to be more precise the _find_all_simple function, which does followsymlinks but without any measures for preventing recursivity and duplicates. To give an idea in my case it was taking 5-10minutes to run while the CPU was at 100%, for a repository with 95k files (most of them temp inside .tox folders). Removal of the symlinks did make it run in ~5s. IMHO, _find_all_simple should normalize paths and avoid returning any duplicates. Realted: https://bugs.launchpad.net/pbr/+bug/1933311 ---------- components: Distutils messages: 396394 nosy: dstufft, eric.araujo, ssbarnea priority: normal severity: normal status: open title: distutil findall can choke with recursive symlinks (performance) versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:20:53 2021 From: report at bugs.python.org (Sorin Sbarnea) Date: Wed, 23 Jun 2021 09:20:53 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) In-Reply-To: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> Message-ID: <1624440053.45.0.145798669727.issue44497@roundup.psfhosted.org> Change by Sorin Sbarnea : ---------- type: -> performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:39:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 09:39:21 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624441161.64.0.190745884186.issue44483@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 7e6cad7e303b3991360a0fe332b0d21aa0f6fe5e by Miss Islington (bot) in branch '3.10': bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) (GH-26852) https://github.com/python/cpython/commit/7e6cad7e303b3991360a0fe332b0d21aa0f6fe5e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:44:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 09:44:12 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624441452.0.0.728976385655.issue44483@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes, Checking each result individually is a right way. Not only because performance, but because calling any Python code while an error is set will cause a crash in debug build and weird bugs in release build. It is better to return as fast as you have an error. Thank you for your PR Ken Jin. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:53:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 09:53:40 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624442020.83.0.746480339173.issue44482@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 5c7940257e1f611e7284fd504887bd29a63d0a94 by Serhiy Storchaka in branch 'main': bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843) https://github.com/python/cpython/commit/5c7940257e1f611e7284fd504887bd29a63d0a94 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:53:48 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 09:53:48 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624442028.8.0.163175084671.issue44482@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25447 pull_request: https://github.com/python/cpython/pull/26872 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:55:58 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 23 Jun 2021 09:55:58 +0000 Subject: [issue44483] Fatal error in type union In-Reply-To: <1624343546.88.0.657403133793.issue44483@roundup.psfhosted.org> Message-ID: <1624442158.27.0.435742813813.issue44483@roundup.psfhosted.org> Ken Jin added the comment: Oh, that's a good point too. Thanks for the explanation, reviews and merge Serhiy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 05:59:42 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 09:59:42 +0000 Subject: [issue44498] remove deprecated smtpd from the stdlib Message-ID: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> New submission from Irit Katriel : smtpd uses asynchat which has been deprecated since 3.6. See discussion at https://mail.python.org/archives/list/python-committers at python.org/thread/KNF6YQE2O4OLJDNKSGAT4NLZUNCQ5QSH/#KNF6YQE2O4OLJDNKSGAT4NLZUNCQ5QSH ---------- messages: 396399 nosy: iritkatriel, vstinner priority: normal severity: normal status: open title: remove deprecated smtpd from the stdlib versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:00:09 2021 From: report at bugs.python.org (Sorin Sbarnea) Date: Wed, 23 Jun 2021 10:00:09 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) In-Reply-To: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> Message-ID: <1624442409.19.0.295825337411.issue44497@roundup.psfhosted.org> Change by Sorin Sbarnea : ---------- keywords: +patch pull_requests: +25448 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26873 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:00:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 10:00:15 +0000 Subject: [issue44498] remove deprecated smtpd from the stdlib In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624442415.66.0.516215323889.issue44498@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: -> iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:02:44 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 10:02:44 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624442564.19.0.473708294141.issue28395@roundup.psfhosted.org> miss-islington added the comment: New changeset 280425d41797f9c0b20fb02a22341937a13a8987 by Miss Islington (bot) in branch '3.10': bpo-28395: Remove unnecessary semicolons in tests (GH-26868) https://github.com/python/cpython/commit/280425d41797f9c0b20fb02a22341937a13a8987 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:03:03 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 10:03:03 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624442583.62.0.787799836144.issue28395@roundup.psfhosted.org> miss-islington added the comment: New changeset fcde2c6a8c99a56576b25733d5cc60bce6d51f46 by Miss Islington (bot) in branch '3.9': bpo-28395: Remove unnecessary semicolons in tests (GH-26868) https://github.com/python/cpython/commit/fcde2c6a8c99a56576b25733d5cc60bce6d51f46 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:03:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 10:03:16 +0000 Subject: [issue28395] Remove unnecessary semicolons in tests In-Reply-To: <1476082177.89.0.151508255977.issue28395@psf.upfronthosting.co.za> Message-ID: <1624442596.5.0.702872283007.issue28395@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:07:39 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:07:39 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624442859.41.0.329248432364.issue44482@roundup.psfhosted.org> Serhiy Storchaka added the comment: Yes. I added you Guido to the nosy list to attract attention to a general issue. If the generator owns resources, it should be guaranteed closed. Since generator do not support the context manager protocol, we need to use closing(). Using generators is common in the code on my work, so I am going to revise all uses of resource-owning generators in my work code, in the stdlib and in common libraries like aiohttp. May be we will add a decorator for generator functions which would add support of the context manager protocol. Or make generator objects supporting the context manager protocol by default. Or make the with statement fall back to the close() method by default. Or even add special syntax shortcut for combining "with" and "for" if this idiom will be common enough. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:18:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 10:18:10 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624443490.57.0.286601057955.issue44498@roundup.psfhosted.org> Irit Katriel added the comment: There are some tests that use asynchat, asyncore and smtpd so we first move them to test.support and document their removal from the stdlib. ---------- title: remove deprecated smtpd from the stdlib -> move deprecated asynchat, asyncore and smtpd from the stdlib to test.support _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:26:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 10:26:22 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624443982.29.0.448617923601.issue44441@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25449 pull_request: https://github.com/python/cpython/pull/26874 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:27:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 10:27:18 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624444038.5.0.583455458083.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: Thanks for inittab-bug_no-threads.c reproducer. I managed to reproduce the issue and I wrote PR 26767 to fix with a regression test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:27:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 10:27:56 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624444076.42.0.910472244192.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: Oh, I didn't notice your PR 26767 fix! Thanks. I wrote PR 26874 which includes the same fix, but adds also a regression test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:28:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:28:12 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624444092.06.0.278836071987.issue44482@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 38e021ab90b595945f15c59273c788f2f24053dc by Miss Islington (bot) in branch '3.10': bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843) (GH-26872) https://github.com/python/cpython/commit/38e021ab90b595945f15c59273c788f2f24053dc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:30:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:30:27 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624444227.98.0.273961854961.issue44404@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset e9c8f784fa13ea3a51df3b72a498a3896ec9e768 by E-Paine in branch 'main': bpo-44404: tkinter `after` support callable classes (GH-26812) https://github.com/python/cpython/commit/e9c8f784fa13ea3a51df3b72a498a3896ec9e768 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:34:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:34:48 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624444488.82.0.967851684729.issue44404@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is on borderline between new feature and bugfix (depends on your interpretation of the documentation), so I decided to backport it to not yet released 3.10, but not to 3.9 which has been already used for a year. ---------- stage: patch review -> type: behavior -> enhancement versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:41:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:41:12 +0000 Subject: [issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths In-Reply-To: <1387347011.06.0.0464883312921.issue20012@psf.upfronthosting.co.za> Message-ID: <1624444872.26.0.223925336611.issue20012@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pathlib's relative_to should behave like os.path.relpath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 06:41:51 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 10:41:51 +0000 Subject: [issue42234] pathlib relative_to behaviour change In-Reply-To: <1604245703.4.0.361207259352.issue42234@roundup.psfhosted.org> Message-ID: <1624444911.49.0.309706727156.issue42234@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pathlib's relative_to should behave like os.path.relpath _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 07:04:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 11:04:06 +0000 Subject: [issue20859] Context of documentation for conditional expressions In-Reply-To: <1394131680.82.0.565875959506.issue20859@psf.upfronthosting.co.za> Message-ID: <1624446246.65.0.383254327587.issue20859@roundup.psfhosted.org> Serhiy Storchaka added the comment: > "and exponentiation and conditional expressions, which group from right to left". LGTM > "Python evaluates expressions from left to right (except for conditional expressions)." LGTM. It would be nice to add also examples for conditional and assignment expressions. > Should 'except for lambda' be added to the end of the sentence? Yes, lambda and assignment expressions have lower priority. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 07:09:04 2021 From: report at bugs.python.org (Antony Lee) Date: Wed, 23 Jun 2021 11:09:04 +0000 Subject: [issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg In-Reply-To: <1534102337.9.0.56676864532.issue34389@psf.upfronthosting.co.za> Message-ID: <1624446544.61.0.584500525278.issue34389@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 07:10:25 2021 From: report at bugs.python.org (Antony Lee) Date: Wed, 23 Jun 2021 11:10:25 +0000 Subject: [issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths In-Reply-To: <1387347011.06.0.0464883312921.issue20012@psf.upfronthosting.co.za> Message-ID: <1624446625.03.0.734367537122.issue20012@roundup.psfhosted.org> Change by Antony Lee : ---------- nosy: -Antony.Lee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 07:57:21 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 11:57:21 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624449441.83.0.423776951035.issue44494@roundup.psfhosted.org> Jack DeVries added the comment: @iritkatriel, ok, I will close this issue, close PR26867, and move the work I have over there. I probably can merge in and build upon the work from the contributor on bpo-39452. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 07:57:29 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 11:57:29 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624449449.71.0.0102764831199.issue44494@roundup.psfhosted.org> Change by Jack DeVries : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:01:57 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 12:01:57 +0000 Subject: [issue44496] string.Formatter class not allowing {.field} In-Reply-To: <1624433164.24.0.876705812645.issue44496@roundup.psfhosted.org> Message-ID: <1624449717.1.0.614891816158.issue44496@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:07:01 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 12:07:01 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1624450021.04.0.146324376716.issue42064@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 019ad62afd20e80c74f879aa716e339b992a0bb9 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Remove stale extern declarations in `sqlite3` headers (GH-26840) https://github.com/python/cpython/commit/019ad62afd20e80c74f879aa716e339b992a0bb9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:08:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 12:08:25 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624450105.51.0.633307858295.issue44498@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +25451 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26875 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:11:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:11:32 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() In-Reply-To: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> Message-ID: <1624450292.94.0.387033087718.issue44237@roundup.psfhosted.org> STINNER Victor added the comment: https://github.com/python/cpython/pull/26874/checks?check_run_id=2893904059 ERROR: test_connect_cadata (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2131, in test_connect_cadata s.connect(self.server_addr) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1379, in connect self._real_connect(addr, False) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1370, in _real_connect self.do_handshake() File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1346, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:11:26 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 12:11:26 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624450286.42.0.934335712123.issue44494@roundup.psfhosted.org> Irit Katriel added the comment: That's a good plan! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:13:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:13:31 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624450411.66.0.949683183995.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 489699ca05bed5cfd10e847d8580840812b476cd by Victor Stinner in branch 'main': bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) https://github.com/python/cpython/commit/489699ca05bed5cfd10e847d8580840812b476cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:16:07 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 12:16:07 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1624450567.15.0.0303540477247.issue42862@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25452 pull_request: https://github.com/python/cpython/pull/26876 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:16:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:16:50 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624450610.54.0.0574084722875.issue44441@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25453 pull_request: https://github.com/python/cpython/pull/26877 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:21:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:21:24 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624450884.44.0.415735183211.issue44441@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25454 pull_request: https://github.com/python/cpython/pull/26878 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:27:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:27:42 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1624451262.01.0.884178389926.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25455 pull_request: https://github.com/python/cpython/pull/26879 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:33:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 12:33:22 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1624451602.72.0.172584553321.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25456 pull_request: https://github.com/python/cpython/pull/26880 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:55:48 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 23 Jun 2021 12:55:48 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624452948.63.0.724966738809.issue44498@roundup.psfhosted.org> Barry A. Warsaw added the comment: +1 for removal ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 08:57:00 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 12:57:00 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1624453020.14.0.982884900871.issue42064@roundup.psfhosted.org> miss-islington added the comment: New changeset a50e28377bcf37121b55c2de70d95a5386c478f8 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 (GH-26745) https://github.com/python/cpython/commit/a50e28377bcf37121b55c2de70d95a5386c478f8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:04:36 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 13:04:36 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1624453476.18.0.377037700123.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25457 pull_request: https://github.com/python/cpython/pull/26881 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:18:18 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 13:18:18 +0000 Subject: [issue44499] [sqlite3] make sqlite3.Connection exception refs strong Message-ID: <1624454298.48.0.88024552275.issue44499@roundup.psfhosted.org> New submission from Erlend E. Aasland : Currently, pysqlite_Connection keeps borrowed references to all the sqlite3 exception types. Suggesting to convert these to strong refs. See comments on GH-26745: https://github.com/python/cpython/pull/26745#issuecomment-866810269 ---------- assignee: erlendaasland components: Extension Modules messages: 396417 nosy: erlendaasland, petr.viktorin priority: normal severity: normal status: open title: [sqlite3] make sqlite3.Connection exception refs strong type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:24:21 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 23 Jun 2021 13:24:21 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624454661.27.0.114970783718.issue44498@roundup.psfhosted.org> Petr Viktorin added the comment: Please follow the backwards compatibility policy (PEP 387): - Have a discussion - Raise deprecation warnings - Wait at least two minor Python versions where warnings are raised - Consider any feedback - Then remove stuff (Or ask the SC for an exception, but these "are only granted for extreme situations such as dangerously broken or insecure features or features no one could reasonably be depending on".) There were no deprecation warnings raised so far, so removing these in 3.11 is very premature. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:29:51 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 23 Jun 2021 13:29:51 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624454991.06.0.0315392219974.issue44498@roundup.psfhosted.org> Christian Heimes added the comment: I'm with Petr, please follow PEP 4 and PEP 387. At a bare minimum you should have one minor Python version with deprecation warnings. You could ask Pablo if he allows to add deprecation warnings to Python 3.10 beta. ---------- nosy: +christian.heimes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:40:37 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 13:40:37 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1624455637.12.0.759829190786.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 2a396d65b8e63300ff05e217adacf0765c502ba3 by Victor Stinner in branch 'main': bpo-43770: Cleanup PyModuleDef_Init() (GH-26879) https://github.com/python/cpython/commit/2a396d65b8e63300ff05e217adacf0765c502ba3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 09:51:55 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 13:51:55 +0000 Subject: [issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API) In-Reply-To: <1584035214.47.0.672795796186.issue39947@roundup.psfhosted.org> Message-ID: <1624456315.53.0.205405169443.issue39947@roundup.psfhosted.org> STINNER Victor added the comment: New changeset db532a09990c837ec1348e6e6bd2719f5d4a8216 by Victor Stinner in branch 'main': bpo-39947: Remove old private trashcan C API functions (GH-26869) https://github.com/python/cpython/commit/db532a09990c837ec1348e6e6bd2719f5d4a8216 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:04:34 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 23 Jun 2021 14:04:34 +0000 Subject: [issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module In-Reply-To: <1610066343.94.0.466682345605.issue42862@roundup.psfhosted.org> Message-ID: <1624457074.15.0.859888972789.issue42862@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 34356a0a4bad0be124ae892cda6c30a38f5f1061 by Erlend Egeberg Aasland in branch 'main': bpo-42862: Strip stale sqlite3 cache ignores from c-analyzer (GH-26876) https://github.com/python/cpython/commit/34356a0a4bad0be124ae892cda6c30a38f5f1061 ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:31:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 23 Jun 2021 14:31:58 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624458718.78.0.104301344786.issue44482@roundup.psfhosted.org> Guido van Rossum added the comment: I think this may be worth bringing up on python-dev. The solution currently is rather verbose. I like adding the with-protocol to generators. ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:37:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 14:37:13 +0000 Subject: [issue44480] test_compile killed by signal 9 on AMD64 FreeBSD Non-Debug 3.x In-Reply-To: <1624316683.45.0.985202182274.issue44480@roundup.psfhosted.org> Message-ID: <1624459033.22.0.304544651965.issue44480@roundup.psfhosted.org> STINNER Victor added the comment: https://buildbot.python.org/all/#/builders/172/builds/399 test_sequence_unpacking_error (test.test_compile.TestSpecifics) ... ok test_single_statement (test.test_compile.TestSpecifics) ... ok test_stack_overflow (test.test_compile.TestSpecifics) ... *** Signal 9 Stop. make: stopped in /usr/home/buildbot/python/3.x.koobs-freebsd-9e36.nondebug/build program finished with exit code 1 elapsedTime=835.734730 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:56:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Jun 2021 14:56:36 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624460196.76.0.679530768998.issue44229@roundup.psfhosted.org> Terry J. Reedy added the comment: Two GHI test macOS failures yesterday, once on main, this is on 3.10 backport https://github.com/python/cpython/pull/26850/checks?check_run_id=2885797677 ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2180, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2377, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1527, in get_server_certificate with create_connection(addr, timeout=timeout) as sock: File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 844, in create_connection raise err File "/Users/runner/work/cpython/cpython/Lib/socket.py", line 832, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused So far reported (including #44237) ConnectionRefusedError in test_get_server_certificate X many test_msg_callback_deadlock_bpo43577 test_get_server_certificate_sni ConnectionResetError: test_connect_cadata Please, please, skip the randomly failing tests, as is done for other modules. This has been going on a month now. It waste other people's time, making merging more painful. ---------- priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:58:40 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Jun 2021 14:58:40 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624460320.9.0.0848346192747.issue41621@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 88a3342314c8b9ff40a2b6fd4759cfbf64712c67 by Miss Islington (bot) in branch '3.10': bpo-41621: Document defaultdict's default_factory parameter (GH-21945) https://github.com/python/cpython/commit/88a3342314c8b9ff40a2b6fd4759cfbf64712c67 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 10:59:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Jun 2021 14:59:34 +0000 Subject: [issue41621] Document collections.defaultdict parameter default_factory In-Reply-To: <1598209446.58.0.105121459433.issue41621@roundup.psfhosted.org> Message-ID: <1624460374.8.0.643158060599.issue41621@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 Jun 23 11:47:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 15:47:43 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624463263.41.0.67779155076.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: New changeset ece3841d3ddf38875b997eb919488cbb911a66e2 by Victor Stinner in branch '3.10': bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877) https://github.com/python/cpython/commit/ece3841d3ddf38875b997eb919488cbb911a66e2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 11:47:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 15:47:43 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624463263.03.0.510612964158.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 5ed7827b1620f5b3729bc9767158d24a33863fa9 by Victor Stinner in branch '3.9': bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26878) https://github.com/python/cpython/commit/5ed7827b1620f5b3729bc9767158d24a33863fa9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 11:48:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Wed, 23 Jun 2021 15:48:43 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624463323.37.0.934108717641.issue44441@roundup.psfhosted.org> STINNER Victor added the comment: Thanks kryheb for your bug report, reproducer and your fix! The bug should now be fixed in 3.9, 3.10 and main branches. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 11:57:52 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 23 Jun 2021 15:57:52 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624463872.34.0.145205993376.issue44297@roundup.psfhosted.org> Mark Shannon added the comment: Thanks for the reproducer. ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:09:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 23 Jun 2021 16:09:56 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624464596.1.0.210851181151.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Although I simphatise with the frustration and I would really like to skip them myself, as a release manager I am quite concerned that skip them would masks an actual regression, as these failures are not present in previous versions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:33:40 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 23 Jun 2021 16:33:40 +0000 Subject: [issue44486] Modules should alway have a dictionary In-Reply-To: <1624355622.79.0.135643740949.issue44486@roundup.psfhosted.org> Message-ID: <1624466020.35.0.375591536361.issue44486@roundup.psfhosted.org> Change by Mark Shannon : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:35:35 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 23 Jun 2021 16:35:35 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624466135.88.0.0982786484906.issue44470@roundup.psfhosted.org> Change by Mark Dickinson : ---------- nosy: -mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:37:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 23 Jun 2021 16:37:14 +0000 Subject: [issue44500] Document changes to code object. Message-ID: <1624466234.05.0.483369758939.issue44500@roundup.psfhosted.org> New submission from Mark Shannon : We are making lots of changes to the code object. We should clearly document all the changes in one place and explain the new design well before 3.11 beta. ---------- assignee: docs at python components: Documentation messages: 396432 nosy: Mark.Shannon, docs at python, eric.snow, gvanrossum priority: normal severity: normal status: open title: Document changes to code object. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:51:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 23 Jun 2021 16:51:51 +0000 Subject: [issue43693] Logically merge cell and locals array. They are already contiguous in memory In-Reply-To: <1617276830.47.0.331349599371.issue43693@roundup.psfhosted.org> Message-ID: <1624467111.65.0.856120725031.issue43693@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 769d7d0c66c5b86e2dd29b9ce67ac2daaab1bb38 by Guido van Rossum in branch 'main': bpo-43693 Get rid of CO_NOFREE -- it's unused (GH-26839) https://github.com/python/cpython/commit/769d7d0c66c5b86e2dd29b9ce67ac2daaab1bb38 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:52:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 23 Jun 2021 16:52:26 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624467146.06.0.101223051809.issue44404@roundup.psfhosted.org> Terry J. Reedy added the comment: I was thinking the same. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 12:59:29 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 16:59:29 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624467569.12.0.756563251031.issue40620@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy title: Range tutorial shorthand could be made clearer -> [doc] Range tutorial shorthand could be made clearer versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 13:25:50 2021 From: report at bugs.python.org (Will Chen) Date: Wed, 23 Jun 2021 17:25:50 +0000 Subject: [issue41515] typing.get_type_hints generates KeyError In-Reply-To: <1597067038.73.0.335844562656.issue41515@roundup.psfhosted.org> Message-ID: <1624469150.1.0.319296719245.issue41515@roundup.psfhosted.org> Change by Will Chen : ---------- nosy: +WCA nosy_count: 6.0 -> 7.0 pull_requests: +25458 pull_request: https://github.com/python/cpython/pull/26862 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 13:35:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 17:35:57 +0000 Subject: [issue36243] Python os.listdir fails with FileNotFoundError when directory exists In-Reply-To: <1552065778.9.0.101043375175.issue36243@roundup.psfhosted.org> Message-ID: <1624469757.39.0.581690230866.issue36243@roundup.psfhosted.org> Irit Katriel added the comment: Geoff, it's been over two years. Do you think there is a chance you will want to follow up with a reproducer, or shall we close this issue? ---------- nosy: +iritkatriel status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 13:35:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 17:35:57 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624469757.45.0.570340669533.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Has these issues (ConnectionRefusedError/ConnectionResetError during handshake) been reported on other systems than macOS? AFAICS, they've only been reported for the macOS CI. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 13:59:44 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 23 Jun 2021 17:59:44 +0000 Subject: [issue44498] move deprecated asynchat, asyncore and smtpd from the stdlib to test.support In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624471184.65.0.0660656082451.issue44498@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- pull_requests: +25459 pull_request: https://github.com/python/cpython/pull/26882 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:05:20 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 18:05:20 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624471520.09.0.993097976847.issue44498@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: move deprecated asynchat, asyncore and smtpd from the stdlib to test.support -> add deprecation warnings for asynchat, asyncore and smtpd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:13:42 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 23 Jun 2021 18:13:42 +0000 Subject: [issue44501] Packing constant call arguments Message-ID: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> New submission from Batuhan Taskaya : It is a common scenario to make calls with only constant arguments (e.g to datetime.datetime/os.path.join/re.match.group/nox.session.run etc) and the bytecode that we currently generate looks like this; f(1,2,3,4,5,6) 1 0 LOAD_NAME 0 (f) 2 LOAD_CONST 0 (1) 4 LOAD_CONST 1 (2) 6 LOAD_CONST 2 (3) 8 LOAD_CONST 3 (4) 10 LOAD_CONST 4 (5) 12 LOAD_CONST 5 (6) 14 CALL_FUNCTION 6 16 POP_TOP 18 LOAD_CONST 6 (None) 20 RETURN_VALUE But if we are sure that all arguments to a function is positional* (it is also possible to support keyword arguments to some extent, needs more research, but out of the scope for this particular optimization) and constant, then we could simply pack everything together and use CALL_FUNCTION_EX (we also need to set some limits, since when it is too little might prevent constant cache, and when it is too high might create giant tuples in the code object, perhaps 75 > N > 4) 1 0 LOAD_NAME 0 (f) 2 LOAD_CONST 0 ((1, 2, 3, 4, 5, 6)) 4 CALL_FUNCTION_EX 0 6 POP_TOP 8 LOAD_CONST 1 (None) 10 RETURN_VALUE The implementation is also very simple, and doesn't even touch anywhere beside the ast optimizer itself. It is possible to do this in the compiler, but that might complicate the logic so I'd say it is best to keep it as isolated as it can be. (debug builds) -s 'foo = lambda *args: None' 'foo("yyyyy", 123, 123321321312, (1,2,3), "yyyyy", 1.0, (1,2,3), "yyyyy", "yyyyy", (1,2,3), 5, 6, 7)' Mean +- std dev: [master_artificial] 251 ns +- 2 ns -> [optimized_artificial] 185 ns +- 1 ns: 1.36x faster -s 'from datetime import datetime' 'datetime(1997, 7, 27, 12, 10, 0, 0)' Mean +- std dev: [master_datetime] 461 ns +- 1 ns -> [optimized_datetime] 386 ns +- 2 ns: 1.19x faster One other potential candidate to this optimization is doing something similar in the CFG optimizer, and folding all contiguous LOAD_CONSTs (within some sort of limit ofc) into a single tuple load and then adding an UNPACK_SEQUENCE (which would replicate the effect). This is a poorer form, and I was only able to observe a speedup of 1.13x / 1.03x respectively on the benchmarks. The good thing about that optimization was that, first it was able to work with mixed parameters (so if you have some other types of expressions besides constants, but all constants follow each other, then it was able to optimize that case as well) and also it wasn't only for calls but rather all compiler cases where LOAD_CONST blocks were generated. ---------- assignee: BTaskaya components: Interpreter Core messages: 396437 nosy: BTaskaya, Mark.Shannon, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Packing constant call arguments type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:19:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 18:19:04 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624472344.67.0.688147571391.issue44498@roundup.psfhosted.org> Change by Irit Katriel : ---------- assignee: iritkatriel -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:28:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 23 Jun 2021 18:28:56 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1624472936.61.0.618064770695.issue44490@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:30:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 23 Jun 2021 18:30:10 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624473010.72.0.912627628931.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Only on MacOS afaik ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:33:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 23 Jun 2021 18:33:29 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624473209.51.0.696628577137.issue44498@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm fine with a 3.10 backport as long as this is mentioned in python-dev to give time for folks to raise concerns. Additionally, please make sure that: *The test site runs with -Werror as these warnings may make it fail so tests may need to be adapted. * This deprecation is covered in the 3.10 what's new document. * There is enough time for people to raise objections to the inclusion in 3.10 (so don't merge immediately after mentioning in python-dwv ;) ) ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 14:34:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 23 Jun 2021 18:34:26 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1624473266.71.0.847227326999.issue44501@roundup.psfhosted.org> Serhiy Storchaka added the comment: > folding all contiguous LOAD_CONSTs (within some sort of limit ofc) into a single tuple load and then adding an UNPACK_SEQUENCE I already experimented with this in issue33325. It does not worth an effort. For optimizing calls with constant arguments, it looks more interesting. Do you have any statistic about what percentage of calls is with constant arguments, what is the average number of constant arguments, what are microbenchmark results in debug mode for the average number of constant arguments? Please test for trivial Python function with variable and fixed number of parameters. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:01:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 19:01:36 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624474896.67.0.737469711628.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-33450. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:02:05 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 23 Jun 2021 19:02:05 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624474925.92.0.197821310705.issue44498@roundup.psfhosted.org> Irit Katriel added the comment: Pablo, to be clear - my understanding is that the question to python-dev is not whether to deprecate or not (they have been deprecated for a long time), but only whether to issue the warning in 3.10 or 3.11. Is that correct? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:18:02 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 23 Jun 2021 19:18:02 +0000 Subject: [issue43564] ftp tests in test_urllib2net should skip on unreachable network In-Reply-To: <1616188869.43.0.436044106244.issue43564@roundup.psfhosted.org> Message-ID: <1624475882.47.0.329302876944.issue43564@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:25:40 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 19:25:40 +0000 Subject: [issue44494] Overhaul of Doc/library/__main__.rst In-Reply-To: <1624418981.72.0.882162459841.issue44494@roundup.psfhosted.org> Message-ID: <1624476340.25.0.249716563819.issue44494@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25461 pull_request: https://github.com/python/cpython/pull/26883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:25:39 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 19:25:39 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624476339.99.0.319744314059.issue39452@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 6.0 -> 7.0 pull_requests: +25460 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26883 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:28:25 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 19:28:25 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624476505.75.0.873121369603.issue39452@roundup.psfhosted.org> Jack DeVries added the comment: Hi All, As I wrote on the PR:: I am picking up the torch on 39452, continuing where @maggyero left off, and also implementing my discourse proposal, which seemed to be well-liked. Feel free to leave any feedback for me on the GitHub PR, I'm looking forward to continuing to develop this work based on community feedback. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:28:36 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 23 Jun 2021 19:28:36 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624476516.9.0.800713713906.issue39452@roundup.psfhosted.org> Change by Jack DeVries : ---------- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:33:32 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 23 Jun 2021 19:33:32 +0000 Subject: [issue39452] Improve the __main__ module documentation In-Reply-To: <1579960807.69.0.285569916248.issue39452@roundup.psfhosted.org> Message-ID: <1624476812.8.0.535993059597.issue39452@roundup.psfhosted.org> Change by Zachary Ware : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:40:42 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 23 Jun 2021 19:40:42 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1624477242.42.0.942780430737.issue44501@roundup.psfhosted.org> Batuhan Taskaya added the comment: > I already experimented with this in issue33325. It does not worth an effort. Yea, that is what the results for the CFG optimization shows to me (1.13x at best, ~1.03x in real cases). > For optimizing calls with constant arguments, it looks more interesting. Do you have any statistic about what percentage of calls is with constant arguments, what is the average number of constant arguments, what are microbenchmark results in debug mode for the average number of constant arguments? Please test for trivial Python function with variable and fixed number of parameters. Okay, addressing multiple points here (with the common dataset of a couple thousand pypi projects) >> Do you have any statistic about what percentage of calls is with constant arguments Since calls are the most common operation (?) in the language, the percentage might seem low since the total number is just absurd: 0.6840838575699993% (96170/14058218) of all calls are made with positional only constant arguments (LEN(args) >= 3, not including 1 or 2 arguments). >> what is the average number of constant arguments > stats = {3: 69533, 4: 10867, 5: 9071, 6: 4323, 7: 1504, 8: 252, 9: 167, ...} > np.average(list(stats.keys()), weights=list(stats.values())) > 3.5765623375272955 points me out the result of 3.57 arguments, which is rounded to 4. >> what are microbenchmark results in debug mode for the average number of constant arguments? -s 'f = lambda *s: None' 'f(1,2,3,4)' 3 arguments: 1.01x faster 4 arguments: 1.05x faster 5 arguments: 1.08x faster 6 arguments: 1.11x faster 7 arguments: 1.13x faster 8 arguments: 1.16x faster 9 arguments: 1.30x faster 10 arguments: 1.32x faster (there seems to be something special about 9, since it breaks the chart about the speedups) An interesting (and potentially something related to the nature of datetime.datetime being implemented in C) benchmark is that instead of calling an empty python function, if we switch to datetime.datetime the early speed-up goes 1.13x for even 3 arguments! -s 'from datetime import datetime' 'datetime(1,2,3)' 3 arguments: 1.13x faster 4 arguments: 1.15x faster 5 arguments: 1.16x faster 6 arguments: 1.17x faster 7 arguments: 1.20x faster Another really good example is re.match().group() (I assume this is also implemented in C, so some sort of CALL_FUNCTION_EX magic) -s 'import re; group = re.match("(a)(a)(a)(a)(a)(a)(a)(a)", "a" * 8).group' 'group(0,1,2)' 3 arguments: 1.25x faster (seems to be the general speed-up) 4 arguments: 1.26x faster 5 arguments: 1.24x faster 6 arguments: 1.23x faster 7 arguments: 1.24x faster 8 arguments: 1.24x faster 9 arguments: 1.27x faster These all can be verified by simply running the same code but wrapping all arguments as a tuple and expanding them (generates the same code) (e.g: -s 'import re; group = re.match("(a)(a)(a)(a)(a)(a)(a)(a)", "a" * 8).group' 'group(*(0,1,2,3,4,5,6,7,8))' would perform as fast as the optimized one) >> Please test for trivial Python function with variable and fixed number of parameters. I already shared the variable one, so this is the results for a fixed one; -s 'def foo(a, b, c): pass' 'foo(1,2,3)' 3 arguments: 1.03x faster 4 arguments: 1.07x faster 5 arguments: 1.10x faster 6 arguments: 1.13x faster 7 arguments: 1.17x faster 8 arguments: 1.20x faster 9 arguments: 1.36x faster (consistent with the other jump) Here is the list of functions that I've found to be called with only constant arguments (very raw!): https://gist.github.com/isidentical/099da256f2a46d13cef8570e839a2cea Overall I believe it shows a great improvement for little-to-none change on the codebase (especially for C-level functions). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 15:48:46 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Wed, 23 Jun 2021 19:48:46 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1624477726.31.0.664929234129.issue44501@roundup.psfhosted.org> Batuhan Taskaya added the comment: Here is my branch for the reference (I didn't worked on about it much, so still lacks some error handling etc); https://github.com/isidentical/cpython/blob/b556d1172b08c65b88093f7ff1dadc985ce72f62/Python/ast_opt.c#L634-L698 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 16:11:41 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 20:11:41 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1624479101.26.0.884676073384.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25462 pull_request: https://github.com/python/cpython/pull/26884 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 16:18:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 23 Jun 2021 20:18:46 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624479526.43.0.647928335292.issue44498@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > but only whether to issue the warning in 3.10 or 3.11. Is that correct? Correct. It can also be mentioned in a more general message as long as people know that this is the plan and they have a chance to voice any concern to start on 3.10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 17:17:34 2021 From: report at bugs.python.org (Greg Neagle) Date: Wed, 23 Jun 2021 21:17:34 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1624483054.96.0.438583922039.issue42514@roundup.psfhosted.org> Greg Neagle added the comment: While checking this issue hoping there might be updates, I realized that I didn't share a link to the script I use to convert python.org's Python framework into one that can be relocated. It's here: https://github.com/gregneagle/relocatable-python ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 17:17:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 21:17:46 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624483066.79.0.0960275070139.issue43988@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25463 pull_request: https://github.com/python/cpython/pull/26885 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 18:09:35 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 22:09:35 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624486175.95.0.961150565309.issue43988@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: fixed -> status: closed -> open versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 19:23:42 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 23 Jun 2021 23:23:42 +0000 Subject: [issue43553] [sqlite3] Improve test coverage In-Reply-To: <1616146827.28.0.306861710818.issue43553@roundup.psfhosted.org> Message-ID: <1624490622.28.0.465719985736.issue43553@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25464 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26886 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 19:46:33 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 23 Jun 2021 23:46:33 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624491993.85.0.813800332682.issue43988@roundup.psfhosted.org> miss-islington added the comment: New changeset 0a3452e7cf00c51ab1af0f674b670520b09f0e39 by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757) (GH-26885) https://github.com/python/cpython/commit/0a3452e7cf00c51ab1af0f674b670520b09f0e39 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 22:42:12 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 24 Jun 2021 02:42:12 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624502532.87.0.0254621292266.issue44452@roundup.psfhosted.org> Eric V. Smith added the comment: You should bring this up on the python-ideas mailing list if you want some discussion. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 23:02:24 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 24 Jun 2021 03:02:24 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624503744.25.0.701149680644.issue44470@roundup.psfhosted.org> Josh Rosenberg added the comment: I just visited the link, and it's now *mostly* English, but with random bits of Korean in it (mostly in links and section headers). The first warning block for instance begins: ??: The parser module is deprecated... Then a few paragraphs later I'm told: For full information on the language syntax, refer to ??? ?? ????. where the Korean is a hyperlink to the Python Language Reference. Very strange. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 23 23:09:57 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Thu, 24 Jun 2021 03:09:57 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash In-Reply-To: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> Message-ID: <1624504197.17.0.371701241145.issue44140@roundup.psfhosted.org> Josh Rosenberg added the comment: Andrei: If designed appropriately, a weakref callback attached to the actual object would delete the associated ID from the dictionary when the object was being deleted to avoid that problem. That's basically how WeakKeyDictionary works already; it doesn't store the object itself (if it did, that strong reference could never be deleted), it just stores a weak reference for it that ensures that when the real object is deleted, a callback removes the weak reference from the WeakKeyDictionary; this just adds another layer to that work. I don't think this would make sense as a mere argument to WeakKeyDictionary; the implementation would differ significantly, and probably deserves a separate class. ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 00:09:17 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 24 Jun 2021 04:09:17 +0000 Subject: [issue44140] WeakKeyDictionary should support lookup by id instead of hash In-Reply-To: <1621068171.99.0.542983196926.issue44140@roundup.psfhosted.org> Message-ID: <1624507757.75.0.568315389861.issue44140@roundup.psfhosted.org> Andrei Kulakov added the comment: Josh: thanks for the explanation, this makes sense. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 02:25:42 2021 From: report at bugs.python.org (Yves Duprat) Date: Thu, 24 Jun 2021 06:25:42 +0000 Subject: [issue43352] Add a Barrier object in asyncio lib In-Reply-To: <1614598796.36.0.0905111746151.issue43352@roundup.psfhosted.org> Message-ID: <1624515942.06.0.236896314685.issue43352@roundup.psfhosted.org> Yves Duprat added the comment: This last version includes the propositions, remarks from @asveltov and @eamanu This PR is always stuck, so could you please approve the 3 running workflows ? ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 02:51:09 2021 From: report at bugs.python.org (Matan Perelman) Date: Thu, 24 Jun 2021 06:51:09 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624517469.56.0.526038169575.issue42853@roundup.psfhosted.org> Matan Perelman added the comment: A bit of extra context to save clicking through: the PR which introduced the regression: https://github.com/python/cpython/pull/12698 and the bug: https://bugs.python.org/issue36050 Maybe some people have context about why we couldn't just roll back that PR and increase `MAXAMOUNT` to something > 1 MiB and < 2 GiB? ---------- nosy: +matan1008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 02:51:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Jun 2021 06:51:05 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624517465.98.0.660751248444.issue43988@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 02:57:34 2021 From: report at bugs.python.org (Samuel Marks) Date: Thu, 24 Jun 2021 06:57:34 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624517854.88.0.317300140753.issue44470@roundup.psfhosted.org> Samuel Marks added the comment: Yep exactly like my screenshot but now the Polish has turned Korean? my family was never Korean! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 03:03:44 2021 From: report at bugs.python.org (Shreyan Avigyan) Date: Thu, 24 Jun 2021 07:03:44 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624518224.15.0.424664610893.issue44297@roundup.psfhosted.org> Shreyan Avigyan added the comment: Found the culprit - https://github.com/python/cpython/blob/769d7d0c66c5b86e2dd29b9ce67ac2daaab1bb38/Python/compile.c#L5268 Same goes for async with - https://github.com/python/cpython/blob/769d7d0c66c5b86e2dd29b9ce67ac2daaab1bb38/Python/compile.c#L5171 (Didn't test async with so I can be wrong there.) Is this intentional? I removed these lines and the line number is coming correct. Can changing this affect other use cases? Without the change: Traceback (most recent call last): File "C:\Users\shrey\Desktop\line_negative_one.py", line 8, in raise Exception("Normal Error") Exception: Normal Error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\shrey\Desktop\line_negative_one.py", line -1, in File "C:\Users\shrey\Desktop\line_negative_one.py", line 5, in __exit__ raise Exception("Frame is -1 if program is run from command line") Exception: Frame is -1 if program is run from command line With the change: Traceback (most recent call last): File "C:\Users\shrey\Desktop\line_negative_one.py", line 8, in raise Exception("Normal Error") Exception: Normal Error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\shrey\Desktop\line_negative_one.py", line 7, in with A(): File "C:\Users\shrey\Desktop\line_negative_one.py", line 5, in __exit__ raise Exception("Frame is -1 if program is run from command line") Exception: Frame is not -1 anymore if program is run from command line ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 03:40:55 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 07:40:55 +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: <1624520455.91.0.292657099472.issue43916@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25465 pull_request: https://github.com/python/cpython/pull/26888 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 03:41:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 07:41:50 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624520510.49.0.513027280225.issue43988@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25466 pull_request: https://github.com/python/cpython/pull/26889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 03:57:30 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 07:57:30 +0000 Subject: [issue43988] Add test.support.check_disallow_instantiation() In-Reply-To: <1619791950.5.0.60645292756.issue43988@roundup.psfhosted.org> Message-ID: <1624521450.22.0.101844942431.issue43988@roundup.psfhosted.org> miss-islington added the comment: New changeset 9049ea51eca081984c8ae37dfeb68b75d624e90d by Erlend Egeberg Aasland in branch 'main': bpo-43988: Fix test.support.check_disallow_instantiation version added (GH-26889) https://github.com/python/cpython/commit/9049ea51eca081984c8ae37dfeb68b75d624e90d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:12:08 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 24 Jun 2021 08:12:08 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624522328.19.0.742160393257.issue42853@roundup.psfhosted.org> Inada Naoki added the comment: Because this is SSL issue. HTTPS is not the only user of SSL. So we should try to fix SSL issue before reverting GH-12698. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:28:40 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Jun 2021 08:28:40 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624523320.18.0.705188593689.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: The ssl module supports sending or receiving buffers of more than 2GB in Python 3.10. It cannot be reliable fixed in Python 3.9 and earlier. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:33:00 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 24 Jun 2021 08:33:00 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624523580.96.0.723528344425.issue42853@roundup.psfhosted.org> Inada Naoki added the comment: I see. But Python 3.8 is now security fix mode. Let's revert the optimization in the 3.9 branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:34:13 2021 From: report at bugs.python.org (jakirkham) Date: Thu, 24 Jun 2021 08:34:13 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624523653.14.0.674031322838.issue42853@roundup.psfhosted.org> jakirkham added the comment: Right with this change ( https://github.com/python/cpython/pull/25468 ). Thanks for adding that Christian :) I guess what I'm wondering is if in older Python versions we could do an `#ifdef` check to try and use `SSL_read_ex` & `SSL_write_ex` if the symbols are found at build time? This would allow package maintainers the option to build with a newer OpenSSL to fix this issue (even on older Pythons) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:48:55 2021 From: report at bugs.python.org (kryheb) Date: Thu, 24 Jun 2021 08:48:55 +0000 Subject: [issue44441] Malformed PyImport_Inittab after re-initialization In-Reply-To: <1623924852.9.0.945684144321.issue44441@roundup.psfhosted.org> Message-ID: <1624524535.24.0.433209043455.issue44441@roundup.psfhosted.org> kryheb added the comment: Thanks vstinner for your help and for taking care of this case! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 04:54:07 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Jun 2021 08:54:07 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624524847.43.0.846046100054.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: No, it would be a backwards incompatible change and introduce inconsistent behavior. SSL_read_ex() is not available in LibreSSL, OpenSSL 1.0.2, and OpenSSL 1.1.0. Your code would work on CentOS 8, Debian 10, and Ubuntu 20.04, but break on CentOS 7, Debian 9, Ubuntu 18.04, and OpenBSD. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 05:30:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 24 Jun 2021 09:30:59 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624527059.66.0.505139540429.issue44297@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25467 pull_request: https://github.com/python/cpython/pull/26890 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 05:37:18 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 24 Jun 2021 09:37:18 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624527438.51.0.289958839266.issue44297@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25468 pull_request: https://github.com/python/cpython/pull/26891 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 05:39:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 09:39:40 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624527580.94.0.142672192715.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Using this patch, I'm (so far) no longer able to reproduce these test failures: diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index cee97a8302..c9c1546467 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2443,9 +2443,13 @@ def wrap_conn(self): self.server.conn_errors.append(str(e)) if self.server.chatty: handle_error("\n server: bad connection attempt from " + repr(self.addr) + ":\n") - self.running = False - self.server.stop() - self.close() + + # bpo-44229, bpo-43855, bpo-44237, and bpo-33450: + # Ignore spurious EPROTOTYPE returned by write() on macOS. + if e.errno != errno.EPROTOTYPE and sys.platform != "darwin": + self.running = False + self.server.stop() + self.close() return False else: self.server.shared_ciphers.append(self.sslconn.shared_ciphers()) Running for 40 minutes now, right now passing 6k iterations for test_get_server_certificate, test_msg_callback_deadlock_bpo43577, and test_get_server_certificate_sni. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 05:40:58 2021 From: report at bugs.python.org (zcpara) Date: Thu, 24 Jun 2021 09:40:58 +0000 Subject: [issue44502] bla in cpython/Lib/test/test_sys_settrace.py Message-ID: <1624527658.23.0.171750310771.issue44502@roundup.psfhosted.org> New submission from zcpara : In cpython/Lib/test/test_sys_settrace.py, there is a function: 1 def no_pop_blocks(): 2 y = 1 3 while not y: 4 bla 5 x = 1 what does bla mean? bla is not defined anywhere. But the function can pass the compilation. bla is treated as a global name in symtable during compilation. Why does python allow this statement (line 4)? Will line 4 be deleted in the future? Or be replaced with pass? ---------- components: Tests messages: 396465 nosy: zhangchaospecial priority: normal severity: normal status: open title: bla in cpython/Lib/test/test_sys_settrace.py versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 05:43:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 09:43:06 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624527786.09.0.467851694822.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: ... should perhaps also return True in that case, but it does not seem to have any thing to say. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 06:09:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 10:09:08 +0000 Subject: [issue44502] bla in cpython/Lib/test/test_sys_settrace.py In-Reply-To: <1624527658.23.0.171750310771.issue44502@roundup.psfhosted.org> Message-ID: <1624529348.63.0.581906188333.issue44502@roundup.psfhosted.org> Irit Katriel added the comment: y = 1, so the body of the while loop will never execute and the name will never need to be resolved. The bug tracker is not an appropriate place to ask questions about the code, it is for reporting bugs in python. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 06:35:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 10:35:09 +0000 Subject: [issue27086] Add closefd argument to os.listdir In-Reply-To: <1463940932.93.0.542961773489.issue27086@psf.upfronthosting.co.za> Message-ID: <1624530909.19.0.406252828731.issue27086@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Serhiy and David. The responsibility for closing the file is with whoever opened it, and adding an option in a function for it to also close the fd after doing what it was designed to do makes the API unnecessarily over-complicated. ---------- nosy: +iritkatriel resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:08:55 2021 From: report at bugs.python.org (Pierre Ossman) Date: Thu, 24 Jun 2021 11:08:55 +0000 Subject: [issue44503] Hide __enter__ calls in mock_open Message-ID: <1624532935.8.0.760752273219.issue44503@roundup.psfhosted.org> New submission from Pierre Ossman : I'd like to write this test case: with patch('builtins.open') as pyopen: mock_open(pyopen, read_data="foo") run() pyopen.assert_has_calls([call("filename", "wt"), call().write("gazonk"), call().close()]) and I shouldn't have to care if the code is written like this: def run(): f = open("filename", "wt") try: write("gazonk") finally: f.close() or like this: def run(): with open("filename", "wt") as f: write("gazonk") ---------- components: Library (Lib) messages: 396469 nosy: CendioOssman priority: normal severity: normal status: open title: Hide __enter__ calls in mock_open type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:09:22 2021 From: report at bugs.python.org (Pierre Ossman) Date: Thu, 24 Jun 2021 11:09:22 +0000 Subject: [issue44503] Hide __enter__ calls in mock_open In-Reply-To: <1624532935.8.0.760752273219.issue44503@roundup.psfhosted.org> Message-ID: <1624532962.51.0.302747413145.issue44503@roundup.psfhosted.org> Pierre Ossman added the comment: Also see Issue44185 for __exit__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:28:47 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 11:28:47 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624534127.38.0.467427366803.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: I can reproduce these issues easily on 3.7, 3.8, and 3.9: $ python3.7 -m test test_ssl -u all -F -m test_get_server_certificate -v [...] test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 57294) server: bad connection attempt from ('127.0.0.1', 57294): Traceback (most recent call last): File "/Users/erlendaasland/install/lib/python3.7/test/test_ssl.py", line 2313, in wrap_conn self.sock, server_side=True) File "/Users/erlendaasland/install/lib/python3.7/ssl.py", line 423, in wrap_socket session=session File "/Users/erlendaasland/install/lib/python3.7/ssl.py", line 870, in _create self.do_handshake() File "/Users/erlendaasland/install/lib/python3.7/ssl.py", line 1139, in do_handshake self._sslobj.do_handshake() OSError: [Errno 41] Protocol wrong type for socket ERROR ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/erlendaasland/install/lib/python3.7/test/test_ssl.py", line 2108, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Users/erlendaasland/install/lib/python3.7/test/test_ssl.py", line 2273, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Users/erlendaasland/install/lib/python3.7/ssl.py", line 1313, in get_server_certificate with create_connection(addr) as sock: File "/Users/erlendaasland/install/lib/python3.7/socket.py", line 728, in create_connection raise err File "/Users/erlendaasland/install/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused $ python3.8 -m test test_ssl -u all -F -m test_get_server_certificate -v test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Mac ('10.16', ('', '', ''), 'x86_64') HAS_SNI = True OP_ALL = 0x80000054 OP_NO_TLSv1_1 = 0x10000000 test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 59370) server: bad connection attempt from ('127.0.0.1', 59370): Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/test/test_ssl.py", line 2348, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() OSError: [Errno 41] Protocol wrong type for socket ERROR ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/test/test_ssl.py", line 2142, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/test/test_ssl.py", line 2309, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1484, in get_server_certificate with context.wrap_socket(sock) as sslsock: File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer $ python3.9 -m test test_ssl -u all -F -m test_get_server_certificate -v [...] test_ssl: testing with 'OpenSSL 1.1.1k 25 Mar 2021' (1, 1, 1, 11, 15) under Mac ('10.16', ('', '', ''), 'x86_64') HAS_SNI = True OP_ALL = 0x80000054 OP_NO_TLSv1_1 = 0x10000000 test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ... server: new connection from ('127.0.0.1', 60096) server: bad connection attempt from ('127.0.0.1', 60096): Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/test/test_ssl.py", line 2353, in wrap_conn self.sslconn = self.server.context.wrap_socket( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() OSError: [Errno 41] Protocol wrong type for socket ERROR ====================================================================== ERROR: test_get_server_certificate (test.test_ssl.SimpleBackgroundTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/test/test_ssl.py", line 2147, in test_get_server_certificate _test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/test/test_ssl.py", line 2314, in _test_get_server_certificate pem = ssl.get_server_certificate((host, port), ca_certs=cert) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1484, in get_server_certificate with context.wrap_socket(sock) as sslsock: File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [Errno 54] Connection reset by peer It does not seem to be specific to 3.10/3.11. ---------- versions: +Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:31:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 11:31:21 +0000 Subject: [issue40471] Grammar typo in issubclass docstring In-Reply-To: <1588357714.64.0.482700195727.issue40471@roundup.psfhosted.org> Message-ID: <1624534281.07.0.720252614977.issue40471@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:33:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 11:33:00 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624534380.0.0.206414382664.issue44229@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25469 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26893 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:54:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 11:54:51 +0000 Subject: [issue36991] zipfile: AttributeError on extract In-Reply-To: <1558441602.37.0.911226270551.issue36991@roundup.psfhosted.org> Message-ID: <1624535691.37.0.473892727148.issue36991@roundup.psfhosted.org> Irit Katriel added the comment: This seems resolved, can we close? ---------- nosy: +iritkatriel resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 07:57:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 11:57:21 +0000 Subject: [issue43553] [sqlite3] Improve test coverage In-Reply-To: <1616146827.28.0.306861710818.issue43553@roundup.psfhosted.org> Message-ID: <1624535841.71.0.370117908897.issue43553@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2c1ae09764446beda5248759fb99c859e14f1b25 by Erlend Egeberg Aasland in branch 'main': bpo-43553: Improve `sqlite3` test coverage (GH-26886) https://github.com/python/cpython/commit/2c1ae09764446beda5248759fb99c859e14f1b25 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:05:59 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:05:59 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624536359.69.0.72435703648.issue44229@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25470 pull_request: https://github.com/python/cpython/pull/26894 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:05:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 12:05:49 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624536349.59.0.123995641329.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b5a52eef67997246b4235b5407e52a01e822ce56 by Erlend Egeberg Aasland in branch 'main': bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) https://github.com/python/cpython/commit/b5a52eef67997246b4235b5407e52a01e822ce56 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:06:07 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:06:07 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624536367.28.0.359636908225.issue44229@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25471 pull_request: https://github.com/python/cpython/pull/26895 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:06:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:06:13 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624536373.62.0.46380115834.issue44229@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25472 pull_request: https://github.com/python/cpython/pull/26896 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:09:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 12:09:21 +0000 Subject: [issue44297] Frame with -1 line number In-Reply-To: <1622685061.25.0.0760408902282.issue44297@roundup.psfhosted.org> Message-ID: <1624536561.67.0.0481432452457.issue44297@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0b6b2865187bca7ed7f1f511a02fc8bd13ee38ca by Mark Shannon in branch '3.10': bpo-44297: Add a regression test for line numbers in with statements (GH-26891) https://github.com/python/cpython/commit/0b6b2865187bca7ed7f1f511a02fc8bd13ee38ca ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:12:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 24 Jun 2021 12:12:15 +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: <1624536735.38.0.0585712220941.issue43916@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 733587011dbb47c2e461188f0574e1cc5288062a by Miss Islington (bot) in branch '3.10': bpo-43916: Use test.support.check_disallow_instantiation() in test_tcl (GH-26412) (GH-26888) https://github.com/python/cpython/commit/733587011dbb47c2e461188f0574e1cc5288062a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:16:10 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 24 Jun 2021 12:16:10 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624536970.79.0.363961571168.issue40528@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 6c76df2b86d742cc294beae7f9b6bafabb946ad5 by Batuhan Taskaya in branch 'main': bpo-40528: move asdl identifier collection to the new metadata system (GH-26858) https://github.com/python/cpython/commit/6c76df2b86d742cc294beae7f9b6bafabb946ad5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:22:21 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 12:22:21 +0000 Subject: [issue44504] Typo in the docstring of Mapping.get method Message-ID: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> New submission from Yevhen Kuzmovych : The comment of `Mapping.get` method should state 'D.get(k[,d]) -> D[k] if k in D else d. d defaults to None.' instead of 'D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.' (note the comma before `else`. ---------- components: Library (Lib) messages: 396478 nosy: kuzmovich.goog priority: normal severity: normal status: open title: Typo in the docstring of Mapping.get method type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:24:48 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 12:24:48 +0000 Subject: [issue44504] Typo in the docstring of Mapping.get method In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624537488.44.0.934344363681.issue44504@roundup.psfhosted.org> Change by Yevhen Kuzmovych : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:25:18 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 12:25:18 +0000 Subject: [issue44504] Typo in the docstring of Mapping.get method In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624537518.68.0.752955754007.issue44504@roundup.psfhosted.org> Change by Yevhen Kuzmovych : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:25:49 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:25:49 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624537549.84.0.798475125948.issue44229@roundup.psfhosted.org> miss-islington added the comment: New changeset 0796e21fea31fe7b697d84c8d03186817792c458 by Miss Islington (bot) in branch '3.9': bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) https://github.com/python/cpython/commit/0796e21fea31fe7b697d84c8d03186817792c458 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:25:33 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 24 Jun 2021 12:25:33 +0000 Subject: [issue44504] Typo in the docstring of Mapping.get method In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624537533.45.0.0552216153805.issue44504@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +25473 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/26897 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:27:43 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:27:43 +0000 Subject: [issue43855] test_ssl: test_msg_callback_deadlock_bpo43577() failed on macOS of GitHub Action In-Reply-To: <1618490997.04.0.782752491303.issue43855@roundup.psfhosted.org> Message-ID: <1624537663.47.0.326451990886.issue43855@roundup.psfhosted.org> Erlend E. Aasland added the comment: Closing as a duplicate of bpo-44229. Please revert if you disagree. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:27:43 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:27:43 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624537663.79.0.650188095961.issue44229@roundup.psfhosted.org> miss-islington added the comment: New changeset b3fac2926b23b4f1342099e591aa3fed7f16876d by Miss Islington (bot) in branch '3.10': bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) https://github.com/python/cpython/commit/b3fac2926b23b4f1342099e591aa3fed7f16876d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:28:08 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:28:08 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624537688.12.0.534239254426.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Marking bpo-43855 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:29:31 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:29:31 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624537771.44.0.179820843796.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: Marking bpo-44237 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:29:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:29:09 +0000 Subject: [issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout() In-Reply-To: <1621974426.55.0.383928848705.issue44237@roundup.psfhosted.org> Message-ID: <1624537749.27.0.124217565951.issue44237@roundup.psfhosted.org> Erlend E. Aasland added the comment: Marking this as a duplicate of bpo-44229. Please revert if you disagree. ---------- dependencies: -test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:30:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:30:33 +0000 Subject: [issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX In-Reply-To: <1525892699.63.0.682650639539.issue33450@psf.upfronthosting.co.za> Message-ID: <1624537833.23.0.315270740181.issue33450@roundup.psfhosted.org> Erlend E. Aasland added the comment: See also bpo-44229. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:43:14 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:43:14 +0000 Subject: [issue43553] [sqlite3] Improve test coverage In-Reply-To: <1616146827.28.0.306861710818.issue43553@roundup.psfhosted.org> Message-ID: <1624538594.32.0.782143858186.issue43553@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:52:10 2021 From: report at bugs.python.org (Omer Ozarslan) Date: Thu, 24 Jun 2021 12:52:10 +0000 Subject: [issue22543] -W option cannot use non-standard categories In-Reply-To: <1412285520.72.0.615712160291.issue22543@psf.upfronthosting.co.za> Message-ID: <1624539130.8.0.476802760144.issue22543@roundup.psfhosted.org> Change by Omer Ozarslan : ---------- nosy: +ozars _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:57:16 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 12:57:16 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624539436.49.0.307075070644.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, here's a CI failure against 3.9: https://github.com/python/cpython/runs/2894813367?check_suite_focus=true ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:57:35 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 24 Jun 2021 12:57:35 +0000 Subject: [issue40939] Remove the old parser In-Reply-To: <1591788317.65.0.969058655213.issue40939@roundup.psfhosted.org> Message-ID: <1624539455.83.0.12572100719.issue40939@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 29987f72650b7cccee4df216c8297e8484a44e6a by Petr Viktorin in branch 'main': bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855) https://github.com/python/cpython/commit/29987f72650b7cccee4df216c8297e8484a44e6a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 08:57:37 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 12:57:37 +0000 Subject: [issue40939] Remove the old parser In-Reply-To: <1591788317.65.0.969058655213.issue40939@roundup.psfhosted.org> Message-ID: <1624539457.71.0.928698366712.issue40939@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25474 pull_request: https://github.com/python/cpython/pull/26898 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 09:42:14 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 13:42:14 +0000 Subject: [issue44504] Make docstring quotes consistent in Lib/_collections_abc.py In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624542134.46.0.956745336423.issue44504@roundup.psfhosted.org> Change by Yevhen Kuzmovych : ---------- title: Typo in the docstring of Mapping.get method -> Make docstring quotes consistent in Lib/_collections_abc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 09:59:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 13:59:45 +0000 Subject: [issue24203] Deprecate threading.Thread.isDaemon etc In-Reply-To: <1431707934.14.0.173246279453.issue24203@psf.upfronthosting.co.za> Message-ID: <1624543185.98.0.065394709718.issue24203@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Deprecate camelCase aliases from threading.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:12:38 2021 From: report at bugs.python.org (Garrison Taylor) Date: Thu, 24 Jun 2021 14:12:38 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1624543958.85.0.983101808703.issue43066@roundup.psfhosted.org> Garrison Taylor added the comment: That addition to the documentation sounds appropriate to me. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:16:44 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 14:16:44 +0000 Subject: [issue44504] Make docstring quotes consistent in Lib In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624544204.88.0.892865208266.issue44504@roundup.psfhosted.org> Change by Yevhen Kuzmovych : ---------- title: Make docstring quotes consistent in Lib/_collections_abc.py -> Make docstring quotes consistent in Lib _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:27:24 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 24 Jun 2021 14:27:24 +0000 Subject: [issue43066] Zipfile with leading slashes In-Reply-To: <1611952128.43.0.663068649879.issue43066@roundup.psfhosted.org> Message-ID: <1624544844.97.0.252521593578.issue43066@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25475 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26899 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:34:42 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 14:34:42 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624545282.11.0.126948664261.issue44229@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 71ba16b21cb35923098026117b5e6d823c5f5707 by Miss Islington (bot) in branch '3.8': bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) (GH-26895) https://github.com/python/cpython/commit/71ba16b21cb35923098026117b5e6d823c5f5707 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:36:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 14:36:01 +0000 Subject: [issue44491] [sqlite3] allow clearing the authoriser callback In-Reply-To: <1624404645.88.0.222168479229.issue44491@roundup.psfhosted.org> Message-ID: <1624545361.09.0.184722081696.issue44491@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b19f45533942e4ad7ddf9d2d94f8b87c6f746bce by Erlend Egeberg Aasland in branch 'main': bpo-44491: Allow clearing the sqlite3 authoriser callback (GH-26863) https://github.com/python/cpython/commit/b19f45533942e4ad7ddf9d2d94f8b87c6f746bce ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 10:41:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 14:41:21 +0000 Subject: =?utf-8?q?=5Bissue26724=5D_Serialize_dict_with_non-string_keys_to_JSON_?= =?utf-8?q?=E2=80=94_unexpected_result?= In-Reply-To: <1460232210.14.0.690770793503.issue26724@psf.upfronthosting.co.za> Message-ID: <1624545681.22.0.739780410972.issue26724@roundup.psfhosted.org> Irit Katriel added the comment: This is documented, was added here: https://github.com/python/cpython/commit/f2123d2db54d661a016f02c5a1a02484d6d79e0d If nobody objects I will close as won't fix. ---------- nosy: +iritkatriel resolution: -> wont fix status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:10:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 15:10:06 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624547406.03.0.330826158231.issue44456@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0acc258fe6f0ec200ca2f6f9294adbf52a244802 by Pablo Galindo in branch 'main': bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793) https://github.com/python/cpython/commit/0acc258fe6f0ec200ca2f6f9294adbf52a244802 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:10:11 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 15:10:11 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624547411.56.0.407381684871.issue44456@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25476 pull_request: https://github.com/python/cpython/pull/26900 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:20:14 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 24 Jun 2021 15:20:14 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1624548014.93.0.260528481536.issue44501@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- keywords: +patch pull_requests: +25477 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26901 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:21:54 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 24 Jun 2021 15:21:54 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1624548114.15.0.257750232575.issue44501@roundup.psfhosted.org> Batuhan Taskaya added the comment: I've tested this with pyperformance, and no significant (1.02 faster on some, 1.01x slower on others, nothing significant) change on those so this is a targeted optimization. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:24:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 15:24:10 +0000 Subject: [issue44491] [sqlite3] allow clearing the authoriser callback In-Reply-To: <1624404645.88.0.222168479229.issue44491@roundup.psfhosted.org> Message-ID: <1624548250.21.0.990778627666.issue44491@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 Jun 24 11:29:04 2021 From: report at bugs.python.org (Yevhen Kuzmovych) Date: Thu, 24 Jun 2021 15:29:04 +0000 Subject: [issue44504] Make docstring quotes consistent in Lib/_collections_abc.py In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624548544.6.0.89354765933.issue44504@roundup.psfhosted.org> Change by Yevhen Kuzmovych : ---------- title: Make docstring quotes consistent in Lib -> Make docstring quotes consistent in Lib/_collections_abc.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:34:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 15:34:42 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624548882.02.0.290730168286.issue44456@roundup.psfhosted.org> miss-islington added the comment: New changeset 11f1a30cdb59f9da0209798d2057f7afacbd9547 by Miss Islington (bot) in branch '3.10': bpo-44456: Improve the syntax error when mixing keyword and positional patterns (GH-26793) https://github.com/python/cpython/commit/11f1a30cdb59f9da0209798d2057f7afacbd9547 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:36:41 2021 From: report at bugs.python.org (zcpara) Date: Thu, 24 Jun 2021 15:36:41 +0000 Subject: [issue44505] loop invariant code motion Message-ID: <1624549001.38.0.871680374624.issue44505@roundup.psfhosted.org> New submission from zcpara : It is a common scenario to call functions in loop, such as def foo(): for i in range(10): len("abc") Currently, we generate bytecode like this; 2 0 SETUP_LOOP 24 (to 26) 2 LOAD_GLOBAL 0 (range) 4 LOAD_CONST 1 (10) 6 CALL_FUNCTION 1 8 GET_ITER >> 10 FOR_ITER 12 (to 24) 12 STORE_FAST 0 (i) 3 14 LOAD_GLOBAL 1 (len) 16 LOAD_CONST 2 ('abc') 18 CALL_FUNCTION 1 20 POP_TOP 22 JUMP_ABSOLUTE 10 >> 24 POP_BLOCK >> 26 LOAD_CONST 0 (None) 28 RETURN_VALUE If we can make sure len is a loop invariant, we can generate code as follows. Only one LOAD_GLOBAL len is executed before the loop. LOAD_GLOBAL len is replaced with LOAD_FAST __local__len in the loop. 2 0 LOAD_GLOBAL 0 (range) 2 LOAD_CONST 1 (10) 4 CALL_FUNCTION 1 6 GET_ITER 8 LOAD_GLOBAL 1 (len) 10 STORE_FAST 1 (__local__len) >> 12 FOR_ITER 6 (to 26) 14 STORE_FAST 0 (i) 3 16 LOAD_FAST 1 (__local__len) 18 LOAD_CONST 2 ('abc') 20 CALL_FUNCTION 1 22 POP_TOP 24 JUMP_ABSOLUTE 6 (to 12) 2 >> 26 LOAD_CONST 0 (None) 28 RETURN_VALU I prototyped this optimization and gain 4.6% performance improvement on regex_v8 of PyPerformance. Currently, only the global invariants are moved out of the loop. There are some other loop invariants can be moved. Other optimizations such as function inline can provide more opportunities for LICM. I meet a problem with the following case; 1 def no_pop_blocks(): 2 y = 1 3 while not y: 4 bla 5 x = 1 bla is not defined anywhere. With LICM, LOAD_GLOBAL bla will be move out of the loop. Then it executes with an error: bla is not defined. ---------- components: Interpreter Core messages: 396496 nosy: zhangchaospecial priority: normal severity: normal status: open title: loop invariant code motion type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:36:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 15:36:05 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624548965.98.0.000586168674162.issue44456@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:36:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 24 Jun 2021 15:36:01 +0000 Subject: [issue44456] Improve syntax error for mixing keyword/positional in max patterns In-Reply-To: <1624050467.44.0.473632182827.issue44456@roundup.psfhosted.org> Message-ID: <1624548961.48.0.526239977246.issue44456@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 11:51:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 15:51:47 +0000 Subject: [issue39254] python shebang in python3 tarball files In-Reply-To: <1578464714.96.0.727607440351.issue39254@roundup.psfhosted.org> Message-ID: <1624549907.06.0.879206685237.issue39254@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> port shebang of tools from python2 to python3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:13:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 24 Jun 2021 16:13:42 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1624551222.39.0.252857744176.issue42892@roundup.psfhosted.org> Andrei Kulakov added the comment: I'll try to fix the unit test today. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:17:36 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 24 Jun 2021 16:17:36 +0000 Subject: [issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators In-Reply-To: <1618338439.83.0.0166317758112.issue43833@roundup.psfhosted.org> Message-ID: <1624551456.23.0.24822398812.issue43833@roundup.psfhosted.org> Patrick Reader added the comment: I would like to note that syntax like this is in heavy use in the Code Golf community (a sport in which the aim is to write the shortest code possible to complete a particular task). It will be disappointing if it becomes an error and break many past programs (you can search for phrases like `1and`, `0for` on https://codegolf.stackexchange.com/search?q=0for for examples). I could understand if this change remains because code golf is not exactly an important thing with serious ramifications, but I think it should be taken in to consideration as a use-case nonetheless. ---------- nosy: +pxeger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:43:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 24 Jun 2021 16:43:08 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) In-Reply-To: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> Message-ID: <1624552988.56.0.688387102548.issue44497@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:43:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 24 Jun 2021 16:43:21 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) In-Reply-To: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> Message-ID: <1624553001.85.0.298362714873.issue44497@roundup.psfhosted.org> Change by Dong-hee Na : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:46:01 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Jun 2021 16:46:01 +0000 Subject: [issue44321] os.EX_OK for Windows In-Reply-To: <1622976029.7.0.66701832067.issue44321@roundup.psfhosted.org> Message-ID: <1624553161.73.0.483142710254.issue44321@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 Jun 24 12:45:26 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 24 Jun 2021 16:45:26 +0000 Subject: [issue44321] os.EX_OK for Windows In-Reply-To: <1622976029.7.0.66701832067.issue44321@roundup.psfhosted.org> Message-ID: <1624553126.88.0.360048381146.issue44321@roundup.psfhosted.org> Steve Dower added the comment: New changeset 19459f8ce63cc7f905e3c1a55d09d4d10d245343 by Samuel Marks in branch 'main': bpo-44321: Adds `os.EX_OK` for Windows (GH-26559) https://github.com/python/cpython/commit/19459f8ce63cc7f905e3c1a55d09d4d10d245343 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:42:56 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 24 Jun 2021 16:42:56 +0000 Subject: [issue44497] distutil findall can choke with recursive symlinks (performance) In-Reply-To: <1624440031.78.0.268205320364.issue44497@roundup.psfhosted.org> Message-ID: <1624552976.9.0.0949102380457.issue44497@roundup.psfhosted.org> Dong-hee Na added the comment: Since the distutils is deprecated at PEP632, I would like to suggest changing the implementation to use setuptools. ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:53:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 16:53:10 +0000 Subject: [issue44506] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving fails on Windows x64 and x86 Message-ID: <1624553590.23.0.0289077713667.issue44506@roundup.psfhosted.org> New submission from Erlend E. Aasland : https://github.com/python/cpython/runs/2905621215: 2021-06-24T14:18:23.3772681Z ====================================================================== 2021-06-24T14:18:23.3773622Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) 2021-06-24T14:18:23.3774665Z ---------------------------------------------------------------------- 2021-06-24T14:18:23.3775258Z Traceback (most recent call last): 2021-06-24T14:18:23.3776123Z File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving 2021-06-24T14:18:23.3777065Z with self.assertRaises(ConnectionError): 2021-06-24T14:18:23.3777775Z AssertionError: ConnectionError not raised 2021-06-24T14:18:23.3778226Z 2021-06-24T14:18:23.3778744Z ---------------------------------------------------------------------- 2021-06-24T14:18:23.3779161Z 2021-06-24T14:18:23.3779555Z Ran 2022 tests in 54.341s 2021-06-24T14:18:23.3779870Z 2021-06-24T14:18:23.3780352Z FAILED (failures=1, skipped=63) 2021-06-24T14:18:23.3780890Z test test_asyncio failed https://github.com/python/cpython/runs/2906141524: 2021-06-24T15:23:11.7177493Z ====================================================================== 2021-06-24T15:23:11.7178338Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) 2021-06-24T15:23:11.7179234Z ---------------------------------------------------------------------- 2021-06-24T15:23:11.7179754Z Traceback (most recent call last): 2021-06-24T15:23:11.7180469Z File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving 2021-06-24T15:23:11.7181284Z with self.assertRaises(ConnectionError): 2021-06-24T15:23:11.7182125Z AssertionError: ConnectionError not raised 2021-06-24T15:23:11.7182560Z 2021-06-24T15:23:11.7183334Z ---------------------------------------------------------------------- 2021-06-24T15:23:11.7183839Z ---------- components: Tests, asyncio messages: 396502 nosy: asvetlov, erlendaasland, yselivanov priority: normal severity: normal status: open title: test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving fails on Windows x64 and x86 type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:55:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 16:55:23 +0000 Subject: [issue44506] test_asyncio: test_sendfile_close_peer_in_the_middle_of_receiving fails on Windows x64 and x86 In-Reply-To: <1624553590.23.0.0289077713667.issue44506@roundup.psfhosted.org> Message-ID: <1624553723.74.0.480594383943.issue44506@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 12:56:06 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 24 Jun 2021 16:56: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: <1624553766.62.0.571336638118.issue41682@roundup.psfhosted.org> Erlend E. Aasland added the comment: Two new failures today: https://github.com/python/cpython/runs/2905621215: 2021-06-24T14:18:23.3772681Z ====================================================================== 2021-06-24T14:18:23.3773622Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) 2021-06-24T14:18:23.3774665Z ---------------------------------------------------------------------- 2021-06-24T14:18:23.3775258Z Traceback (most recent call last): 2021-06-24T14:18:23.3776123Z File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving 2021-06-24T14:18:23.3777065Z with self.assertRaises(ConnectionError): 2021-06-24T14:18:23.3777775Z AssertionError: ConnectionError not raised 2021-06-24T14:18:23.3778226Z 2021-06-24T14:18:23.3778744Z ---------------------------------------------------------------------- 2021-06-24T14:18:23.3779161Z 2021-06-24T14:18:23.3779555Z Ran 2022 tests in 54.341s 2021-06-24T14:18:23.3779870Z 2021-06-24T14:18:23.3780352Z FAILED (failures=1, skipped=63) 2021-06-24T14:18:23.3780890Z test test_asyncio failed https://github.com/python/cpython/runs/2906141524: 2021-06-24T15:23:11.7177493Z ====================================================================== 2021-06-24T15:23:11.7178338Z FAIL: test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.ProactorEventLoopTests) 2021-06-24T15:23:11.7179234Z ---------------------------------------------------------------------- 2021-06-24T15:23:11.7179754Z Traceback (most recent call last): 2021-06-24T15:23:11.7180469Z File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, in test_sendfile_close_peer_in_the_middle_of_receiving 2021-06-24T15:23:11.7181284Z with self.assertRaises(ConnectionError): 2021-06-24T15:23:11.7182125Z AssertionError: ConnectionError not raised 2021-06-24T15:23:11.7182560Z 2021-06-24T15:23:11.7183334Z ---------------------------------------------------------------------- 2021-06-24T15:23:11.7183839Z ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 13:00:04 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 24 Jun 2021 17:00:04 +0000 Subject: [issue44505] loop invariant code motion In-Reply-To: <1624549001.38.0.871680374624.issue44505@roundup.psfhosted.org> Message-ID: <1624554004.17.0.560139560541.issue44505@roundup.psfhosted.org> Batuhan Taskaya added the comment: There are multiple issues with doing 'static' loop invariant code motion in python, but the most obvious one is how would you detect if anything in the body is related to the loop or not? The trivial way that the compiled languages do this optimization is generating some sort of data dependency graph, and seeing whether anything in an expression refers to the loop target though in Python you can't know for sure unless you know every possible type in the loop body and the type of the loop target which is something nearly impossible to infer (due to the dynamic nature of python). You could theoretically do this only if the whole loop only uses simple values: for x in [1, 2, 3, 4, 5]: a = 5 if a > 3: a += 2 continue and in that case, it is better to just optimize the whole loop away but since this kind of code doesn't exist at all in the public, there is no need to make the compiler more complicated. Another option is generating multiple code objects with guards, which would require to do first some sort of partial type inference and generate the code for the possible types. It would require a substantial amount of changes on both the compiler and the interpreter which is something I'd say can be deferred for later if we implement a tracing JIT. With traces, it should be way easier to do this sort of trivial compiler optimization (loop invariants, constant propagation, GVN, etc.) since we would know the types, and possible code paths. ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 13:00:37 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 24 Jun 2021 17:00:37 +0000 Subject: [issue44505] loop invariant code motion In-Reply-To: <1624549001.38.0.871680374624.issue44505@roundup.psfhosted.org> Message-ID: <1624554037.62.0.841842124093.issue44505@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 13:18:21 2021 From: report at bugs.python.org (Maarten Derickx) Date: Thu, 24 Jun 2021 17:18:21 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624555101.86.0.586715133269.issue24339@roundup.psfhosted.org> Maarten Derickx added the comment: Hi Marc-Andre Lemburg, Thanks for your reply. I tried using gencodec.py as could be downloaded from https://github.com/python/cpython/blob/main/Tools/unicode/gencodec.py as you mentioned. However the code in gencodec.py seems to be in a much worse shape than the iso6937.py attached here. The code in gencodec relies on being able to compare integers with tuples. This is caused by the lines: mappings = sorted(map) hinting that this code has never been run using python 3. providing a decent sort key solves this issue. But after that other issues pop up. For example there seems to be some problems handling the 0x-001 by the not appropriately handling of items in the mapping that have MISSING_CODE resulting in things like: 0x80: 0x-001 showing up in the generated code. And then there is the issue that python_mapdef_code has as a side effect that it does 'del map["IDENTITY"]' causing "'IDENTITY' in map" in python_tabledef_code to always evaluate to False even when it should evaluate to True. The problems above can be observed by just running gencodec.py on https://unicode.org/Public/MAPPINGS/VENDORS/APPLE/SYMBOL.TXT . If gencodec.py was a trustworthy and well maintained piece of code, I would happily use it. However at the moment I don't see it as a valid option since debugging gencodec.py would cost me at least as much time as just writing its output myself instead of generating it. Additionally https://unicode.org/ doesn't seem to provide a mapping file for iso6937. I do agree that using codecs.charmap_encode and codecs.charmap_decode is a much better solution then the one in iso6937.py. But I don't understand gencodec.py well enough to actually fix it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:02:26 2021 From: report at bugs.python.org (Samet Yaslan) Date: Thu, 24 Jun 2021 19:02:26 +0000 Subject: [issue44185] mock_open file handle __exit__ does not call close In-Reply-To: <1621498625.9.0.422400740011.issue44185@roundup.psfhosted.org> Message-ID: <1624561346.74.0.0560894879167.issue44185@roundup.psfhosted.org> Change by Samet Yaslan : ---------- keywords: +patch nosy: +sametyaslan nosy_count: 3.0 -> 4.0 pull_requests: +25478 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26902 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:11:30 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 24 Jun 2021 19:11:30 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1624561890.23.0.665529880125.issue42892@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +25479 pull_request: https://github.com/python/cpython/pull/26903 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:17:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 24 Jun 2021 19:17:44 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1624562264.99.0.602169729659.issue42892@roundup.psfhosted.org> Andrei Kulakov added the comment: Put up the PR here: https://github.com/python/cpython/pull/26903 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:37:38 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 19:37:38 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624563458.86.0.00522868912247.issue44498@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25480 pull_request: https://github.com/python/cpython/pull/26904 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:37:49 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 24 Jun 2021 19:37:49 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624563469.84.0.918532468723.issue44498@roundup.psfhosted.org> Barry A. Warsaw added the comment: New changeset 8488b85c6397fe58f17fc00e047044c959ac0b04 by Barry Warsaw in branch 'main': bpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (#26882) https://github.com/python/cpython/commit/8488b85c6397fe58f17fc00e047044c959ac0b04 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 15:58:03 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 19:58:03 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624564683.82.0.765168665184.issue44498@roundup.psfhosted.org> miss-islington added the comment: New changeset a80a38ee9a7b2e26dba848793cc298d8435fddd5 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44498: Issue a deprecation warning on asynchat, asyncore and smtpd import (GH-26882) (GH-26904) https://github.com/python/cpython/commit/a80a38ee9a7b2e26dba848793cc298d8435fddd5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 16:15:36 2021 From: report at bugs.python.org (jakirkham) Date: Thu, 24 Jun 2021 20:15:36 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624565736.24.0.323965116262.issue42853@roundup.psfhosted.org> jakirkham added the comment: Not following. Why would it break? Presumably once one builds Python for a particular OS they keep there (like system package managers for example). Or alternatively they build on a much older OS and then deploy to newer ones. The latter case is what we do in conda-forge (Anaconda does the same thing). We also build our own OpenSSL so have control of that knob too. Though I've seen application developers do similar things. Do you have an example where this wouldn't work? Maybe that would help as we can define a better solution there. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 16:39:31 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 24 Jun 2021 20:39:31 +0000 Subject: [issue42853] `OverflowError: signed integer is greater than maximum` in ssl.py for files larger than 2GB In-Reply-To: <1610006589.59.0.311109371799.issue42853@roundup.psfhosted.org> Message-ID: <1624567171.6.0.240585802465.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: Right now sending and receiving buffers >2 GB over TLS consistently fails on all platforms with Python 3.9. A backport of bf624032c12c763b72594e5f41ff8af309b85264 to Python 3.9 would make the behavior inconsistent. Your code would work on your laptop with a recent Fedora or Ubuntu version that has OpenSSL 1.1.1. But it would suddenly fail on your production system with Debian 10, because it has OpenSSL 1.1.0 and Python would have to fall back to SSL_read(). In my experience these kinds of inconsistencies cause headaches and frustrations. A consistent error gives you a chance to notice a problem early and to implement a workaround. ---------- versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 16:57:58 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 20:57:58 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624568278.39.0.829826818632.issue44498@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25481 pull_request: https://github.com/python/cpython/pull/26905 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 17:41:29 2021 From: report at bugs.python.org (Glenn Travis) Date: Thu, 24 Jun 2021 21:41:29 +0000 Subject: [issue44507] Favor needed ASAP Message-ID: <1624570889.78.0.11284349672.issueNone@roundup.psfhosted.org> New submission from Glenn Travis : - This mail is in HTML. Some elements may be ommited in plain text. - Hi to you! Need a favor from you, do you have an account with Amazon? Glenn Travis ---------- messages: 396511 nosy: Old Sub Sailor priority: normal severity: normal status: open title: Favor needed ASAP _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 17:53:01 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 24 Jun 2021 21:53:01 +0000 Subject: [issue44507] Favor needed ASAP In-Reply-To: <1624570889.78.0.11284349672.issueNone@roundup.psfhosted.org> Message-ID: <1624571581.74.0.58718714838.issue44507@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 18:52:30 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 24 Jun 2021 22:52:30 +0000 Subject: [issue44475] Dataclass Causes Infinite Recursion when using type of bytes In-Reply-To: <1624287996.71.0.124244983784.issue44475@roundup.psfhosted.org> Message-ID: <1624575150.75.0.113650086914.issue44475@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:04:35 2021 From: report at bugs.python.org (Kevin Follstad) Date: Thu, 24 Jun 2021 23:04:35 +0000 Subject: [issue24132] Direct sub-classing of pathlib.Path In-Reply-To: <1430890013.04.0.304568332905.issue24132@psf.upfronthosting.co.za> Message-ID: <1624575875.45.0.57436526634.issue24132@roundup.psfhosted.org> Change by Kevin Follstad : ---------- pull_requests: +25482 pull_request: https://github.com/python/cpython/pull/26906 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:20:50 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 24 Jun 2021 23:20:50 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624576850.21.0.205796908997.issue44498@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25483 pull_request: https://github.com/python/cpython/pull/26907 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:20:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:20:48 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624576848.31.0.514829162109.issue44498@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 22e7effad571f8e524d2f71ff55bbf2a25306753 by Irit Katriel in branch 'main': bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905) https://github.com/python/cpython/commit/22e7effad571f8e524d2f71ff55bbf2a25306753 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:32:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:32:10 +0000 Subject: [issue36438] Python 3.5.7 import error on Cross compile In-Reply-To: <1553608524.58.0.377430259995.issue36438@roundup.psfhosted.org> Message-ID: <1624577530.98.0.700355981274.issue36438@roundup.psfhosted.org> Irit Katriel added the comment: Closing as there has been no followup for over two years. Please create a new issue if you are still seeing an issue with 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 Jun 24 19:34:04 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 24 Jun 2021 23:34:04 +0000 Subject: [issue44447] Syntax Error not as detailed as shown In-Reply-To: <1624043341.94.0.33099368304.issue44447@roundup.psfhosted.org> Message-ID: Eesa Ibrahim Khokhar added the comment: OK, Thanks for letting me know! On Fri, Jun 18, 2021 at 3:09 PM Pablo Galindo Salgado < report at bugs.python.org> wrote: > > Pablo Galindo Salgado added the comment: > > Indeed, as Andre mentions your example is different because in you case > the call is interpreted as a generator comprehension, not as a function > call. > > ---------- > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:38:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:38:18 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624577898.32.0.497091559268.issue44498@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 8bec9fb92f09d02c24611ebd0a90103a1a414a40 by Miss Islington (bot) in branch '3.10': bpo-44498: suppress DeprecationWarnings for asynchat, asyncore and smtpd in tests (GH-26905) (GH-26907) https://github.com/python/cpython/commit/8bec9fb92f09d02c24611ebd0a90103a1a414a40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:43:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:43:53 +0000 Subject: [issue41825] os.waitid() documentation needs TLC In-Reply-To: <1600706510.78.0.601178112511.issue41825@roundup.psfhosted.org> Message-ID: <1624578233.66.0.584937549677.issue41825@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:44:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:44:30 +0000 Subject: [issue41825] os.waitid() documentation needs TLC In-Reply-To: <1600706510.78.0.601178112511.issue41825@roundup.psfhosted.org> Message-ID: <1624578270.32.0.00253292574856.issue41825@roundup.psfhosted.org> Irit Katriel added the comment: See also issue38802, issue34278, issue27808. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:45:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:45:41 +0000 Subject: [issue38802] Clearer wording of os.WNOHANG documentation to avoid misinterpretation In-Reply-To: <1573768341.13.0.576203356509.issue38802@roundup.psfhosted.org> Message-ID: <1624578341.29.0.396792201953.issue38802@roundup.psfhosted.org> Irit Katriel added the comment: see also issue41825, issue34278, issue27808. ---------- components: +Library (Lib) nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:46:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:46:30 +0000 Subject: [issue34278] Documentation: os.waitid and os.WNOHANG In-Reply-To: <1532941377.17.0.56676864532.issue34278@psf.upfronthosting.co.za> Message-ID: <1624578390.14.0.676933094997.issue34278@roundup.psfhosted.org> Irit Katriel added the comment: See also issue41825, issue38802, issue27808. ---------- components: +Library (Lib) nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 19:46:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 24 Jun 2021 23:46:36 +0000 Subject: [issue27808] os.waitpid does not return (0, 0) when child has not exited (FreeBSD) In-Reply-To: <1471651195.23.0.67845273163.issue27808@psf.upfronthosting.co.za> Message-ID: <1624578396.5.0.603858459205.issue27808@roundup.psfhosted.org> Irit Katriel added the comment: See also issue34278, issue38802, issue41825. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 20:37:19 2021 From: report at bugs.python.org (Norman Lorrain) Date: Fri, 25 Jun 2021 00:37:19 +0000 Subject: [issue38825] shutil.disk_usage - Lacking documentation In-Reply-To: <1573942798.11.0.196925055555.issue38825@roundup.psfhosted.org> Message-ID: <1624581439.49.0.998312974071.issue38825@roundup.psfhosted.org> Norman Lorrain added the comment: This issue is a bit dated, but here goes: On Unix, the function `statvfs()` is called. `path` should be a path on a mounted filesystem (it should not be a device). On Windows, the function `GetDiskFreeSpaceExW()` is called. `path` is any directory on a disk volume. Looking through the rest of the page, no other functions get into such specifics; maybe this is outside the scope of the document. Maybe the issue should be closed. ---------- nosy: +Norman Lorrain _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 22:14:57 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 25 Jun 2021 02:14:57 +0000 Subject: [issue44507] Spam In-Reply-To: <1624570889.78.0.11284349672.issueNone@roundup.psfhosted.org> Message-ID: <1624587297.73.0.949094887388.issue44507@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: -Old Sub Sailor title: Favor needed ASAP -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jun 24 22:15:07 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 25 Jun 2021 02:15:07 +0000 Subject: [issue44507] Spam Message-ID: <1624587307.04.0.0889513909167.issue44507@roundup.psfhosted.org> Change by Zachary Ware : ---------- Removed message: https://bugs.python.org/msg396511 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 04:21:30 2021 From: report at bugs.python.org (=?utf-8?b?VsOhY2xhdiDFoG1pbGF1ZXI=?=) Date: Fri, 25 Jun 2021 08:21:30 +0000 Subject: [issue36392] IPv4Interface Object has no attributte prefixlen In-Reply-To: <1553197512.13.0.766410741462.issue36392@roundup.psfhosted.org> Message-ID: <1624609290.81.0.550507314047.issue36392@roundup.psfhosted.org> V?clav ?milauer added the comment: This one works: addr.network.prefixlen. It took me a while to find out; I find the documentation somewhat confusing in this point. ---------- nosy: +eudoxos _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 06:16:24 2021 From: report at bugs.python.org (Alexandre Sicard) Date: Fri, 25 Jun 2021 10:16:24 +0000 Subject: [issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor In-Reply-To: <1619470785.38.0.461987263008.issue43944@roundup.psfhosted.org> Message-ID: <1624616184.52.0.968428515887.issue43944@roundup.psfhosted.org> Alexandre Sicard added the comment: Thank you very much for this report, Genaro. I encountered the same bug with a Process running in the context of a Django view. Downgrading to Python 3.8 also fixed the issue for me. Versions: python:3.9-alpine Docker image, running Python 3.9.5 and Alpine 3.13. Can also reproduce on the standard (Debian Buster based) python:3.9 image, and on Arch Linux (bare metal), all also running Python 3.9.5. ---------- nosy: +sicard_elda _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 08:00:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 25 Jun 2021 12:00:15 +0000 Subject: [issue44508] asyncio: document failure mode for loop.call_soon_threadsafe Message-ID: <1624622415.86.0.725571040455.issue44508@roundup.psfhosted.org> New submission from Mark Dickinson : `loop.call_soon_threadsafe` raises `RuntimeError` when the event loop has been closed, but that fact doesn't seem to be documented. It would be useful to document it so that that it's clear that that behaviour is part of the API, and can be depended on. Doc link: I'm looking at https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_soon_threadsafe My use-case is that I have a background thread that's making use of `loop.call_soon_threadsafe` to place callbacks onto the main thread's event loop. The main thread at some point closes that event loop (e.g., as part of controlled application shutdown, or in the tearDown of a unit test). The background thread isn't in a position to know whether the event loop has been closed or not, and obviously checking that using the `is_closed` attribute runs into race condition issues. So I'd like to catch the potential exception from the `loop.call_soon_threadsafe`, but to do that I need to know what exception type to catch. It would probably also make sense to document the failure mode for `loop.call_soon`. ---------- assignee: docs at python components: Documentation, asyncio messages: 396523 nosy: asvetlov, docs at python, mark.dickinson, yselivanov priority: normal severity: normal status: open title: asyncio: document failure mode for loop.call_soon_threadsafe versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 11:21:08 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 25 Jun 2021 15:21:08 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1624634468.02.0.470687153704.issue43977@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset ca2009d72a52a98bf43aafa9ad270a4fcfabfc89 by Brandt Bucher in branch 'main': bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864) https://github.com/python/cpython/commit/ca2009d72a52a98bf43aafa9ad270a4fcfabfc89 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 11:21:13 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 25 Jun 2021 15:21:13 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1624634473.8.0.480565689682.issue43977@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25484 pull_request: https://github.com/python/cpython/pull/26908 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 11:46:31 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 25 Jun 2021 15:46:31 +0000 Subject: [issue43977] Implement the latest semantics for PEP 634 for matching collections In-Reply-To: <1619714021.85.0.37223153861.issue43977@roundup.psfhosted.org> Message-ID: <1624635991.75.0.42715547981.issue43977@roundup.psfhosted.org> miss-islington added the comment: New changeset 88970125e7a4917966f711dc7e93cf170977034f by Miss Islington (bot) in branch '3.10': bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864) https://github.com/python/cpython/commit/88970125e7a4917966f711dc7e93cf170977034f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 16:11:24 2021 From: report at bugs.python.org (alex rakowski) Date: Fri, 25 Jun 2021 20:11:24 +0000 Subject: [issue44509] Build in type alias for paths Message-ID: <1624651884.63.0.0362769234249.issue44509@roundup.psfhosted.org> New submission from alex rakowski : Hello, I've noticed that when type hinting paths, it often becomes a bit verbose: from typing import Union import pathlib custom_path = Union[str, pathlib.Path] def foobar(x:custom_path): ... Writing functions which handle paths are pretty routine, I'm wondering if it is worth including something that is importable e.g. from typing import PathLike #or similar path_obj, PathType etc. def foobar(x:PathLike): ... Apologies if similar functionality already exists, Alex ---------- components: Library (Lib) messages: 396526 nosy: arakowski priority: normal severity: normal status: open title: Build in type alias for paths type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 17:00:02 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 25 Jun 2021 21:00:02 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1624654802.85.0.300939371562.issue44109@roundup.psfhosted.org> Andrei Kulakov added the comment: I agree the example is confusing for all of the stated reasons. It seems to me it's better to use a plain class with a `__init__()` for two reason: - for people who are not familiar with namedtuples or dataclasses, it would be harder to learn two fairly complex topics at the same time. Docs for both are fairly extensive. - for those who *are* familiar with namedtuples or dataclasses (whichever is used in the example), the example may imply they should be used with pattern matching, and that plain classes may not work or not work well. I can make a PR that adds `__init__` if this makes sense.. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:28:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:28:25 +0000 Subject: [issue38146] QVariant NULL returns anomalous values in equality statements In-Reply-To: <1568316344.45.0.265967787088.issue38146@roundup.psfhosted.org> Message-ID: <1624660105.02.0.215363129182.issue38146@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:28:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:28:57 +0000 Subject: [issue15066] make install error: ImportError: No module named _struct In-Reply-To: <1339684582.74.0.731857257466.issue15066@psf.upfronthosting.co.za> Message-ID: <1624660137.37.0.911467349825.issue15066@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:35:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:35:18 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1624660518.62.0.717212660691.issue41539@roundup.psfhosted.org> Irit Katriel added the comment: Is there anything left here? I've seen it mentioned on other issues of this sort that mixing multiprocessing and threading leads to problems. Should we document that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:39:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:39:00 +0000 Subject: [issue41866] Document error in chinese version of contextlib. In-Reply-To: <1601137438.19.0.414392303646.issue41866@roundup.psfhosted.org> Message-ID: <1624660740.7.0.809414927664.issue41866@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +zhsj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:41:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:41:09 +0000 Subject: [issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string In-Reply-To: <1512434453.0.0.213398074469.issue32215@psf.upfronthosting.co.za> Message-ID: <1624660869.03.0.430273965957.issue32215@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 Jun 25 18:43:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:43:08 +0000 Subject: [issue38055] Starting multiprocessing.Process raises FileNotFoundError unexpectedly In-Reply-To: <1567951615.68.0.110531280911.issue38055@roundup.psfhosted.org> Message-ID: <1624660988.26.0.768267297596.issue38055@roundup.psfhosted.org> Irit Katriel added the comment: Closing as there isn't enough information about the problem. If you are still seeing it, please create a new issue with full details. ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:49:18 2021 From: report at bugs.python.org (alex rakowski) Date: Fri, 25 Jun 2021 22:49:18 +0000 Subject: [issue44509] Build in type alias for paths In-Reply-To: <1624651884.63.0.0362769234249.issue44509@roundup.psfhosted.org> Message-ID: <1624661358.69.0.180583410233.issue44509@roundup.psfhosted.org> alex rakowski added the comment: I just noticed this issue was raised and dismissed in PEP 519 -- Adding a file system path protocol. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 18:54:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 25 Jun 2021 22:54:44 +0000 Subject: [issue36265] Remove ABCs from collections In-Reply-To: <1552324671.45.0.197539126339.issue36265@roundup.psfhosted.org> Message-ID: <1624661684.64.0.760968888086.issue36265@roundup.psfhosted.org> Irit Katriel added the comment: This was updated in later 3.8.X versions: https://github.com/python/cpython/blob/71ba16b21cb35923098026117b5e6d823c5f5707/Lib/collections/__init__.py#L49 warnings.warn("Using or importing the ABCs from 'collections' instead " "of from 'collections.abc' is deprecated since Python 3.3, " "and in 3.10 it will stop working", DeprecationWarning, stacklevel=2) ---------- nosy: +iritkatriel resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 19:06:12 2021 From: report at bugs.python.org (Rohan Amin) Date: Fri, 25 Jun 2021 23:06:12 +0000 Subject: [issue44510] file.read() UnicodeDecodeError with large files on Windows Message-ID: <1624662372.97.0.0432881469482.issue44510@roundup.psfhosted.org> New submission from Rohan Amin : When using file.read() with a large text file, there is a UnicodeDecodeError. I expected file.read(1) to read one character from the file. It works with a smaller text file. I experienced this bug on Windows 10 version 20H2. My teacher couldn't reproduce this bug on Linux. ---------- components: IO, Unicode, Windows files: Bug Reproduction Code.zip messages: 396532 nosy: RohanA, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware priority: normal severity: normal status: open title: file.read() UnicodeDecodeError with large files on Windows type: behavior versions: Python 3.6, Python 3.9 Added file: https://bugs.python.org/file50126/Bug Reproduction Code.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 19:06:54 2021 From: report at bugs.python.org (Jason Yundt) Date: Fri, 25 Jun 2021 23:06:54 +0000 Subject: [issue44510] file.read() UnicodeDecodeError with large files on Windows In-Reply-To: <1624662372.97.0.0432881469482.issue44510@roundup.psfhosted.org> Message-ID: <1624662414.03.0.989396844459.issue44510@roundup.psfhosted.org> Change by Jason Yundt : ---------- nosy: +jayman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 20:12:00 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 26 Jun 2021 00:12:00 +0000 Subject: [issue44511] Improve the bytecode for mapping patterns Message-ID: <1624666320.05.0.738166042939.issue44511@roundup.psfhosted.org> New submission from Brandt Bucher : The generated bytecode for mapping patterns is more complicated than it needs to be: - Matching sub-patterns involves indexing into a tuple of values in order to extract them. We already know the size of this tuple at compile-time, so we can just unpack it onto the stack instead. - COPY_DICT_WITHOUT_KEYS isn't used anywhere else, and can be emulated with existing, smaller instructions (albeit using quite a few of them). - MATCH_KEYS doesn't need to push a boolean indicating match / no match. It already pushes None on no match, so following it with a simple DUP_TOP() + LOAD_CONST(None) + IS_OP(1) should suffice. These are mostly just refactoring opportunities... quick-and-dirty measurements of Lib/test_patma.py show no performance impact for these changes. ---------- assignee: brandtbucher components: Interpreter Core messages: 396533 nosy: brandtbucher priority: normal severity: normal status: open title: Improve the bytecode for mapping patterns versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 20:25:16 2021 From: report at bugs.python.org (Steve Dower) Date: Sat, 26 Jun 2021 00:25:16 +0000 Subject: [issue44510] file.read() UnicodeDecodeError with UTF-8 BOM in files on Windows In-Reply-To: <1624662372.97.0.0432881469482.issue44510@roundup.psfhosted.org> Message-ID: <1624667116.36.0.00619346002306.issue44510@roundup.psfhosted.org> Steve Dower added the comment: The file that fails contains a UTF-8 BOM at the start, which is a multibyte character indicating that the file is definitely UTF-8. Unfortunately, none of Python's default settings will handle this, because it's a convention that only really exists on Windows. On Windows we currently still default to your console encoding, since that is what we have always done and changing it by default is very complex. Apparently your console encoding does not include the character represented by the first byte of the BOM - in any case, it's not a character you'd ever want to see, so if it _had_ worked, you'd just have garbage in your read data. The immediate fix for your scenario is to use "open(filename, 'r', encoding='utf-8-sig')" which will handle the BOM correctly. For the core team, I still think it's worth having the default encoding be able to read and drop the UTF-8 BOM from the start of a file. Since we shouldn't do it for any arbitrary operation (which may not be at the start of a file), it'd have to be a special default object for the TextIOWrapper case, but it would have solved this issue. If the BOM is there, it can switch to UTF-8 (or UTF-16, if that BOM exists); if not, it can use whatever the default would have been (based on all the other available settings). ---------- nosy: +methane title: file.read() UnicodeDecodeError with large files on Windows -> file.read() UnicodeDecodeError with UTF-8 BOM in files on Windows versions: +Python 3.11 -Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 22:08:36 2021 From: report at bugs.python.org (Eryk Sun) Date: Sat, 26 Jun 2021 02:08:36 +0000 Subject: [issue44510] file.read() UnicodeDecodeError with UTF-8 BOM in files on Windows In-Reply-To: <1624662372.97.0.0432881469482.issue44510@roundup.psfhosted.org> Message-ID: <1624673316.31.0.979880820624.issue44510@roundup.psfhosted.org> Eryk Sun added the comment: > On Windows we currently still default to your console encoding In Windows, the default encoding for open() is the ANSI code page of the current process [1], from GetACP(), which is based on the system locale, unless it's overridden to UTF-8 in the application manifest. The console encoding is unrelated and not something we use much anymore since io._WindowsConsoleIO was introduced in Python 3.6. ---------- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed versions: +Python 3.6, Python 3.9 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 22:32:57 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 26 Jun 2021 02:32:57 +0000 Subject: [issue44512] csv.DictWriter: inconsistency in handling of extrasaction arg Message-ID: <1624674777.38.0.50893926031.issue44512@roundup.psfhosted.org> New submission from Andrei Kulakov : In csv.DictWriter, the arg `extrasaction` case is handled inconsistently: - if it's misspelled, e.g. ignor instead of 'ignore', a ValueError is raised by the __init__ method. - if it's 'Ignore', 'IGNORE', it will work properly - if it's 'raise', it will also work properly - BUT: if it's 'Raise' or 'RAISE', it will have the same effect as 'ignore' The code is here: https://github.com/python/cpython/blob/main/Lib/csv.py#L135-L146 [ins] In [1]: from csv import DictWriter [ins] In [4]: d=DictWriter(open('testcsv','w'),'abc',extrasaction='IGNORE') [ins] In [5]: list(d._dict_to_list(dict(d=1))) Out[6]: ['', '', ''] [ins] In [7]: d=DictWriter(open('testcsv','w'),'abc',extrasaction='RAISE') [ins] In [8]: list( d._dict_to_list(dict(d=1)) ) Out[8]: ['', '', ''] [ins] In [9]: d=DictWriter(open('testcsv','w'),'abc',extrasaction='TEST') --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in ----> 1 d=DictWriter(open('testcsv','w'),'abc',extrasaction='TEST') /usr/local/Cellar/python at 3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/csv.py in __init__(self, f, fieldnames, restval, extrasaction, dialect, *args, **kwds) 134 self.restval = restval # for writing short dicts 135 if extrasaction.lower() not in ("raise", "ignore"): --> 136 raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'" 137 % extrasaction) 138 self.extrasaction = extrasaction ValueError: extrasaction (TEST) must be 'raise' or 'ignore' [ins] In [10]: d=DictWriter(open('testcsv','w'),'abc',extrasaction='raise') [ins] In [11]: list( d._dict_to_list(dict(d=1)) ) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in ----> 1 list( d._dict_to_list(dict(d=1)) ) /usr/local/Cellar/python at 3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/csv.py in _dict_to_list(self, rowdict) 147 wrong_fields = rowdict.keys() - self.fieldnames 148 if wrong_fields: --> 149 raise ValueError("dict contains fields not in fieldnames: " 150 + ", ".join([repr(x) for x in wrong_fields])) 151 return (rowdict.get(key, self.restval) for key in self.fieldnames) ValueError: dict contains fields not in fieldnames: 'd' ---- I propose to accept any case of Raise, RAISE, etc, to have the effect of 'raise'. I can put up the PR if that sounds good. ---------- components: Library (Lib) messages: 396536 nosy: andrei.avk priority: normal severity: normal status: open title: csv.DictWriter: inconsistency in handling of extrasaction arg versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jun 25 23:23:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 26 Jun 2021 03:23:47 +0000 Subject: [issue44504] Make docstring quotes consistent in Lib/_collections_abc.py In-Reply-To: <1624537341.91.0.397818097073.issue44504@roundup.psfhosted.org> Message-ID: <1624677827.28.0.00983300607625.issue44504@roundup.psfhosted.org> Raymond Hettinger added the comment: Marking as closed for the reasons listed in the PR comments. ---------- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 00:22:23 2021 From: report at bugs.python.org (redrose2100) Date: Sat, 26 Jun 2021 04:22:23 +0000 Subject: [issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently Message-ID: <1624681343.46.0.141247598588.issue44513@roundup.psfhosted.org> New submission from redrose2100 : for string methods strip, lstrip, rstrip, when param is a string which has more than 1 char, currently those methods remove char ,but not remove string , it is no useful following is the results in python 3.9.5 Python 3.9.5 (default, May 18 2021, 14:42:02) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> s="hellolloehb" >>> print(s.lstrip("hello")) b >>> s="blloehhello" >>> print(s.rstrip("hello")) b >>> s="helloehhollbllohhehello" >>> print(s.strip("hello")) b >>> In fact, when s="hellolloehb" , s.lstrip("hello") expect to get "lloehb" when s="blloehhello" , s.rstrip("hello") expect to get "blloeh" when s="helloehhollbllohhehello" , s.strip("hello") expect to get "ehhollbllohhe" ---------- components: Library (Lib) messages: 396538 nosy: redrose2100 priority: normal severity: normal status: open title: for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 00:25:38 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 26 Jun 2021 04:25:38 +0000 Subject: [issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently In-Reply-To: <1624681343.46.0.141247598588.issue44513@roundup.psfhosted.org> Message-ID: <1624681538.24.0.388217084788.issue44513@roundup.psfhosted.org> Dennis Sweeney added the comment: This is the intended behavior. Use s.removeprefix() and s.removesuffix() instead. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 00:28:26 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 26 Jun 2021 04:28:26 +0000 Subject: [issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently In-Reply-To: <1624681343.46.0.141247598588.issue44513@roundup.psfhosted.org> Message-ID: <1624681706.7.0.377878023082.issue44513@roundup.psfhosted.org> Steven D'Aprano added the comment: Dennis is correct: these are working as attended, you have just misunderstood what they are supposed to do. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 02:01:54 2021 From: report at bugs.python.org (Kevin Follstad) Date: Sat, 26 Jun 2021 06:01:54 +0000 Subject: [issue44514] configparser.rst & bz2.rst leave temp files after 'make doctest' Message-ID: <1624687314.08.0.619588014681.issue44514@roundup.psfhosted.org> New submission from Kevin Follstad : Both Docs/library/configparser.rst and Docs/library/bz2.rst create untracked temp files on the filesystem when 'make doctest' is run because testcleanup directives are absent in these files. ---------- assignee: docs at python components: Documentation messages: 396541 nosy: docs at python, kfollstad priority: normal severity: normal status: open title: configparser.rst & bz2.rst leave temp files after 'make doctest' type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 02:05:21 2021 From: report at bugs.python.org (Kevin Follstad) Date: Sat, 26 Jun 2021 06:05:21 +0000 Subject: [issue44514] configparser.rst & bz2.rst leave temp files after 'make doctest' In-Reply-To: <1624687314.08.0.619588014681.issue44514@roundup.psfhosted.org> Message-ID: <1624687521.43.0.086657243757.issue44514@roundup.psfhosted.org> Change by Kevin Follstad : ---------- keywords: +patch pull_requests: +25485 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26909 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 02:59:56 2021 From: report at bugs.python.org (Martin) Date: Sat, 26 Jun 2021 06:59:56 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1624690796.64.0.349673904917.issue41539@roundup.psfhosted.org> Martin added the comment: Yes, I think it should at least be documented. But then it practically says: "Do not use print in your library because it might be used in a threading context" This sounds unacceptable to me. It would be great to "just make it work". > I debugged it a bit and I think the race may be between your print statement and the util._flush_std_streams() Why would print deadlock with a flush? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 03:58:38 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Jun 2021 07:58:38 +0000 Subject: [issue37398] contextlib.ContextDecorator decorating async functions In-Reply-To: <1561445403.56.0.10750759042.issue37398@roundup.psfhosted.org> Message-ID: <1624694318.73.0.41547446721.issue37398@roundup.psfhosted.org> Nick Coghlan added the comment: bpo-40816 took the much simpler approach of introducing a separate contextlib.AsyncContextDecorator class. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add missed AsyncContextDecorator to contextlib versions: +Python 3.10 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 04:10:31 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Sat, 26 Jun 2021 08:10:31 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1624695031.6.0.595884790976.issue41539@roundup.psfhosted.org> Antoine Pitrou added the comment: This is just issue6721 again. The workaround is easy: just add `multiprocessing.set_start_method("forkserver")` at the start of your program. Also, this is more or less documented, though quite tersely: """Note that safely forking a multithreaded process is problematic."" https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Locks in the standard library should be sanitized on fork versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 04:30:11 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Jun 2021 08:30:11 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC Message-ID: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> New submission from Nick Coghlan : Backporting the latest contextlib module and test suite to contextlib2, I ran into a couple of CI failures on PyPy3. Investigation showed that a couple of the new test cases were assuming the use of a refcounted GC. One could be fixed by switching to using a synchronous context manager instead of a ``__del__`` method, but the other needed a few explicit gc.collect() calls. ---------- assignee: ncoghlan keywords: 3.10regression messages: 396545 nosy: ncoghlan, yselivanov priority: normal severity: normal stage: commit review status: open title: contextlib test incompatibility with non-refcounted GC type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 04:30:21 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Jun 2021 08:30:21 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1624696221.59.0.411046809393.issue44515@roundup.psfhosted.org> Change by Nick Coghlan : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 04:42:04 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 26 Jun 2021 08:42:04 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1624696924.85.0.442663555498.issue44515@roundup.psfhosted.org> Change by Nick Coghlan : ---------- keywords: +patch pull_requests: +25486 stage: commit review -> patch review pull_request: https://github.com/python/cpython/pull/26910 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 05:22:10 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 26 Jun 2021 09:22:10 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1624699330.3.0.716498297863.issue44516@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- nosy: sbidoul priority: normal severity: normal status: open title: Update bundled pip to 21.1.3 versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 05:23:40 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 26 Jun 2021 09:23:40 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running Message-ID: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> New submission from Erlend E. Aasland : Builder: https://buildbot.python.org/all/#/builders/543 The buildbot has failed since 0982ded179f280176868c1c4eccf77bf70687816: bpo-44032: Move pointer to code object from frame-object to frame specials array. (GH-26771) Test stdio log attached. ---------- components: Subinterpreters, Tests files: test-stdio.txt messages: 396546 nosy: Mark.Shannon, erlendaasland, pablogsal, vstinner priority: normal severity: normal status: open title: test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running type: crash versions: Python 3.11 Added file: https://bugs.python.org/file50127/test-stdio.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 05:23:54 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 26 Jun 2021 09:23:54 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624699434.3.0.437309681312.issue44517@roundup.psfhosted.org> Erlend E. Aasland added the comment: Fatal Python error: Py_EndInterpreter: thread still has a frame Python runtime state: initialized Thread 0x00007ff625ee4740 (most recent call first): File "", line 4 in make: *** [Makefile:1256: buildbottest] Aborted (core dumped) program finished with exit code 2 elapsedTime=382.700268 test_still_running (test.test__xxsubinterpreters.DestroyTests) ... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 05:26:01 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 26 Jun 2021 09:26:01 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1624699561.1.0.415857820237.issue44516@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- keywords: +patch pull_requests: +25487 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26912 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 06:41:59 2021 From: report at bugs.python.org (John Belmonte) Date: Sat, 26 Jun 2021 10:41:59 +0000 Subject: [issue37398] contextlib.ContextDecorator decorating async functions In-Reply-To: <1561445403.56.0.10750759042.issue37398@roundup.psfhosted.org> Message-ID: <1624704119.68.0.603864860742.issue37398@roundup.psfhosted.org> John Belmonte added the comment: > bpo-40816 took the much simpler approach of introducing a separate contextlib.AsyncContextDecorator class How do I apply AsyncContextDecorator to the use case of wrapping either a sync or async function with a synchronous context manager? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 07:08:01 2021 From: report at bugs.python.org (Martin) Date: Sat, 26 Jun 2021 11:08:01 +0000 Subject: [issue41539] print blocks with multiprocessing and buffered output In-Reply-To: <1597311730.71.0.906884435677.issue41539@roundup.psfhosted.org> Message-ID: <1624705681.31.0.702928266709.issue41539@roundup.psfhosted.org> Martin added the comment: Thanks for the pointer, @pitrou! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 09:22:26 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 13:22:26 +0000 Subject: [issue44465] html.escape can be used in a few places in the standard lib instead of similar existing code In-Reply-To: <1624160430.21.0.153812631131.issue44465@roundup.psfhosted.org> Message-ID: <1624713746.7.0.166583411607.issue44465@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +ezio.melotti _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 09:55:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 26 Jun 2021 13:55:21 +0000 Subject: [issue44109] missing dataclass decorator in match-statement example In-Reply-To: <1620736569.02.0.465666569793.issue44109@roundup.psfhosted.org> Message-ID: <1624715721.69.0.244047434446.issue44109@roundup.psfhosted.org> Andrei Kulakov added the comment: Ahmet: once there's agreement on how to fix this, would you like to work on a patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 10:14:30 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 14:14:30 +0000 Subject: [issue44481] Tkinter config() minor documentation bug for shorthand options In-Reply-To: <1624319051.28.0.321773416541.issue44481@roundup.psfhosted.org> Message-ID: <1624716870.85.0.921586582633.issue44481@roundup.psfhosted.org> Terry J. Reedy added the comment: The specific subsection link is https://docs.python.org/3/library/tkinter.html#setting-options The outputs >>> import tkinter as tk >>> r = tk.Tk() >>> r.config('bg') ('background', 'background', 'Background', , 'SystemButtonFace') >>> r.config()['bg'] ('bg', '-background') I think "Example: >>> print(fred.config()) {'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')} Of course, the dictionary printed will include all the options available and their values. This is meant only as an example." would be clearer with ellipses instead of the sentence after a misleading output. "Example key-value pair in the dictionary returned by config(): >>> fred.config() {..., 'relief': ('relief', 'relief', 'Relief', 'raised', 'groove'), ...}" The previous code should set the relieve to 'groove' in order for this to make more sense. Or, instead use example with 2- and 5-tuples. {..., 'fg': ('fg', '-foreground'), ..., 'foreground': ('foreground', 'foreground', 'Foreground', 'SystemButtonText', 'SystemButtonText'), ...} --- Side note: the third members of these tuples are reversed. Bug in tk? b.config('activebackground') ('activebackground', 'activeBackground', 'Foreground', 'SystemButtonFace', 'SystemButtonFace') b.config('activeforeground') ('activeforeground', 'activeForeground', 'Background', 'SystemButtonText', 'SystemButtonText') ---------- assignee: -> docs at python components: +Documentation nosy: +docs at python, serhiy.storchaka, terry.reedy stage: -> needs patch versions: +Python 3.11 -Python 3.6, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 10:49:27 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 14:49:27 +0000 Subject: [issue13814] Document why generators don't support the context management protocol In-Reply-To: <1326883396.25.0.884733470267.issue13814@psf.upfronthosting.co.za> Message-ID: <1624718967.53.0.8371820727.issue13814@roundup.psfhosted.org> Terry J. Reedy added the comment: Note: Rietveld patch reviews are no longer accessible so I could not look at R. David's comments. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 10:54:06 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 14:54:06 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624719246.88.0.362546807715.issue44482@roundup.psfhosted.org> Terry J. Reedy added the comment: Nick Coughlin explained on issue 13814 msg151763 why he thought that making generators be context managers could/should not be done. "Generators deliberately don't support the context management protocol. This is so that they raise an explicit TypeError or AttributeError (pointing out that __exit__ is missing) if you leave out the @contextmanager decorator when you're using a generator to write an actual context manager. Generators supporting the context management protocol natively would turn that into a far more subtle (and confusing) error: your code would silently fail to invoke the generator body. Ensuring this common error remains easy to detect is far more important than making it easier to invoke close() on a generator object (particularly when contextlib.closing() already makes that very easy)." The new entry in the Design FAQ is this: "Why don?t generators support the with statement? For technical reasons, a generator used directly as a context manager would not work correctly. When, as is most common, a generator is used as an iterator run to completion, no closing is needed. When it is, wrap it as ?contextlib.closing(generator)? in the ?with? statment." If Nick's explanation is not currently correct, the above should be removed. If it is, perhaps further doc is needed. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 11:05:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 15:05:02 +0000 Subject: [issue44185] mock_open file handle __exit__ does not call close In-Reply-To: <1621498625.9.0.422400740011.issue44185@roundup.psfhosted.org> Message-ID: <1624719902.43.0.154953501611.issue44185@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +michael.foord versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 11:05:24 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 15:05:24 +0000 Subject: [issue44503] Hide __enter__ calls in mock_open In-Reply-To: <1624532935.8.0.760752273219.issue44503@roundup.psfhosted.org> Message-ID: <1624719924.09.0.416031205448.issue44503@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +michael.foord _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 12:36:16 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 26 Jun 2021 16:36:16 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1624725376.69.0.64604025153.issue44516@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- pull_requests: +25488 pull_request: https://github.com/python/cpython/pull/26915 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 14:09:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 26 Jun 2021 18:09:37 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624730977.51.0.176955161604.issue44482@roundup.psfhosted.org> Guido van Rossum added the comment: That explanation is still valid, I just hadn?t thought of it that way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 14:24:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 26 Jun 2021 18:24:56 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624731896.47.0.13855127753.issue44482@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25489 pull_request: https://github.com/python/cpython/pull/26916 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 14:51:20 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Sat, 26 Jun 2021 18:51:20 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1624733480.45.0.947816400625.issue44516@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- pull_requests: +25490 pull_request: https://github.com/python/cpython/pull/26917 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 14:55:38 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 26 Jun 2021 18:55:38 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624733738.81.0.347229745068.issue40528@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25491 pull_request: https://github.com/python/cpython/pull/26918 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 15:26:05 2021 From: report at bugs.python.org (Carlo Cabrera) Date: Sat, 26 Jun 2021 19:26:05 +0000 Subject: [issue43964] ctypes CDLL search path issue on MacOS In-Reply-To: <1619599189.53.0.161750349555.issue43964@roundup.psfhosted.org> Message-ID: <1624735565.43.0.591307524502.issue43964@roundup.psfhosted.org> Carlo Cabrera added the comment: Re option 3: relying on `DYLD_LIBRARY_PATH` or `DYLD_FRAMEWORK_PATH` isn't a great solution either because of SIP. It's can get impractical to use in many standard Makefile-based build systems, for example. (cf. https://github.com/qmk/qmk_cli/issues/60, https://github.com/Homebrew/discussions/discussions/1737) I imagine it can get quite vexing to set these variables but find them to not have the effect you expected them to. One workaround for the example above would be to compile your own `make` program (or use one from a package manager) so that SIP doesn't sanitise your environment, but I imagine that's not an ideal solution either. ---------- nosy: +ccabrera _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 16:24:49 2021 From: report at bugs.python.org (E. Paine) Date: Sat, 26 Jun 2021 20:24:49 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624739089.74.0.239534199141.issue44404@roundup.psfhosted.org> E. Paine added the comment: Can this issue be closed? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 17:01:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 21:01:39 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624741299.09.0.692807968392.issue40620@roundup.psfhosted.org> Terry J. Reedy added the comment: Another alternative is to make the example *be* interactive. This would also teach the easy, standard, and often better way to see the output of an iterable. >>> list(range(5, 10)) [5, 6, 7, 8, 9] >>> list(range(0, 10, 3)) [0, 3, 6, 9] >>> list(range(-10, -100, -30)) [-10, -40, -70] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 17:42:56 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 26 Jun 2021 21:42:56 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624743776.69.0.841450432893.issue40620@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 5.0 -> 6.0 pull_requests: +25492 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26919 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 18:43:15 2021 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 26 Jun 2021 22:43:15 +0000 Subject: [issue33408] Enable AF_UNIX support in Windows In-Reply-To: <1525257332.06.0.682650639539.issue33408@psf.upfronthosting.co.za> Message-ID: <1624747395.63.0.051186758697.issue33408@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 18:43:40 2021 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 26 Jun 2021 22:43:40 +0000 Subject: [issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes In-Reply-To: <1623790819.66.0.954991188371.issue44428@roundup.psfhosted.org> Message-ID: <1624747420.24.0.22799329354.issue44428@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 18:44:35 2021 From: report at bugs.python.org (Thomas Grainger) Date: Sat, 26 Jun 2021 22:44:35 +0000 Subject: [issue44428] _ProactorBasePipeTransport.abort() after _ProactorBasePipeTransport.close() does not cancel writes In-Reply-To: <1623790819.66.0.954991188371.issue44428@roundup.psfhosted.org> Message-ID: <1624747475.76.0.192397320527.issue44428@roundup.psfhosted.org> Thomas Grainger added the comment: nosying the author of the selector_events fix ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:31:41 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Jun 2021 23:31:41 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624750301.98.0.0557575435471.issue44468@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25493 pull_request: https://github.com/python/cpython/pull/26920 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:31:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 26 Jun 2021 23:31:42 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624750302.26.0.517994659368.issue44468@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 7569c0fe91dfcf562dee8c29798ecda74d738aa8 by will-ca in branch 'main': bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862) https://github.com/python/cpython/commit/7569c0fe91dfcf562dee8c29798ecda74d738aa8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:40:18 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Jun 2021 23:40:18 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624750818.85.0.458428936779.issue44404@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25494 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26921 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:44:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 23:44:19 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624751059.82.0.944025530881.issue44404@roundup.psfhosted.org> Terry J. Reedy added the comment: When the backport is done or Serhiy changes his mind. Can you change labels on your own PRs? ---------- nosy: -miss-islington stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:45:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 26 Jun 2021 23:45:12 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624751112.85.0.50303729973.issue44404@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- stage: -> patch review _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 19:52:34 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 26 Jun 2021 23:52:34 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624751554.93.0.834244585449.issue44468@roundup.psfhosted.org> miss-islington added the comment: New changeset 3df23b5199a4bb237a595cadca6c49d34ab2a56c by Miss Islington (bot) in branch '3.10': [3.10] bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862) (GH-26920) https://github.com/python/cpython/commit/3df23b5199a4bb237a595cadca6c49d34ab2a56c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 20:31:15 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 27 Jun 2021 00:31:15 +0000 Subject: [issue44511] Improve the bytecode for mapping patterns In-Reply-To: <1624666320.05.0.738166042939.issue44511@roundup.psfhosted.org> Message-ID: <1624753875.32.0.924372560963.issue44511@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +25495 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26922 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 21:17:56 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sun, 27 Jun 2021 01:17:56 +0000 Subject: [issue36991] zipfile: AttributeError on extract In-Reply-To: <1558441602.37.0.911226270551.issue36991@roundup.psfhosted.org> Message-ID: <1624756676.76.0.688845888962.issue36991@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jun 26 22:32:00 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 27 Jun 2021 02:32:00 +0000 Subject: [issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes? In-Reply-To: <1624248699.71.0.0674887100793.issue44468@roundup.psfhosted.org> Message-ID: <1624761120.16.0.307221064163.issue44468@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 00:44:12 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 27 Jun 2021 04:44:12 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624769052.74.0.0939703427847.issue44452@roundup.psfhosted.org> Vedran ?a?i? added the comment: It doesn't make sense to "concatenate" one absolute path to another. / has a simple explanation: if you start at /foo, and then do cd bar, you'll end up in /foo/bar. But if you start at /foo, and then do cd /bar, you'll end up in /bar. You mean, some of your users write '/some/path' when they mean 'some/path'? Then the users should be educated about the difference. These are not the same, just like '../some/path' is not the same as them, and '~some/path' is again something very different. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 03:40:13 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 27 Jun 2021 07:40:13 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1624779613.75.0.695215931284.issue42197@roundup.psfhosted.org> Nick Coghlan added the comment: I've updated PEP 558 with a reference back to this ticket as additional motivation (the update also addresses several of the fragility concerns that Mark raised): https://github.com/python/peps/pull/1787 There's still work to be done to bring the reference implementation into line with the updated proposal, but I'm making it an explicit goal to get the proposal submitted for pronouncement in time for inclusion in 3.11. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 04:02:12 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Jun 2021 08:02:12 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624780932.61.0.268634476894.issue44404@roundup.psfhosted.org> miss-islington added the comment: New changeset e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 by Miss Islington (bot) in branch '3.10': bpo-44404: tkinter `after` support callable classes (GH-26812) https://github.com/python/cpython/commit/e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 04:05:21 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 08:05:21 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624781121.97.0.0421561114488.issue44404@roundup.psfhosted.org> Serhiy Storchaka added the comment: There were some issues with the backporting bot. Seems they were temporary. Thank you for your contribution E. Paine. For this issue and others. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 04:20:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 08:20:20 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624782020.92.0.239458163867.issue44452@roundup.psfhosted.org> Serhiy Storchaka added the comment: I understand why this problem arose. If you parse an HTTP URL, its path always starts with "/" if not empty. And you usually want to interpret it as a relative to some base directory. But lstrip('/') works well here. In any case you need to have some validation to disallow "..". I think that adding yet one operation will confuse users. And what to do with C:\foo\bar, C:foo\bar, \\?\c\foo\bar, etc? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 04:34:32 2021 From: report at bugs.python.org (Julien Palard) Date: Sun, 27 Jun 2021 08:34:32 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1624782872.05.0.780580207124.issue42238@roundup.psfhosted.org> Julien Palard added the comment: Spotted a true positive in b19f45533942e4ad7ddf9d2d94f8b87c6f746bce: :const:``None`` (I'm trying to build a true positive list, to have usefull cases where suspicious is usefull, so in the long term I can maybe implement those cases in rslint instead.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 04:40:29 2021 From: report at bugs.python.org (Julien Palard) Date: Sun, 27 Jun 2021 08:40:29 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1624783229.25.0.854322517999.issue42238@roundup.psfhosted.org> Julien Palard added the comment: The previous one could probably be implemented in rstlint using (an equivalent of): git grep ':[a-z]\+:``[^:` ]+``' Doc/ Maybe specialized to known roles, like the script specializes to known directives. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 05:11:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 09:11:32 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred Message-ID: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> New submission from Serhiy Storchaka : In the following example: def gen(): try: yield 1 finally: print('finalize inner') def func(): try: for x in gen(): break finally: print('finalize outer') func() print('END') the output in CPython is: finalize inner finalize outer END But in similar example for asynchronous generator: async def gen(): try: yield 1 finally: print('finalize inner') async def func(): try: async for x in gen(): break finally: print('finalize outer') import asyncio asyncio.run(func()) print('END') the output in CPython is: finalize outer finalize inner END There is a strong link somewhere which prevents finalization of the asynchronous generator object until leaving the outer function. Tested on CPython 3.7-3.11. In PyPy "finalize inner" is not printed at all. Using closing() and aclosing() is the right way to get deterministic finalization, but in any case it would be better to get rid of strong link which prevents finalization of the asynchronous generator object. ---------- components: Interpreter Core messages: 396569 nosy: Mark.Shannon, asvetlov, gvanrossum, serhiy.storchaka, yselivanov priority: normal severity: normal status: open title: Finalization of non-exhausted asynchronous generators is deferred type: resource usage versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 05:34:21 2021 From: report at bugs.python.org (E. Paine) Date: Sun, 27 Jun 2021 09:34:21 +0000 Subject: [issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__) In-Reply-To: <1623531192.89.0.502203464734.issue44404@roundup.psfhosted.org> Message-ID: <1624786461.59.0.82227455833.issue44404@roundup.psfhosted.org> E. Paine added the comment: > Can you change labels on your own PRs? Sadly not (hence why I need to ask for e.g. skip news) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 06:29:30 2021 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Sun, 27 Jun 2021 10:29:30 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624789769.99.0.257757860591.issue44452@roundup.psfhosted.org> Zbyszek J?drzejewski-Szmek added the comment: > It doesn't make sense to "concatenate" one absolute path to another. Please see the original description of the issue, or Serhiy's example. I was thinking about about a case where paths are resolved relative to a container root in a filesystem. Serhiy brings up the case of a web server which concatenates paths from one namespace (URLs) to paths from another (fs paths). > / has a simple explanation: if you start at /foo, and then do cd bar, you'll end up in /foo/bar. But if you start at /foo, and then do cd /bar, you'll end up in /bar. You are thinking about a user doing operations in a shell. The two cases described are precisely NOT like this. In both examples, no matter what the path is, it is not allowed to go above the "root of the namespace". I.e. if you start at "/foo", and concatenate "/bar", you end up in "/foo/bar". If you are looking up "https://example.com/some/path", you want "/srv/www/some/path", etc. > what to do with C:\foo\bar, C:foo\bar, \\?\c\foo\bar, etc? I think that with those paths there is no solution. They already don't work in any reasonable way: >>> pathlib.Path('/asdf') / ("C:/some/path") PosixPath('/asdf/C:/some/path') >>> pathlib.Path('C:\\asdf') / ("C:/some/path") PosixPath('C:\\asdf/C:/some/path') Windows paths make no sense in the context of combination of namespaces and path concatenation, so I think it's fine to keep current behaviour (whatever it exactly is) for them. While the UNIX paths were designed to allow arbitrary nesting, the Windows paths were designed to always allow per-volume operations. The two concepts cannot be combined. > In any case you need to have some validation to disallow "..". Yes, that is a good point. In my code I do some validation that disallows ".." early on. But I think that the hypothetical //-operator should reject paths with "..". > But lstrip('/') works well here. It kind of does, but - it's rather verbose - it breaks the order, because it's on the right of the argument. I'll write to python-ideas. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 06:57:34 2021 From: report at bugs.python.org (Fabio Zadrozny) Date: Sun, 27 Jun 2021 10:57:34 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1624791454.17.0.674277597529.issue42197@roundup.psfhosted.org> Fabio Zadrozny added the comment: @ncoghlan I took a quick look at the PEP... I'm a bit worried about: > On optimised frames, the Python level f_locals API will become a direct read/write proxy for the frame's local and closure variable storage, and hence no longer support storing additional data that doesn't correspond to a local or closure variable on the underyling frame object. In particular, it's common for a debugger to evaluate expressions in a context that would change the locals to add new variables. i.e.: stopping at a breakpoint and doing 2 `exec` calls with frame.f_locals with: import some_module v = some_module.compute(xxx) So, it's expected that `some_module` and `v` would be in the locals at this point. Right now after each line of the evaluation, a `PyFrame_FastToLocals` must be called so things work as they should, but given that the PEP explicitly says that it should be deprecated, and this being a common feature for a debugger, what'd be the proper way to support that? p.s.: should I ask such questions regarding the PEP somewhere else instead of this issue or is this an appropriate place? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 07:28:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 11:28:49 +0000 Subject: [issue44482] Possible resource leeak in glob in non-refcount implementations In-Reply-To: <1624340418.29.0.31085247702.issue44482@roundup.psfhosted.org> Message-ID: <1624793329.51.0.744907179081.issue44482@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 4861fdaf25f246eb9ee4e8161c15dad26efe895d by Serhiy Storchaka in branch '3.9': [3.9] bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843). (GH-26916) https://github.com/python/cpython/commit/4861fdaf25f246eb9ee4e8161c15dad26efe895d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 07:59:27 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 27 Jun 2021 11:59:27 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1624795167.07.0.359420085534.issue42197@roundup.psfhosted.org> Mark Shannon added the comment: > So, it's expected that `some_module` and `v` would be in the locals at this point. If a function does not have the local variables `some_module` and `v`, then the change wouldn't be visible to the debugee. So what difference does it make? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 08:05:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 12:05:15 +0000 Subject: [issue44110] Improve string's __getitem__ error message In-Reply-To: <1620766225.38.0.0603325093774.issue44110@roundup.psfhosted.org> Message-ID: <1624795515.52.0.199555650603.issue44110@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ed1076428cca3c8dc7d075c16a575aa390e25fb8 by Miguel Brito in branch 'main': bpo-44110: Improve string's __getitem__ error message (GH-26042) https://github.com/python/cpython/commit/ed1076428cca3c8dc7d075c16a575aa390e25fb8 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 08:12:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 12:12:22 +0000 Subject: [issue44110] Improve string's __getitem__ error message In-Reply-To: <1620766225.38.0.0603325093774.issue44110@roundup.psfhosted.org> Message-ID: <1624795942.6.0.833157179044.issue44110@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 08:13:55 2021 From: report at bugs.python.org (Fabio Zadrozny) Date: Sun, 27 Jun 2021 12:13:55 +0000 Subject: [issue42197] Disable automatic update of frame locals during tracing In-Reply-To: <1603981001.04.0.667888856285.issue42197@roundup.psfhosted.org> Message-ID: <1624796035.27.0.534567409041.issue42197@roundup.psfhosted.org> Fabio Zadrozny added the comment: > > So, it's expected that `some_module` and `v` would be in the locals at this point. > If a function does not have the local variables `some_module` and `v`, then the change wouldn't be visible to the debugee. So what difference does it make? Right now such changes are visible to the debugee in the locals frames if a user does the `exec` and calls `PyFrame_FastToLocals` right afterwards (even if they weren't initially there). So, it's the difference between being able to import a module and creating/manipulating new variables in an `exec` in any frame (as it works right now) or not being able to make it at all (if that feature is deprecated as is being implied in the PEP). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 08:14:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 27 Jun 2021 12:14:59 +0000 Subject: [issue44110] Improve string's __getitem__ error message In-Reply-To: <1620766225.38.0.0603325093774.issue44110@roundup.psfhosted.org> Message-ID: <1624796099.01.0.68206187254.issue44110@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your contribution Miguel. I decided to not backport this change to 3.10 because the benefit is too small in comparison with possibility to break someone's tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 08:55:06 2021 From: report at bugs.python.org (Julien Palard) Date: Sun, 27 Jun 2021 12:55:06 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624798506.5.0.939575643964.issue44470@roundup.psfhosted.org> Julien Palard added the comment: Thanks all for reporting and following on the issue. The fix on docsbuild script worked as expected and the page now 404 as expected as it does no logner exists in 3.11: https://docs.python.org/3.11/library/parser.html ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 09:03:15 2021 From: report at bugs.python.org (Julien Palard) Date: Sun, 27 Jun 2021 13:03:15 +0000 Subject: [issue44470] 3.11 docs.python.org in Polish not English? In-Reply-To: <1624258355.63.0.825475628203.issue44470@roundup.psfhosted.org> Message-ID: <1624798995.72.0.0785524227577.issue44470@roundup.psfhosted.org> Julien Palard added the comment: > My computer is only configured for English. Running Firefox 90.0b9 (64-bit) on macOS 11.4 (20F71). To add to this, it had nothing to do with your setup, the file was just lying here on the server due to the previous build happening on the same hierarchy. That's why adding a git clean fixed it. Next time you find a similar issue you can easily test if it's dependent on your setup or not by trying a curl in command-line: $ curl https://docs.python.org/3.11/library/parser.html curl sends very simple requests, without looking at your locale preferences, like: GET /3.11/library/parser.html HTTP/1.1 Host: docs.python.org User-Agent: curl/7.74.0 Accept: */* so it permit to easily disambiguate if it's tied to your browser or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 10:17:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 27 Jun 2021 14:17:20 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624803440.64.0.590649989101.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: I haven't observed this issue on the CI since GH-26893 through GH-26896 was merged. Marking this as resolved. If anyone disagrees, feel free to reopen :) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 10:24:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 14:24:56 +0000 Subject: [issue20752] Difflib should provide the option of overriding the SequenceMatcher In-Reply-To: <1393193816.17.0.662615840954.issue20752@psf.upfronthosting.co.za> Message-ID: <1624803896.57.0.669594440207.issue20752@roundup.psfhosted.org> Irit Katriel added the comment: I agree with Terry that this proposal significantly complicates the API and the motivation for it is not very strong. I will close the issue in a couple of weeks if nobody objects. ---------- nosy: +iritkatriel resolution: -> rejected status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 10:28:32 2021 From: report at bugs.python.org (David Lambert) Date: Sun, 27 Jun 2021 14:28:32 +0000 Subject: [issue44519] help(math.fabs) Message-ID: <1624804112.12.0.943654144.issue44519@roundup.psfhosted.org> New submission from David Lambert : math.fabs returns float. The documentation should say so, and help(math.fabs) should include the expected return type -> float fabs(x, /) -> float Return the absolute value of the float x. I did not check, but expect these annotations recommendations are pervasive throughout the python libraries. ---------- assignee: docs at python components: Documentation messages: 396582 nosy: David Lambert, docs at python priority: normal severity: normal status: open title: help(math.fabs) type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 10:58:40 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 27 Jun 2021 14:58:40 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624805920.46.0.446858762335.issue40528@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 107a2c59c91b3911bdd6dfdb83271c588c506a5a by Batuhan Taskaya in branch 'main': bpo-40528: fix is_simple(sum)s behavior for attributes (GH-26918) https://github.com/python/cpython/commit/107a2c59c91b3911bdd6dfdb83271c588c506a5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 10:59:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 27 Jun 2021 14:59:34 +0000 Subject: [issue40528] Improve / Clear ASDL generator In-Reply-To: <1588763820.27.0.218398998224.issue40528@roundup.psfhosted.org> Message-ID: <1624805974.11.0.744873168388.issue40528@roundup.psfhosted.org> Batuhan Taskaya added the comment: These were all the cleanups on my checklist, so can close the issue now. I'll probably create other issues if something additional comes up ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 11:31:35 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 15:31:35 +0000 Subject: [issue18618] Need an atexit.register equivalent that also works in subinterps In-Reply-To: <1375379263.55.0.273685957163.issue18618@psf.upfronthosting.co.za> Message-ID: <1624807895.1.0.601977776507.issue18618@roundup.psfhosted.org> Irit Katriel added the comment: I think this is a duplicate of issue31901. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 12:11:26 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 27 Jun 2021 16:11:26 +0000 Subject: [issue44512] csv.DictWriter: inconsistency in handling of extrasaction arg In-Reply-To: <1624674777.38.0.50893926031.issue44512@roundup.psfhosted.org> Message-ID: <1624810286.47.0.181939949866.issue44512@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25496 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26924 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 12:14:09 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sun, 27 Jun 2021 16:14:09 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1624810449.61.0.725819917873.issue42238@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 12:42:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 27 Jun 2021 16:42:22 +0000 Subject: [issue44519] help(math.fabs) In-Reply-To: <1624804112.12.0.943654144.issue44519@roundup.psfhosted.org> Message-ID: <1624812142.09.0.703849361087.issue44519@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion but we've not adopted type annotations in the documentation. ---------- nosy: +rhettinger resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 12:58:02 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 27 Jun 2021 16:58:02 +0000 Subject: [issue17305] IDNA2008 encoding is missing In-Reply-To: <1361928766.42.0.728949411958.issue17305@psf.upfronthosting.co.za> Message-ID: <1624813082.78.0.947321442813.issue17305@roundup.psfhosted.org> Andrei Kulakov added the comment: Maybe deprecate idna so that users are strongly prompted to consider the pypi idna? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:00:26 2021 From: report at bugs.python.org (Eryk Sun) Date: Sun, 27 Jun 2021 17:00:26 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624813226.89.0.48418557162.issue44452@roundup.psfhosted.org> Eryk Sun added the comment: > I was thinking about about a case where paths are resolved relative > to a container root in a filesystem. I can see the need for generalized 'drive' support that sets an arbitrary path prefix as the 'drive'. For example, if "/var/tmp/instroot" is a 'drive', then joining it to "/some/path" returns "/var/tmp/instroot/some/path". However, subsequently joining that result to "/suffix" would return "/var/tmp/instroot/suffix". The "/some/path" part is replaced by "/suffix". This doesn't match your example to lstrip('/') from paths joined with the proposed `//` operator. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:11:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 17:11:03 +0000 Subject: [issue31314] email throws exception with oversized header input In-Reply-To: <1504175392.51.0.871887341171.issue31314@psf.upfronthosting.co.za> Message-ID: <1624813863.88.0.0178509246687.issue31314@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:41:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 27 Jun 2021 17:41:50 +0000 Subject: [issue20752] Difflib should provide the option of overriding the SequenceMatcher In-Reply-To: <1393193816.17.0.662615840954.issue20752@psf.upfronthosting.co.za> Message-ID: <1624815710.22.0.518314734967.issue20752@roundup.psfhosted.org> Terry J. Reedy added the comment: I reread the patch and my previous comment and am no more positive than I was then. The one use case presented is second-hand. Chris said "in order for [Bazaar] to use a custom sequence matcher, they had to essentially copy-paste and modify the stdlib diff methods in order to inject their own sequence matchers." Assuming that they did something like the patch, it is not clear why they did not instead patch/replace SequenceMatcher, and they are not involved here to speak. Enhancements need to be of some general use with multiple use cases or users. When I added the SequenceMatcher autojunk parameter in 3.2 to disable the autojunk heuristic, there had been multiple reports of how it caused problems. There has been no additional support given here, including none from Tim. One place to get other on board for enhancements is python-idea list. ---------- assignee: tim.peters -> status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:42:53 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 27 Jun 2021 17:42:53 +0000 Subject: [issue20752] Difflib should provide the option of overriding the SequenceMatcher In-Reply-To: <1393193816.17.0.662615840954.issue20752@psf.upfronthosting.co.za> Message-ID: <1624815773.16.0.272016848622.issue20752@roundup.psfhosted.org> Terry J. Reedy added the comment: 'Pending' is pretty useless because any comment erases it. This is a tracker bug that will not be fixed. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:57:10 2021 From: report at bugs.python.org (=?utf-8?q?Zbyszek_J=C4=99drzejewski-Szmek?=) Date: Sun, 27 Jun 2021 17:57:10 +0000 Subject: [issue44452] Allow paths to be joined without worrying about a leading slash In-Reply-To: <1624021106.97.0.804015487667.issue44452@roundup.psfhosted.org> Message-ID: <1624816630.02.0.555203131921.issue44452@roundup.psfhosted.org> Zbyszek J?drzejewski-Szmek added the comment: > I can see the need for generalized 'drive' support that sets an arbitrary path prefix as the 'drive'. For example, if "/var/tmp/instroot" is a 'drive', then joining it to "/some/path" returns "/var/tmp/instroot/some/path". However, subsequently joining that result to "/suffix" would return "/var/tmp/instroot/suffix". I think that the "drive concept" only makes sense on Windows. With POSIX paths, the expectation is that you can concatenate paths recursively, and consistency is much more useful than the drive concept. One special case where you might concat multiple levels of paths is when the paths are generated through some configuration mechanism, and an occasional absolute path might sneak in, but we still want to use the same "relative" concatenation. For example: def path_to_some_binary_in_container(container, usr_merge_was_done=True): """Construct a path with support for systems with /usr/bin and legacy systems with /bin (https://fedoraproject.org/wiki/Features/UsrMove). """ path_to_containers = '/var/lib/machines' prefix = 'usr/' if usr_merge_was_done else '/' suffix = 'bin/some-binary' return path_to_containers / container / prefix / suffix path_to_some_binary('cont1') returns PosixPath('/var/lib/machines/cont1/usr/bin/some-binary'), but path_to_some_binary('cont1', False) returns PosixPath('/bin/some-binary'). The "bug" is that '/' was used instead of ''. This is exactly the pitfall that I want to avoid: return path_to_containers // container // prefix // suffix will do the expected thing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 13:59:02 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 27 Jun 2021 17:59:02 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level In-Reply-To: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> Message-ID: <1624816742.28.0.248013193967.issue43718@roundup.psfhosted.org> Andrei Kulakov added the comment: Michael: Thanks for the report! would you like to create a PR? If not, I can do that. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 14:46:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 18:46:53 +0000 Subject: [issue32082] atexit module: allow getting/setting list of handlers directly In-Reply-To: <1511171681.08.0.213398074469.issue32082@psf.upfronthosting.co.za> Message-ID: <1624819613.45.0.791527358685.issue32082@roundup.psfhosted.org> Irit Katriel added the comment: See also issue17186. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 14:47:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 18:47:23 +0000 Subject: [issue17186] no way to introspect registered atexit handlers In-Reply-To: <1360622130.89.0.261803397072.issue17186@psf.upfronthosting.co.za> Message-ID: <1624819643.66.0.954948023867.issue17186@roundup.psfhosted.org> Irit Katriel added the comment: See also issue32082. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:08:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 27 Jun 2021 19:08:27 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level In-Reply-To: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> Message-ID: <1624820907.29.0.490744315182.issue43718@roundup.psfhosted.org> Andrei Kulakov added the comment: Also note that the debug arg should be provided only if it's greater than 0, for cases when you might want to have connection at debug 0, and a custom response class with a default nonzero debug level. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:12:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 19:12:34 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624821154.57.0.563799998515.issue38062@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +easy 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 Jun 27 15:27:34 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Jun 2021 19:27:34 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624822054.3.0.0328126100152.issue40620@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25497 pull_request: https://github.com/python/cpython/pull/26927 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:27:38 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Jun 2021 19:27:38 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624822058.53.0.38324956958.issue40620@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25498 pull_request: https://github.com/python/cpython/pull/26928 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:27:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 19:27:55 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624822075.48.0.672679741874.issue40620@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 2f49c9debc2efe010c757be3bdbd6493f1ebc5f6 by jdevries3133 in branch 'main': bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) https://github.com/python/cpython/commit/2f49c9debc2efe010c757be3bdbd6493f1ebc5f6 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:51:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 19:51:44 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624823504.87.0.15248380028.issue40620@roundup.psfhosted.org> Irit Katriel added the comment: New changeset aeb63392e74976b4289b38f32f1d6e7ff2e0a712 by Miss Islington (bot) in branch '3.10': bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) (GH-26927) https://github.com/python/cpython/commit/aeb63392e74976b4289b38f32f1d6e7ff2e0a712 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:52:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 19:52:36 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624823556.08.0.0513104345823.issue40620@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 1acd1e63850d179383fcb638dcefee4c66b3ca4e by Miss Islington (bot) in branch '3.9': bpo-40620: Clarify tutorial controlflow.rst ``range`` examples (GH-26919) (GH-26928) https://github.com/python/cpython/commit/1acd1e63850d179383fcb638dcefee4c66b3ca4e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 15:53:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 19:53:33 +0000 Subject: [issue40620] [doc] Range tutorial shorthand could be made clearer In-Reply-To: <1589436772.42.0.96031331267.issue40620@roundup.psfhosted.org> Message-ID: <1624823613.3.0.87347114292.issue40620@roundup.psfhosted.org> Irit Katriel added the comment: Thank you Jack! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:31:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 21:31:34 +0000 Subject: [issue43460] Exception copy error In-Reply-To: <1615375836.74.0.101407862938.issue43460@roundup.psfhosted.org> Message-ID: <1624829494.46.0.340648859334.issue43460@roundup.psfhosted.org> Irit Katriel added the comment: See issue32696, issue30005, issue29466 ---------- components: +Library (Lib) nosy: +iritkatriel versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:34:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 21:34:32 +0000 Subject: [issue32696] Fix pickling exceptions with multiple arguments In-Reply-To: <1517156155.35.0.467229070634.issue32696@psf.upfronthosting.co.za> Message-ID: <1624829672.44.0.571634730734.issue32696@roundup.psfhosted.org> Irit Katriel added the comment: See also issue43460, issue30005, issue29466 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:37:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 21:37:57 +0000 Subject: [issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes In-Reply-To: <1491458375.12.0.99955546052.issue30005@psf.upfronthosting.co.za> Message-ID: <1624829877.34.0.451423111915.issue30005@roundup.psfhosted.org> Irit Katriel added the comment: See also issue43460, issue32696, issue29466. ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:41:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 21:41:18 +0000 Subject: [issue29466] pickle does not serialize Exception __cause__ field In-Reply-To: <1486406196.69.0.481594976881.issue29466@psf.upfronthosting.co.za> Message-ID: <1624830078.79.0.514720084635.issue29466@roundup.psfhosted.org> Irit Katriel added the comment: I get different output for Serhiy's first example now, but the same for the second: >>> try: import foo ... except Exception as ex: exc = ex ... >>> exc.name 'foo' >>> exc.__reduce__() (, ("No module named 'foo'",), {'name': 'foo'}) >>> exc = StopIteration() >>> exc.value = 42 >>> exc.__reduce__() (, ()) >>> ---------- nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:41:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 27 Jun 2021 21:41:37 +0000 Subject: [issue29466] pickle does not serialize Exception __cause__ field In-Reply-To: <1486406196.69.0.481594976881.issue29466@psf.upfronthosting.co.za> Message-ID: <1624830097.21.0.0644305242792.issue29466@roundup.psfhosted.org> Irit Katriel added the comment: See also issue43460, issue32696, issue30005. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:42:26 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 27 Jun 2021 21:42:26 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1624830146.61.0.602795335649.issue44246@roundup.psfhosted.org> Jason R. Coombs added the comment: In https://github.com/python/importlib_metadata/issues/324, I painstakingly created a library to perform robust performance monitoring of behaviors in the library and specifically added tests that capture the performance of entry_points against importlib_metadata 1.4 (the same code used in Python 3.9). I furthermore attempted to replicate the reported performance concerns reported using the exact commands, and even then, Python 3.10b3 indicates a 3x+ improvement in performance, dispelling the claim that the issue is order of complexity of the resolution of entry points by group. I'll be open to new reports about performance concerns or other regressions w.r.t. the importlib.metadata changes, but please do not re-open this issue. ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:59:30 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 27 Jun 2021 21:59:30 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) In-Reply-To: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> Message-ID: <1624831170.31.0.27134019539.issue44464@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset efe7d08d178a7c09bcca994f2068b019c8633d83 by Jason R. Coombs in branch 'main': bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (#26807) https://github.com/python/cpython/commit/efe7d08d178a7c09bcca994f2068b019c8633d83 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 17:59:27 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 27 Jun 2021 21:59:27 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) In-Reply-To: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> Message-ID: <1624831167.28.0.72810764769.issue44464@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25499 pull_request: https://github.com/python/cpython/pull/26929 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 18:05:30 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 27 Jun 2021 22:05:30 +0000 Subject: [issue37741] importlib.metadata docs not showing up in the module index In-Reply-To: <1564685225.86.0.948746560612.issue37741@roundup.psfhosted.org> Message-ID: <1624831530.77.0.235433183794.issue37741@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 17b916737bd05a11ec24341990c4d8dbfee8f94b by Jason R. Coombs in branch '3.9': [3.9] bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-26500) https://github.com/python/cpython/commit/17b916737bd05a11ec24341990c4d8dbfee8f94b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 18:19:40 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 27 Jun 2021 22:19:40 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) In-Reply-To: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> Message-ID: <1624832380.03.0.602198631554.issue44464@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset f4b31cdbc043449f3df7d291da67bcb3736be0db by Miss Islington (bot) in branch '3.10': bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (GH-26807) (GH-26929) https://github.com/python/cpython/commit/f4b31cdbc043449f3df7d291da67bcb3736be0db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 19:13:14 2021 From: report at bugs.python.org (David Lambert) Date: Sun, 27 Jun 2021 23:13:14 +0000 Subject: [issue44519] help(math.fabs) In-Reply-To: <1624812142.09.0.703849361087.issue44519@roundup.psfhosted.org> Message-ID: David Lambert added the comment: Hi Ray, I'm glad this was a conscious choice.? I found a person confused by the output of print(abs(3), math.fabs(3)) Perhaps the manual would mention return values->that's not an annotation. Thanks for considering, Dave On 6/27/21 12:42 PM, Raymond Hettinger wrote: > Raymond Hettinger added the comment: > > Thanks for the suggestion but we've not adopted type annotations in the documentation. > > ---------- > nosy: +rhettinger > resolution: -> rejected > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jun 27 20:02:14 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Jun 2021 00:02:14 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred In-Reply-To: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> Message-ID: <1624838534.1.0.577462844011.issue44518@roundup.psfhosted.org> Guido van Rossum added the comment: Can you repro this without asyncio? ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 00:48:08 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 28 Jun 2021 04:48:08 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1624855688.33.0.992893989552.issue44516@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +lukasz.langa, pablogsal priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 01:31:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Jun 2021 05:31:27 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred In-Reply-To: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> Message-ID: <1624858287.46.0.395168261575.issue44518@roundup.psfhosted.org> Serhiy Storchaka added the comment: Sorry, I do not understand what do you mean. The problem is that non-exhausted asynchronous generators are not finalized until asyncio.run() is finished. This differs from synchronous generators which are finalized as early as possible (in CPython). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 02:49:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Jun 2021 06:49:52 +0000 Subject: [issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket In-Reply-To: <1613416609.25.0.407610615564.issue43232@roundup.psfhosted.org> Message-ID: <1624862992.33.0.728304835866.issue43232@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 02:59:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Jun 2021 06:59:16 +0000 Subject: [issue43234] Prohibit passing non-ThreadPoolExecutor executors to loop.set_default_executor following a deprecation In-Reply-To: <1613419901.25.0.801383845086.issue43234@roundup.psfhosted.org> Message-ID: <1624863556.86.0.982529326253.issue43234@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 03:21:44 2021 From: report at bugs.python.org (Michael Osipov) Date: Mon, 28 Jun 2021 07:21:44 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level In-Reply-To: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> Message-ID: <1624864904.03.0.451447085603.issue43718@roundup.psfhosted.org> Michael Osipov <1983-01-06 at gmx.net> added the comment: Thanks Andrei, please ahead and provide the PR. You'll do it faster than I do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:01:51 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 08:01:51 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624867311.44.0.683974829004.issue44229@roundup.psfhosted.org> STINNER Victor added the comment: http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ says: "If we trigger a send while the kernel is in the middle of tearing down the socket, it returns EPROTOTYPE." (instead of ECONNRESET) Maybe send() could raise a ConnectionResetError exception on EPROTOTYPE? ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:02:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 08:02:33 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624867353.85.0.00201379020287.issue44517@roundup.psfhosted.org> STINNER Victor added the comment: test-stdio.txt: ====================================================================== FAIL: test_from_subinterpreter (test.test_interpreters.TestInterpreterIsRunning) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64/build/Lib/test/test_interpreters.py", line 265, in test_from_subinterpreter self.assertEqual(out.strip(), 'True') AssertionError: 'False' != 'True' - False + True ====================================================================== FAIL: test_main (test.test_interpreters.TestInterpreterIsRunning) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-x86_64/build/Lib/test/test_interpreters.py", line 245, in test_main self.assertTrue(main.is_running()) AssertionError: False is not true ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:05:05 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 28 Jun 2021 08:05:05 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624867505.43.0.679287722016.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: But here, it is write() that returns EPROTOTYPE. See msg394798. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:11:11 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 28 Jun 2021 08:11:11 +0000 Subject: [issue44229] test_ssl: test_get_server_certificate() and test_msg_callback_deadlock_bpo43577() fail randomly on the macOS CI In-Reply-To: <1621927496.04.0.290597318406.issue44229@roundup.psfhosted.org> Message-ID: <1624867871.08.0.311821892312.issue44229@roundup.psfhosted.org> Erlend E. Aasland added the comment: I'd be interested in hearing Ronald's opinion. (Added to nosy.) ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:25:44 2021 From: report at bugs.python.org (=?utf-8?b?0J7Qu9C10LMg0JzQsNGB0LvQvg==?=) Date: Mon, 28 Jun 2021 08:25:44 +0000 Subject: [issue44520] exception is thrown if bs = None Message-ID: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> New submission from ???? ????? : need moved the check parameter to the top of the isnstance check, because if bs = None then an exception is thrown ---------- components: Library (Lib) messages: 396617 nosy: asicscwcs priority: normal pull_requests: 25500 severity: normal status: open title: exception is thrown if bs = None type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:36:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 08:36:56 +0000 Subject: [issue44520] exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624869416.88.0.233090614279.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: Crash is typically a segfault, not an exception. ---------- nosy: +iritkatriel type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:43:06 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 28 Jun 2021 08:43:06 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624869786.55.0.622630693859.issue44517@roundup.psfhosted.org> Mark Shannon added the comment: And today's price for uninformative error message goes to... "AssertionError: 'False' != 'True'" ;) I'm looking into it. ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 04:45:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 08:45:45 +0000 Subject: [issue44520] exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624869945.41.0.490143784592.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: Please describe the problem you would like to see fixed, rather than the code change you would like to make. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:23:46 2021 From: report at bugs.python.org (Alexandre Morignot) Date: Mon, 28 Jun 2021 09:23:46 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1624872226.37.0.639265968229.issue23041@roundup.psfhosted.org> Alexandre Morignot added the comment: I have another use case. I?want to import data into PostgreSQL using the COPY FROM command. This command can read a CSV input and it needs to distinguish empty string from null values. Could we reconsider this issue and the proposed solution? ---------- nosy: +erdnaxeli _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:31:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 09:31:12 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1624872672.08.0.405847429556.issue42892@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:36:20 2021 From: report at bugs.python.org (Petr Viktorin) Date: Mon, 28 Jun 2021 09:36:20 +0000 Subject: [issue40939] Remove the old parser In-Reply-To: <1591788317.65.0.969058655213.issue40939@roundup.psfhosted.org> Message-ID: <1624872980.85.0.00671801006925.issue40939@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset dc10264eb880ed63fcf42c17057f3f5d879a0a0c by Miss Islington (bot) in branch '3.10': bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855) (GH-26898) https://github.com/python/cpython/commit/dc10264eb880ed63fcf42c17057f3f5d879a0a0c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:40:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 28 Jun 2021 09:40:14 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624873214.55.0.497656735421.issue44517@roundup.psfhosted.org> Mark Shannon added the comment: I cannot reproduce this on ubuntu Ubuntu 20.04.2 LTS gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 I've tried these configs: ./configure --with-pydebug ./configure ./configure --enable-optimizations ./configure --enable-optimizations --with-lto I also tried turning the timeout down to 2 seconds, but the failure doesn't look anything like the reported error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:40:46 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 28 Jun 2021 09:40:46 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624873246.93.0.664262154379.issue44517@roundup.psfhosted.org> Mark Shannon added the comment: Can someone with fedora reproduce this failure? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:44:13 2021 From: report at bugs.python.org (=?utf-8?b?0J7Qu9C10LMg0JzQsNGB0LvQvg==?=) Date: Mon, 28 Jun 2021 09:44:13 +0000 Subject: [issue44520] exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624873453.01.0.429317870252.issue44520@roundup.psfhosted.org> ???? ????? added the comment: Irit, the problem is that if you pass the bs parameter equal to None to the quote_from_bytes function, then the bs parameter will not be checked for existence, because a TypeError exception will be raised, and an empty string needs to be returned in this case. The check "if not bs" should be earlier than "if not isinstance (bs, (bytes, bytearray))", because "if bs = None", then the code will not reach this check ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:52:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 09:52:56 +0000 Subject: [issue44520] exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624873976.33.0.282982989558.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: Right, so the question is whether it is correct that "an empty string needs to be returned in this case". Adding orsenthil to answer that as the module's expert. Also, your patch would need a unit test. ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 05:58:50 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 28 Jun 2021 09:58:50 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool Message-ID: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> New submission from ???? ????????? : #39939 introduced .removeprefix for several classes. I propose adding kwargs-only parameter `, *, strict: bool = False`. It should raise some exception (I'm unuse what exactly) if the string DOES NOT start from specified prefix. False by default only for compatibility purposes. Personally I think it should be True, but I understand why it's impossible to change API. The same about `removesuffix()`. ---------- components: Interpreter Core, Library (Lib) messages: 396627 nosy: socketpair priority: normal severity: normal status: open title: str.removeprefix(): add strict: bool type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 06:05:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 28 Jun 2021 10:05:35 +0000 Subject: [issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs. In-Reply-To: <1618774620.3.0.412025280445.issue43882@roundup.psfhosted.org> Message-ID: <1624874735.03.0.0631755531343.issue43882@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 634da2de88af06eb8c6ebdb90d8c00005847063d by Senthil Kumaran in branch '3.8': [3.8] bpo-43882 - Mention urllib.parse changes in Whats new section. (#26277) https://github.com/python/cpython/commit/634da2de88af06eb8c6ebdb90d8c00005847063d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 06:15:57 2021 From: report at bugs.python.org (Tom Cook) Date: Mon, 28 Jun 2021 10:15:57 +0000 Subject: [issue20779] Add pathlib.chown method In-Reply-To: <1393408310.22.0.917230781145.issue20779@psf.upfronthosting.co.za> Message-ID: <1624875357.77.0.874784126986.issue20779@roundup.psfhosted.org> Tom Cook added the comment: +1 this. I have a program that opens a UNIX socket as root for other processes to communicate with it. I need to set the permissions to 0o775 and set the owner gid to a specific group so that members of that group can communicate with the process. It's annoying to have to drop back to `os.chown(str(path), ...)` for this. ---------- nosy: +Tom Cook _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 08:11:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 12:11:35 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level In-Reply-To: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> Message-ID: <1624882295.77.0.235740978662.issue43718@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25501 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26932 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 08:12:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 12:12:44 +0000 Subject: [issue43718] HTTP CONNECT response not subject to debug level In-Reply-To: <1617479112.59.0.978864196695.issue43718@roundup.psfhosted.org> Message-ID: <1624882364.66.0.717595681189.issue43718@roundup.psfhosted.org> Andrei Kulakov added the comment: The PR is here: https://github.com/python/cpython/pull/26932 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 08:38:45 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 28 Jun 2021 12:38:45 +0000 Subject: [issue44464] Remove flake8 exception for deprecation warning (importlib.metadata) In-Reply-To: <1624153718.07.0.351819215831.issue44464@roundup.psfhosted.org> Message-ID: <1624883925.31.0.165720218679.issue44464@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 09:02:58 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Jun 2021 13:02:58 +0000 Subject: [issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624885378.64.0.359798148825.issue44520@roundup.psfhosted.org> Eric V. Smith added the comment: Clarifying the title. ---------- nosy: +eric.smith title: exception is thrown if bs = None -> In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 09:06:46 2021 From: report at bugs.python.org (Bupjae Lee) Date: Mon, 28 Jun 2021 13:06:46 +0000 Subject: [issue44522] [doc] open() function errors='surrogateescape' has inaccurate information Message-ID: <1624885606.68.0.537794724905.issue44522@roundup.psfhosted.org> New submission from Bupjae Lee : https://docs.python.org/3/library/functions.html#open error parameter of open() function says this: 'surrogateescape' will represent any incorrect bytes as code points in the Unicode Private Use Area ranging from U+DC80 to U+DCFF. However, U+DC80 to U+DCFF doesn't belong to "Unicode Private Use Area"; it belongs to "Low Surrogate Area". Suggested fix: 'surrogateescape' will represent any incorrect bytes as (unpaired) low surrogate code units ranging from U+DC80 to U+DCFF. ---------- assignee: docs at python components: Documentation messages: 396632 nosy: bupjae2, docs at python priority: normal severity: normal status: open title: [doc] open() function errors='surrogateescape' has inaccurate information 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 Mon Jun 28 09:13:36 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 13:13:36 +0000 Subject: [issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe) In-Reply-To: <1496151978.87.0.20600653197.issue30511@psf.upfronthosting.co.za> Message-ID: <1624886016.89.0.675377589308.issue30511@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 5.0 -> 6.0 pull_requests: +25502 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26933 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 09:14:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 13:14:35 +0000 Subject: [issue30511] shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe) In-Reply-To: <1496151978.87.0.20600653197.issue30511@psf.upfronthosting.co.za> Message-ID: <1624886075.45.0.339385406983.issue30511@roundup.psfhosted.org> Andrei Kulakov added the comment: PR is added here: https://github.com/python/cpython/pull/26933 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 09:21:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 13:21:23 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624886483.87.0.209967399186.issue44461@roundup.psfhosted.org> Irit Katriel added the comment: The difference between Jason's two test cases is which stage of Pdb._runmodule() fails. In the case of `python -m pdb -m importlib` runpy._get_module_details(module_name) raises an exception because importlib is a package and it looks for its __main__, so self.run(code) is never called. In the case of `python -m pdb -m foo` with foo that raises an exception, foo is not a package so the __main__ check doesn't happen. The exception comes from within the self.run(code) call (when the module is executed). self.run() calls self.reset() before executing the code, and reset() calls Bdb.reset() which initializes self.botframe (to None). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 09:22:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 13:22:39 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624886559.2.0.423786069099.issue44461@roundup.psfhosted.org> Irit Katriel added the comment: However, if we just try to initialize self.botframe to None in __init__, then 'quit' doesn't work anymore, so something else needs to be done about cleanup when import fails at that stage. ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:06:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Jun 2021 14:06:09 +0000 Subject: [issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624889169.04.0.841958276432.issue44520@roundup.psfhosted.org> Serhiy Storchaka added the comment: If you want to interpret None as an empty string, you can just write quote_from_bytes(data or b''). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:15:05 2021 From: report at bugs.python.org (Alexander Neumann) Date: Mon, 28 Jun 2021 14:15:05 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated Message-ID: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> New submission from Alexander Neumann : The documentation currently states: > Proxy objects are not hashable regardless of the referent; this avoids a number of problems related to their fundamentally mutable nature, and prevent their use as dictionary keys. callback is the same as the parameter of the same name to the ref() function. However, it seems with commit 96074de573f82fc66a2bd73c36905141a3f1d5c1 (https://github.com/python/cpython/commit/96074de573f82fc66a2bd73c36905141a3f1d5c1) hash/reversed pass throughs have been introduced that enable weakref.proxy to be used as a dictionary key. At least the following code fails with Python 3.8 but works with Python 3.9: ``` import weakref class Model: pass m = Model() proxy = weakref.proxy(m) ref = weakref.ref(m) print(hash(m)) print(hash(ref)) print(hash(proxy)) ``` ---------- assignee: docs at python components: Documentation messages: 396637 nosy: aleneum, docs at python priority: normal severity: normal status: open title: weakref.proxy documentation might be outdated type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:15:33 2021 From: report at bugs.python.org (Lars) Date: Mon, 28 Jun 2021 14:15:33 +0000 Subject: [issue44524] __name__ attribute in typing module Message-ID: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> New submission from Lars : I noticed some (perhaps intentional) oddities with the __name__ attribute: - typing classes like Any (subclass of _SpecialForm) do not have a __name__ attribute, - abstract base classes in typing, like MutableSet do not have a __name__ attribute, - 'ChainMap', 'Counter', 'OrderedDict' do not have a __name__ attribute when imported from typing, but do when imported from collections. I have written a function to show presence/absence if the name __name__ attribute: def split_module_names(module): unnamed, named = set(), set() for name in dir(module): if not name.startswith('_'): attr = getattr(module, name) try: if hasattr(attr, '__name__'): named.add(name) else: unnamed.add(name) except TypeError: pass return named, unnamed import typing import collections typing_named, typing_unnamed = split_module_names(typing) collec_named, collec_unnamed = split_module_names(collections) print("typing_unnamed:", typing_unnamed) print("collec_named & typing_unnamed:", collec_named & typing_unnamed) Is this intentional? It seems a little inconsistent. I also found something that sometimes the __name__ attribute does resolve: class S(typing.Sized): def __len__(self): return 0 print("'Sized' in typing_unnamed:", 'Sized' in typing_unnamed) print("[t.__name__ for t in S.__mro__]:", [t.__name__ for t in S.__mro__]) # here __name__ is resolved! print("getattr(typing.Sized, '__name__', None):", getattr(typing.Sized, '__name__', None)) printing: 'Sized' in typing_unnamed: True [t.__name__ for t in S.__mro__]: ['S', 'Sized', 'Generic', 'object'] getattr(typing.Sized, '__name__', None): None ---------- messages: 396638 nosy: farcat priority: normal severity: normal status: open title: __name__ attribute in typing module type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:22:18 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 28 Jun 2021 14:22:18 +0000 Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations Message-ID: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org> New submission from Ken Jin : CALL_FUNCTION can be specialized. Copying from Mark's comments https://github.com/faster-cpython/ideas/issues/54#issue-898013125 ``` There are a number of specializations of CALL_FUNCTION that make sense: 1. Calls to a Python function where the arguments and parameters match exactly. 2. Calls to a Python function with keyword arguments, or defaults, when the argument shuffle can be pre-computed. 3. Calls to builtin functions. 4. Calls to specific builtin functions, specifically len and instance. 5. Calls to type with a single argument. 6. Instantiation of a "normal" class, that is a class that does not redefine __new__ and whose metaclass is type. ``` I've prepared a PR that should speed up non-keyword calls to PyCFunction. It covers specializations 3 and 4. Stable pyperf microbenchmarks show 5-15% less call overhead for some PyCFunctions. Please see https://github.com/faster-cpython/ideas/issues/54#issuecomment-868978681 for the benchmark script and results. This issue is also tied to issue44207 (Add a version number to Python functions) which will be required for specializations 1 and 2. ---------- messages: 396639 nosy: Mark.Shannon, kj priority: normal severity: normal status: open title: Implement CALL_FUNCTION adaptive interpreter optimizations type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:24:52 2021 From: report at bugs.python.org (serif) Date: Mon, 28 Jun 2021 14:24:52 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= Message-ID: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> New submission from serif : Page: What?s New In Python 3.10 https://docs.python.org/3.10/whatsnew/3.10.html Section: PEP 634: Structural Pattern Matching Patterns and classes In the example code, x and y in the printed messages are swapped. case Point(x=0, y=y): print(f"Y={y} and the point is on the y-axis.") case Point(x=x, y=0): print(f"X={x} and the point is on the x-axis.") Should be: case Point(x=0, y=y): print(f"Y={y} and the point is on the x-axis.") case Point(x=x, y=0): print(f"X={x} and the point is on the y-axis.") ---------- assignee: docs at python components: Documentation messages: 396640 nosy: docs at python, serif2 priority: normal severity: normal status: open title: Doc typo in "What?s New In Python 3.10" (x/y-axis) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 10:33:06 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 28 Jun 2021 14:33:06 +0000 Subject: [issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations In-Reply-To: <1624890138.2.0.824780513801.issue44525@roundup.psfhosted.org> Message-ID: <1624890786.23.0.853213060914.issue44525@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +25503 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26934 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 11:14:37 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Jun 2021 15:14:37 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1624893277.78.0.405921243592.issue44524@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 11:17:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Jun 2021 15:17:43 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624893463.1.0.756147471647.issue44523@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> pablogsal nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 11:21:04 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 15:21:04 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624893664.25.0.620628012053.issue38062@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26935 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 11:57:52 2021 From: report at bugs.python.org (Skip Montanaro) Date: Mon, 28 Jun 2021 15:57:52 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1624895872.17.0.630910228859.issue23041@roundup.psfhosted.org> Skip Montanaro added the comment: Okay, I'll reopen this, at least for the discussion of QUOTE_NONNULL. @erdnaxeli please given an example of how PostgreSQL distinguishes between the empty string and None cases. Is it a quoted empty string vs an empty field? If so, modifying @samwyse's original example, is this what you are after? >>> csv.register_dialect('quote_notnull', quoting=csv.QUOTE_NOTNULL) >>> csv.writer(sys.stdout, dialect='quote_notnull').writerow(['', None, 42]) "",,"42" ? Can you modify the original two patches to restrict to QUOTE_NONNULL? ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 11:58:26 2021 From: report at bugs.python.org (Skip Montanaro) Date: Mon, 28 Jun 2021 15:58:26 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1624895906.59.0.838217751628.issue23041@roundup.psfhosted.org> Skip Montanaro added the comment: Missed tweaking a couple settings. ---------- resolution: rejected -> stage: resolved -> needs patch versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:00:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Jun 2021 16:00:42 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred In-Reply-To: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> Message-ID: <1624896042.89.0.989735536597.issue44518@roundup.psfhosted.org> Guido van Rossum added the comment: I am wondering whether the issue is in asyncio.run, or in the basic async generator implementation. If the latter, you should be able to demonstrate this with a manual "driver" (trampoline?) instead of asyncio.run. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:00:31 2021 From: report at bugs.python.org (Skip Montanaro) Date: Mon, 28 Jun 2021 16:00:31 +0000 Subject: [issue23041] csv needs more quoting rules In-Reply-To: <1418402205.61.0.685044268577.issue23041@psf.upfronthosting.co.za> Message-ID: <1624896031.64.0.342178258276.issue23041@roundup.psfhosted.org> Skip Montanaro added the comment: Ugh... s/QUOTE_NONNULL/QUOTE_NOTNULL/ Not, Non, None... Perl would treat them all the same, right? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:02:37 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 16:02:37 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624896157.36.0.884515409973.issue44523@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +25505 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26936 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:11:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 16:11:57 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624896717.16.0.167310163769.issue44461@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +25506 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26937 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:17:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Jun 2021 16:17:27 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624897047.59.0.46676787666.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In my view, proxies should behave almost exactly as the underliying object, so using them is as ergonomic as possible. For instance, when using them as a way to avoid cycles, is quite annoying if you have a hashable object in a dictionary and they fail to tell you that is there: >>> class A: ... ... ... >>> a = A() >>> d = {a: None} >>> weakref.proxy(a) in d True but doing this in 3.8 is impossible: >>> import weakref >>> class A: ... ... ... >>> a = A() >>> d = {a: None} >>> weakref.proxy(a) in d Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'weakproxy' Which defies a lot of use cases of this. Notice that if the object is not hashable because the author of the class wants to prevent against that it will work as expected: >>> class A: ... __hash__ = None ... >>> a = A() >>> hash(weakref.proxy(a)) Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'A' This also gives a better error message because it explains that A is not hashable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:22:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 16:22:41 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1624897361.89.0.685523260706.issue44461@roundup.psfhosted.org> Irit Katriel added the comment: The cleanup issue was in the except: clause of the main loop: if the user does quit() during the pdb.interaction() call upon an unhandled exception ("the post mortem debugger"), then this quit request is ignored and the program just restarts. The attached patch fixes this by checking for quit requests after the port-mortem debugger returns. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:24:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Jun 2021 16:24:46 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624897486.77.0.485776446382.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I assume that the original comment is referring to the case when a proxy is a key and the original dies, but this just makes the thing inoperable, as expected: >>> class A: ... ... ... >>> a = A() >>> p = weakref.proxy(a) >>> d = {p: 42} >>> a in d True >>> del a >>> 4 in d False >>> None in d False >>> x in d Traceback (most recent call last): File "", line 1, in ReferenceError: weakly-referenced object no longer exists So any operation on the proxy will raise (because is death) but other operations on the dict will work nicely. For hashable objects, it explicitly breaks the hash because they stop being hashable: >>> class A: ... ... ... >>> a = A() >>> p = weakref.proxy(a) >>> t = (1,2,p) >>> hash(t) 3027598395945759125 >>> del a >>> hash(t) Traceback (most recent call last): File "", line 1, in ReferenceError: weakly-referenced object no longer exists I don't think this is a problem and that therefore we should make the proxy not forward the hash, but maybe there is some opposing opinions to this, so let's give some time for other core devss to comment in case they have other views/concerns ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:28:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 28 Jun 2021 16:28:53 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624897733.27.0.716954431245.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Antoine, Neil, what do you think about this? ---------- nosy: +nascheme, pitrou _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:36:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 16:36:59 +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: <1624898219.16.0.337085691605.issue37773@roundup.psfhosted.org> Andrei Kulakov added the comment: In my testing on 3.9.1 and the current `main` branch, I found: - I can reproduce this issue if a function or a lambda or class with a method are defined. - There is no error if a class is defined with no methods. (I'm not sure why). The test code runs without errors if the following check is done before seeking the `fp` in `close()`: if not self.fp.closed: here: https://github.com/python/cpython/blob/main/Lib/zipfile.py#L1823 The fix also requires adding `closed` property to `zipfile._Tellable` With these two small changes, all test_zipfile tests pass. I'm not sure this is the proper fix, because this is a complex issue.. I will go ahead and put up a PR if this seems like a good approach. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:41:04 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 16:41:04 +0000 Subject: [issue44498] add deprecation warnings for asynchat, asyncore and smtpd In-Reply-To: <1624442381.98.0.346061734567.issue44498@roundup.psfhosted.org> Message-ID: <1624898464.02.0.790858300387.issue44498@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 Mon Jun 28 12:40:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 28 Jun 2021 16:40:46 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred In-Reply-To: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> Message-ID: <1624898446.12.0.686803311056.issue44518@roundup.psfhosted.org> Serhiy Storchaka added the comment: Inlined asyncio.run(func()) is roughly equivalent to the following code: loop = asyncio.new_event_loop() loop.run_until_complete(func()) loop.run_until_complete(loop.shutdown_asyncgens()) loop.close() If comment out loop.run_until_complete(loop.shutdown_asyncgens()) I get the following output: finalize outer Task was destroyed but it is pending! task: ()>> END No "finalize inner" but a warning about pending task instead. On other hand, the following code for _ in func().__await__(): pass produces the output in expected order: finalize inner finalize outer END ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:45:55 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 28 Jun 2021 16:45:55 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624898755.16.0.425579736692.issue44521@roundup.psfhosted.org> Jelle Zijlstra added the comment: ValueError would seem to be the right exception to use. If this parameter were to be added (I'm not convinced that it should be), I'd prefer to call it something more specific than "strict", since "strict" can mean lots of things. ---------- nosy: +Jelle Zijlstra versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 12:53:53 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 16:53:53 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624899233.12.0.903570601764.issue44521@roundup.psfhosted.org> Jack DeVries added the comment: @Jelle Zijlstra, they did think about this in the pep; see here https://www.python.org/dev/peps/pep-0616/#id26 The PEP authors suggested a kwarg of ``required`` which is certainly better. Maybe ``raise_exception`` would be even more explicit albeit verbose. It might be a useful feature; consider the following example:: dogs = ['mydog_spot', 'mydog_sally', 'jill'] new_dogs = [d.removeprefix('mydog_', required=True) for d in dogs] If there is support for this feature, I would like to work on it. Let me know what you think, and whether you think that ``required`` or ``raise_exception`` is a better name for the keyword argument. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 13:29:19 2021 From: report at bugs.python.org (bugale bugale) Date: Mon, 28 Jun 2021 17:29:19 +0000 Subject: [issue44527] subprocess.run gets stuck indefinitely Message-ID: <1624901359.36.0.684419072719.issue44527@roundup.psfhosted.org> New submission from bugale bugale : The implementation for subprocess.run on Windows has a bug that causes it to hang indefinitely in some scenarios. The issue can be easily reproduced by this code: import subprocess subprocess.run(['cmd.exe', '/c', 'ping 1.2.3.4 -n 9999'], capture_output=True, timeout=1) Instead of exiting after 1 second, it hangs indefinitely. After looking at the code a bit, I found the issue: https://github.com/python/cpython/blob/efe7d08d178a7c09bcca994f2068b019c8633d83/Lib/subprocess.py#L512 if _mswindows: # Windows accumulates the output in a single blocking # read() call run on child threads, with the timeout # being done in a join() on those threads. communicate() # _after_ kill() is required to collect that and add it # to the exception. exc.stdout, exc.stderr = process.communicate() In the case of Windows, after the process is killed, communicate is called without a timeout. This usually works because after the process is killed the pipes are closed and the communicate returns almost immediately. However, if the created subprocess created other processes that hold the pipes, they are not closed and this line blocks indefinitely. ---------- components: Library (Lib) messages: 396653 nosy: bugale bugale priority: normal severity: normal status: open title: subprocess.run gets stuck indefinitely type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 13:30:37 2021 From: report at bugs.python.org (Paulie Pena) Date: Mon, 28 Jun 2021 17:30:37 +0000 Subject: [issue29298] argparse fails with required subparsers, un-named dest, and empty argv In-Reply-To: <1484664769.91.0.625725054847.issue29298@psf.upfronthosting.co.za> Message-ID: <1624901437.25.0.0379747666082.issue29298@roundup.psfhosted.org> Paulie Pena added the comment: I'd like to second this idea, since it's very confusing without it: > while waiting for a fix, would it be possible to document in the argparse documentation that the 'dest' parameter is required (at least temporarily) for add_subparsers()? (somewhere near file:///usr/share/doc/python/html/library/argparse.html#sub-commands) ---------- nosy: +paulie4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 13:41:20 2021 From: report at bugs.python.org (pavel-lexyr) Date: Mon, 28 Jun 2021 17:41:20 +0000 Subject: [issue44528] Move IP version resolving to http.server's API Message-ID: <1624902080.06.0.889341047193.issue44528@roundup.psfhosted.org> New submission from pavel-lexyr : Python's native HTTP server (http.server module) has special code to allow it to detect and bind to IPv6 addresses when called as a CLI tool. As of right now, the code is in private functions. Those are not intended to be called by library users - only the CLI command. People want to create HTTP/WSGI servers programmatically - then they run into similar problems. Since the relevant code is not open for library use, they copy it to their own projects instead. That's code duplication. Exhibit A: https://github.com/prometheus/client_python/pull/657 This doesn't look like a good way to do things. To avoid such problems, it can be useful to have the CLI tool's protocol version resolver added to the library. This relates to bpo-20215, which has related aspirations - but a broader scope. ---------- components: Library (Lib) messages: 396655 nosy: jaraco, pavel-lexyr priority: normal severity: normal status: open title: Move IP version resolving to http.server's API type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 13:48:07 2021 From: report at bugs.python.org (=?utf-8?b?0JzQsNGA0Log0JrQvtGA0LXQvdCx0LXRgNCz?=) Date: Mon, 28 Jun 2021 17:48:07 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624902487.55.0.456408103816.issue44521@roundup.psfhosted.org> ???? ????????? added the comment: Any kwarg is OK for me, so please do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 13:49:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 17:49:05 +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: <1624902545.08.0.456303492982.issue37773@roundup.psfhosted.org> Andrei Kulakov added the comment: I forgot to add, to fix the tests I also had to add `closed=False` attr to test_zipfile.Tellable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:05:20 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 28 Jun 2021 18:05:20 +0000 Subject: [issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points In-Reply-To: <1622129411.13.0.355840154736.issue44246@roundup.psfhosted.org> Message-ID: <1624903520.03.0.812045095019.issue44246@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:15:36 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Mon, 28 Jun 2021 18:15:36 +0000 Subject: [issue44529] Using typing.Union in isinstance checks Message-ID: <1624904136.53.0.718038325255.issue44529@roundup.psfhosted.org> New submission from Kaleb Barrett : I have type aliases of Unions like so: Request = Union[WriteRequest, ReadRequest] I'd like to be able to use "Request" in an isinstance check rather than having to duplicate the information in a tuple to pass to the check. Currently I get: TypeError: Subscripted generics cannot be used with class and instance checks Seems like Unions could be used here interchangeably with tuples since they mean the same thing in this context. Of course this would only work if the element types are being capable of being used in isinstance checks. ---------- messages: 396658 nosy: ktbarrett priority: normal severity: normal status: open title: Using typing.Union in isinstance checks type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:16:44 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 28 Jun 2021 18:16:44 +0000 Subject: [issue44527] On Windows, subprocess.run gets stuck indefinitely In-Reply-To: <1624901359.36.0.684419072719.issue44527@roundup.psfhosted.org> Message-ID: <1624904204.1.0.410635118914.issue44527@roundup.psfhosted.org> Change by Eric V. Smith : ---------- components: +Windows nosy: +eric.smith, paul.moore, steve.dower, tim.golden, zach.ware title: subprocess.run gets stuck indefinitely -> On Windows, subprocess.run gets stuck indefinitely _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:21:33 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Mon, 28 Jun 2021 18:21:33 +0000 Subject: [issue44373] make Event an Awaitable In-Reply-To: <1623310462.97.0.487595968193.issue44373@roundup.psfhosted.org> Message-ID: <1624904493.71.0.440560665918.issue44373@roundup.psfhosted.org> Change by Kaleb Barrett : ---------- title: make Event and Awaitable -> make Event an Awaitable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:32:34 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 28 Jun 2021 18:32:34 +0000 Subject: [issue44527] On Windows, subprocess.run gets stuck indefinitely In-Reply-To: <1624901359.36.0.684419072719.issue44527@roundup.psfhosted.org> Message-ID: <1624905154.84.0.0482336080331.issue44527@roundup.psfhosted.org> Change by Eryk Sun : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> subprocess.run() sometimes ignores timeout in Windows _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:33:50 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 28 Jun 2021 18:33:50 +0000 Subject: [issue44518] Finalization of non-exhausted asynchronous generators is deferred In-Reply-To: <1624785092.65.0.844977946345.issue44518@roundup.psfhosted.org> Message-ID: <1624905230.46.0.898616227413.issue44518@roundup.psfhosted.org> Guido van Rossum added the comment: Okay, that suggests that the extra reference is being held by asyncio, right? I suppose it's in the hands of the asyncio devs then. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 14:54:15 2021 From: report at bugs.python.org (Zachary Ware) Date: Mon, 28 Jun 2021 18:54:15 +0000 Subject: [issue43346] subprocess.run() sometimes ignores timeout in Windows In-Reply-To: <1614552841.1.0.31217184811.issue43346@roundup.psfhosted.org> Message-ID: <1624906455.74.0.438837082866.issue43346@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +bugale bugale, eric.smith versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 15:51:14 2021 From: report at bugs.python.org (=?utf-8?b?0J7Qu9C10LMg0JzQsNGB0LvQvg==?=) Date: Mon, 28 Jun 2021 19:51:14 +0000 Subject: [issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624909874.81.0.0139354919693.issue44520@roundup.psfhosted.org> ???? ????? added the comment: That is, all the libraries already created need to follow your advice? :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 15:53:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 28 Jun 2021 19:53:16 +0000 Subject: [issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None In-Reply-To: <1624868744.26.0.26782984577.issue44520@roundup.psfhosted.org> Message-ID: <1624909996.43.0.069114758721.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: I don?t know if it needs to change, but if anything I would map None to None and not to ??. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 16:27:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 28 Jun 2021 20:27:52 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624912072.56.0.878489752366.issue44523@roundup.psfhosted.org> Raymond Hettinger added the comment: Pablo, I'm having second thoughts on hash forwarding. It looks like its omission was an intentional design decision. I vote for restoring the previous behavior. That will likely save some headaches for some users. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 16:51:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 20:51:34 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624913494.09.0.819101930252.issue43625@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +25507 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26939 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 16:54:30 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 28 Jun 2021 20:54:30 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624913670.05.0.15536145244.issue43625@roundup.psfhosted.org> Andrei Kulakov added the comment: I've added the PR here, based on Skip's patch: https://github.com/python/cpython/pull/26939 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 17:38:36 2021 From: report at bugs.python.org (Andre Roberge) Date: Mon, 28 Jun 2021 21:38:36 +0000 Subject: [issue43476] Enabling access to showsyntaxerror for IDLE's shell In-Reply-To: <1615495137.57.0.647569220862.issue43476@roundup.psfhosted.org> Message-ID: <1624916316.83.0.876577677559.issue43476@roundup.psfhosted.org> Andre Roberge added the comment: I made an error in my previous comment: the code I wrote is obviously incorrect as it contains a SyntaxError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 17:47:54 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 21:47:54 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624916874.65.0.663315393029.issue44523@roundup.psfhosted.org> Jack DeVries added the comment: I'm going to close my PR; it seems like documentation is not the direction we're going, so no need to keep it open. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 18:08:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 22:08:17 +0000 Subject: [issue44517] test__xxsubinterpreters: AMD64 Fedora Stable 3.x buildbot aborts at test_still_running In-Reply-To: <1624699420.1.0.797294128445.issue44517@roundup.psfhosted.org> Message-ID: <1624918097.76.0.885982402541.issue44517@roundup.psfhosted.org> STINNER Victor added the comment: On my laptop with 4 physical CPUs (8 threads), I can reproduce test_still_running() random failure with: $ ./python -m test test__xxsubinterpreters -j50 -v -F (...) 0:00:37 load avg: 24.31 [ 19/1] test__xxsubinterpreters failed (36.2 sec) (...) (...) ====================================================================== FAIL: test_still_running (test.test__xxsubinterpreters.DestroyTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test__xxsubinterpreters.py", line 753, in test_still_running self.assertTrue(interpreters.is_running(interp), AssertionError: False is not true : Interp 48 should be running before destruction. FAILED (failures=1, skipped=6) Warning -- Uncaught thread exception: RuntimeError Exception in thread Thread-7 (run): Traceback (most recent call last): File "/home/vstinner/python/main/Lib/threading.py", line 1009, in _bootstrap_inner self.run() File "/home/vstinner/python/main/Lib/threading.py", line 946, in run self._target(*self._args, **self._kwargs) File "/home/vstinner/python/main/Lib/test/test__xxsubinterpreters.py", line 46, in run interpreters.run_string(interp, dedent(f""" RuntimeError: unrecognized interpreter ID 48 test test__xxsubinterpreters failed ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 18:35:33 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Mon, 28 Jun 2021 22:35:33 +0000 Subject: [issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data Message-ID: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org> New submission from Gabriele N Tornetta : When dumping profiling data out of code objects using out-of-process tools like Austin (https://github.com/p403n1x87/austin) one has access only to file name, function name, and line number. Consider the flame graph generated by running the following script, and aggregating on function names ---- class Foo: def on_cpu(self, n): a = [] for i in range(n): a.append(i) class Bar: def on_cpu(self, n): a = [] for i in range(n): a.append(i) if __name__ == "__main__": f = Foo() b = Bar() f.on_cpu(1_000_000) b.on_cpu(5_000_000) ---- Without the extra information coming from the actual Python source, one would not be able to tell, by looking at the flame graph alone, that on_cpu has contributions from two different methods. By propagating the qualname information from the compiler to code objects, such names would be disambiguated and the resulting flame graph would be clearer. I would like to propose adding the co_qualname field to the PyCodeObject structure, which is to be set to NULL except for when the code object is created by the compiler in compile.c. ---------- components: C API files: py_main.png messages: 396667 nosy: Gabriele Tornetta priority: normal severity: normal status: open title: Propagate qualname from the compiler unit to code objects for finer grained profiling data type: enhancement versions: Python 3.11 Added file: https://bugs.python.org/file50128/py_main.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 18:47:55 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Mon, 28 Jun 2021 22:47:55 +0000 Subject: [issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data In-Reply-To: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org> Message-ID: <1624920475.66.0.245011304833.issue44530@roundup.psfhosted.org> Change by Gabriele N Tornetta : ---------- keywords: +patch pull_requests: +25508 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26941 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:03:32 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 23:03:32 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624921412.08.0.181877623551.issue44521@roundup.psfhosted.org> Jack DeVries added the comment: @lemburg, hopefully I'm asking the right person... you're down as the devguide expert on unicode and these changes would (I think) need to be applied here:: Objects/unicodeobject.c::12814 unicode_removeprefix_impl Anyway, do you think this would be a useful feature that you'd like to see added? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:03:57 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 23:03:57 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624921437.91.0.329099372596.issue44521@roundup.psfhosted.org> Change by Jack DeVries : ---------- nosy: +lemburg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:12:50 2021 From: report at bugs.python.org (Roundup Robot) Date: Mon, 28 Jun 2021 23:12:50 +0000 Subject: [issue39710] "will be returned as unicode" reminiscent from Python 2 In-Reply-To: <1582300708.21.0.335550003251.issue39710@roundup.psfhosted.org> Message-ID: <1624921970.12.0.383044140246.issue39710@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 8.0 -> 9.0 pull_requests: +25509 pull_request: https://github.com/python/cpython/pull/26942 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:18:33 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:18:33 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1624922313.07.0.406974784361.issue42969@roundup.psfhosted.org> STINNER Victor added the comment: See also bpo-44434: "_thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work". New changeset 45a78f906d2d5fe5381d78466b11763fc56d57ba by Victor Stinner in branch 'main': bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) https://github.com/python/cpython/commit/45a78f906d2d5fe5381d78466b11763fc56d57ba ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:24:13 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:24:13 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624922653.38.0.604924247422.issue44434@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25510 pull_request: https://github.com/python/cpython/pull/26943 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:29:24 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:29:24 +0000 Subject: =?utf-8?q?=5Bissue42888=5D_Not_installed_=E2=80=9Clibgcc=5Fs=2Eso=2E1?= =?utf-8?q?=E2=80=9D_causes_exit_crash=2E?= In-Reply-To: <1610350822.34.0.431759793604.issue42888@roundup.psfhosted.org> Message-ID: <1624922964.8.0.867088469104.issue42888@roundup.psfhosted.org> STINNER Victor added the comment: This issue is a duplicate of bpo-44434 which has been fixed. I created PR 26943 based on Alexey's PR 24241 to complete my fix. ---------- nosy: +vstinner resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:30:14 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 23:30:14 +0000 Subject: [issue44529] Using typing.Union in isinstance checks In-Reply-To: <1624904136.53.0.718038325255.issue44529@roundup.psfhosted.org> Message-ID: <1624923014.45.0.0827580043996.issue44529@roundup.psfhosted.org> Jack DeVries added the comment: I think this already works unless you are using TypeVars:: t = Union[str, int] isinstance(1, t) # True isinstance('1', t) # True If you are using TypeVars, though, it cannot work: T = TypeVar('my_type') thing = Union[T, str] isinstance('hi', thing) # Exception This makes sense, because ``T`` is just a name, not related to an actual object. Sorry if I'm missing something, because I did try the non-working example and my exception actually says, "issubclass() arg 2 must be a class, a tuple of classes, or a union." The exception makes sense, but its difference from yours might mean I'm doing something differently. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:31:18 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:31:18 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624923078.89.0.224204914926.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-42888 as a duplicate of this issue. I created PR 26943 based on Alexey's PR 24241 to complete my fix (remove two calls in two tests). Copy of his interesting PR commit message: --- bpo-42888: Remove PyThread_exit_thread() calls from top-level thread functions PyThread_exit_thread() uses pthread_exit() on POSIX systems. In glibc, pthread_exit() is implemented in terms of pthread_cancel(), requiring the stack unwinder implemented in libgcc. Further, in dynamically linked applications, calls of pthread_exit() in source code do not make libgcc_s.so a startup dependency: instead, it's lazily loaded by glibc via dlopen() when pthread_exit() is called the first time[1]. All of this makes otherwise finely working CPython fail in multithreaded applications on thread exit if dlopen() fails for any reason. While providing libgcc_s.so is the reponsibility of the user (or their package manager), this hidden dependency has been the source of countless frustrations(e.g. [2]) and, further, dlopen() may fail for other reasons([3]). But most calls to PyThread_exit_thread() in CPython are useless because they're done from the top-level thread function and hence are equivalent to simply returning. So remove all such calls, thereby avoiding the glibc cancellation machinery. The only exception are calls in take_gil() (Python/ceval_gil.h) which serve as a safety net for daemon threads attempting to acquire the GIL after Py_Finalize(). Unless a better model for daemon threads is devised or support for them is removed, those calls have to be preserved since we need to terminate the thread right now without touching any interpreter state. Of course, since PyThread_exit_thread() is a public API, any extension module can still call it and trip over the same issue. [1] https://sourceware.org/legacy-ml/libc-help/2014-07/msg00000.html [2] https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work [3] https://www.sourceware.org/bugzilla/show_bug.cgi?id=13119 --- ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:33:12 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:33:12 +0000 Subject: [issue18748] io.IOBase destructor silence I/O error on close() by default In-Reply-To: <1376572242.37.0.931026549367.issue18748@psf.upfronthosting.co.za> Message-ID: <1624923192.54.0.89055274262.issue18748@roundup.psfhosted.org> STINNER Victor added the comment: > Running the file couple of times will make the interpreter fail with: libgcc_s.so.1 must be installed for pthread_cancel to work See also bpo-44434: "_thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:40:15 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 23:40:15 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624923615.99.0.878043845886.issue44526@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25511 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26944 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:41:17 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 28 Jun 2021 23:41:17 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624923677.06.0.974057487061.issue44526@roundup.psfhosted.org> Jack DeVries added the comment: @serif2 nice catch! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:45:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:45:32 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1624923932.47.0.981132646511.issue35866@roundup.psfhosted.org> STINNER Victor added the comment: > #6 0x00007ffff7bc7712 in __pthread_unwind () from /lib64/libpthread.so.0 > #7 0x00007ffff7bbf7e7 in pthread_exit () from /lib64/libpthread.so.0 > #8 0x000000000051b2fc in PyThread_exit_thread () at Python/thread_pthread.h:238 > #9 0x000000000055ed16 in t_bootstrap (boot_raw=0x7fffe8da0e40) at ./Modules/_threadmodule.c:1021 The thread_run() function (previously "t_bootstrap()") which is the low-level C function to run a thread in Python _thread.start_new_thread() no longer calls PyThread_exit_thread(): see bpo-44434. I'm able to reproduce the issue using attached cf-deadlock.py with Python 3.8: * Run 3 processes running cf-deadlock.py * Run the Python test suite to stress the machine: ./python -m test -r -j4 # try different -j values to stess the machine more or less In the main branch (with bpo-44434 fix), I can no longer reproduce the issue. I ran cf-deadlock.py in 4 terminals in parallel with "./python -m test -r -j2" in a 5th terminal for 5 minutes. I couldn't reproduce the issue. On Python 3.8, I reproduced the issue in less than 1 minute. Can someone please confirm that the issue is now fixed? Can we mark this issue as a duplicate of bpo-44434? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:45:43 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:45:43 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624923943.91.0.499753133858.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: Se also bpo-35866 which looks like a duplicate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:47:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:47:01 +0000 Subject: [issue37395] Core interpreter should be linked with libgcc_s.so on Linux In-Reply-To: <1561424997.44.0.201874439202.issue37395@roundup.psfhosted.org> Message-ID: <1624924021.93.0.386722183467.issue37395@roundup.psfhosted.org> STINNER Victor added the comment: > This is arguably a bug in glibc, but Python can easily work around it by linking the core interpreter (the `python` executable and/or `libpython.so`) with libgcc_s at build time (`-lgcc_s`) on Linux. It will then be loaded already if and when it's needed, and glibc won't try to load it on demand. I fixed the issue differently in bpo-44434. I mark this issue as a duplicate of bpo-44434. ---------- nosy: +vstinner resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:47:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:47:22 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624924042.2.0.349566869058.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-37395 "Core interpreter should be linked with libgcc_s.so on Linux" as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:49:56 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:49:56 +0000 Subject: [issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful In-Reply-To: <1611084946.55.0.234619663171.issue42969@roundup.psfhosted.org> Message-ID: <1624924196.83.0.226043512805.issue42969@roundup.psfhosted.org> STINNER Victor added the comment: See also a discussion about the usefulness of daemon threads: https://github.com/python-trio/trio/issues/2046 I'm more in favor of deprecating daemon threads (in any interpreter, not only in subinterpreters). The current implementation is too fragile. There are still corner cases like the one described in this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:54:03 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:54:03 +0000 Subject: [issue36479] [subinterpreters] Exit threads when interpreter is finalizing rather than runtime. In-Reply-To: <1553896742.19.0.478613119545.issue36479@roundup.psfhosted.org> Message-ID: <1624924443.6.0.898331750355.issue36479@roundup.psfhosted.org> STINNER Victor added the comment: I close the issue. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 19:56:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 28 Jun 2021 23:56:53 +0000 Subject: [issue6642] returning after forking a child thread doesn't call Py_Finalize In-Reply-To: <1249410110.52.0.861898541816.issue6642@psf.upfronthosting.co.za> Message-ID: <1624924613.38.0.207962856191.issue6642@roundup.psfhosted.org> STINNER Victor added the comment: I add the "Subinterpreters" component even if the issue is about the main interpreter, this kind of issue impacts subinterpreters. ---------- components: +Subinterpreters nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:03:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:03:42 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624925022.87.0.555936246412.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 48e3a1d95aee013974121fcafe19816c0e9a41da by Victor Stinner in branch 'main': bpo-44434: Remove useless calls to PyThread_exit_thread() (GH-26943) https://github.com/python/cpython/commit/48e3a1d95aee013974121fcafe19816c0e9a41da ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:07:41 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:07:41 +0000 Subject: [issue44434] _thread module: Remove redundant PyThread_exit_thread() call to avoid glibc fatal error: libgcc_s.so.1 must be installed for pthread_cancel to work In-Reply-To: <1623853151.2.0.762537523912.issue44434@roundup.psfhosted.org> Message-ID: <1624925261.79.0.13133171758.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: On Linux, there is a workaround for Python versions which don't include this fix: $ LD_PRELOAD=/usr/lib64/libgcc_s.so.1 python3 ... To preload the libgcc_s.so.1 library in the Python process when running Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:14:42 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:14:42 +0000 Subject: [issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x) In-Reply-To: <1569848255.08.0.155489980043.issue38323@roundup.psfhosted.org> Message-ID: <1624925682.32.0.570876607689.issue38323@roundup.psfhosted.org> STINNER Victor added the comment: MultiLoopChildWatcher still has a race condition. I see different options: * Deprecate/Remove MultiLoopChildWatcher * Find a magic fix for MultiLoopChildWatcher. It sounds complicated since it's *designed* to not be related to any event loop. See my failed attempt: PR 26536. * Document the limitation and adapt the unit test to work around the issue. If an event loop frequently gets events, the worst case is that a child process complete will be notified later, but at least the event is handled. If the event loop is idle, the completion is never notified. A workaround is to schedule an asynchronous task which runs frequently, like once per minute. It doesn't even have to do anything. It can be a no-op task. I'm not really excited by documenting the limitation and suggest a hack to work around the limitation. MultiLoopChildWatcher could belong to a PyPI module. But for the base asyncio from the stdlib, I would prefer to not ship any known race conditions :-( So I'm more in favor of deprecate/remove. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:16:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:16:01 +0000 Subject: [issue44117] [C API] Remove deprecated PyEval_InitThreads() In-Reply-To: <1620833028.19.0.0980043255571.issue44117@roundup.psfhosted.org> Message-ID: <1624925761.9.0.595011215351.issue44117@roundup.psfhosted.org> STINNER Victor added the comment: The function is part of the stable ABI so I prefer to keep it for now. https://github.com/python/cpython/pull/26070#issuecomment-839871560 I close the issue. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:19:02 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:19:02 +0000 Subject: [issue43552] Add locale.get_locale_encoding() and locale.get_current_locale_encoding() In-Reply-To: <1616145433.55.0.350148222552.issue43552@roundup.psfhosted.org> Message-ID: <1624925942.73.0.509463435344.issue43552@roundup.psfhosted.org> STINNER Victor added the comment: PEP 597 was implemented successfully in Python 3.10 with this feature. This is no agreement yet on what is the "current locale encoding". For now, I prefer to close the issue. We can reconsider this feature once there will be more user requests for such function and when there will be an agreement on what is the "current locale encoding". ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:19:46 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 29 Jun 2021 00:19:46 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624925986.12.0.547689073255.issue44521@roundup.psfhosted.org> Terry J. Reedy added the comment: Start by presenting this idea on python-ideas list. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:56:15 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:56:15 +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: <1624928175.27.0.0612796521361.issue44394@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25512 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26945 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 20:57:30 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 00:57:30 +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: <1624928250.5.0.431687647018.issue44394@roundup.psfhosted.org> STINNER Victor added the comment: Attached cpython_rebuild_expat_dir.sh script updates Modules/expat/ to our libexpat copy to 2.4.1. I used it to create attached PR 26945. ---------- Added file: https://bugs.python.org/file50129/cpython_rebuild_expat_dir.sh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:07:54 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:07:54 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1624928874.12.0.894528431816.issue43770@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25513 pull_request: https://github.com/python/cpython/pull/26946 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:30:14 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:30:14 +0000 Subject: [issue1662] [patch] assert tp_traverse in PyType_GenericAlloc() In-Reply-To: <1198084921.68.0.0736452990224.issue1662@psf.upfronthosting.co.za> Message-ID: <1624930214.84.0.469991217288.issue1662@roundup.psfhosted.org> STINNER Victor added the comment: This issue was fixed differently in bpo-44263, by adding a test in PyType_Ready(): // bpo-44263: tp_traverse is required if Py_TPFLAGS_HAVE_GC is set. // Note: tp_clear is optional. if (type->tp_flags & Py_TPFLAGS_HAVE_GC && type->tp_traverse == NULL) { PyErr_Format(PyExc_SystemError, "type %s has the Py_TPFLAGS_HAVE_GC flag " "but has no traverse function", type->tp_name); return -1; } commit ee7637596d8de25f54261bbeabc602d31e74f482 Author: Victor Stinner Date: Tue Jun 1 23:37:12 2021 +0200 bpo-44263: Py_TPFLAGS_HAVE_GC requires tp_traverse (GH-26463) The PyType_Ready() function now raises an error if a type is defined with the Py_TPFLAGS_HAVE_GC flag set but has no traverse function (PyTypeObject.tp_traverse). ---------- nosy: +vstinner resolution: rejected -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:32:27 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:32:27 +0000 Subject: [issue1662] [patch] assert tp_traverse in PyType_GenericAlloc() In-Reply-To: <1198084921.68.0.0736452990224.issue1662@psf.upfronthosting.co.za> Message-ID: <1624930347.64.0.162128257945.issue1662@roundup.psfhosted.org> STINNER Victor added the comment: > tp_traverse is optional, so we should not add this assertion. It is required by types implementing the GC protocol. This assumption is non-obvious and was not documented. The documentation was completed in bpo-44263 by commit 8b55bc3f93a655bc803bff79725d5fe3f124e2f0. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:37:35 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:37:35 +0000 Subject: [issue44442] Globals (and presumably builtins) are cleared premuturely in FrameObject In-Reply-To: <1623928469.97.0.790918455178.issue44442@roundup.psfhosted.org> Message-ID: <1624930655.32.0.741576505723.issue44442@roundup.psfhosted.org> STINNER Victor added the comment: I marked bpo-44288 as a duplicate of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:37:20 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:37:20 +0000 Subject: [issue44288] unittest: _is_relevant_tb_level() fails because tb.tb_frame.f_globals=None In-Reply-To: <1622646301.21.0.530084460919.issue44288@roundup.psfhosted.org> Message-ID: <1624930640.52.0.730768749822.issue44288@roundup.psfhosted.org> STINNER Victor added the comment: I mark this issue as a duplicate of bpo-44442. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Globals (and presumably builtins) are cleared premuturely in FrameObject _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:43:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 01:43:49 +0000 Subject: [issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid In-Reply-To: <1585778141.93.0.504215883297.issue40142@roundup.psfhosted.org> Message-ID: <1624931029.33.0.65614185778.issue40142@roundup.psfhosted.org> STINNER Victor added the comment: PyType_GenericAlloc() cannot traverse the object since the object members are not initialized yet. For example, dict_traverse() can only be called when PyDict_New() completes. A different approach would be to: * (1) Add PyType_AllocNoTrack(), use it in built-in types, and call _PyObject_GC_TRACK() on the instance once it is fully initialized. * (2) Modify PyType_GenericAlloc() to use a new variant of _PyObject_GC_TRACK() which will not traverse the instance. * (3) Modify _PyObject_GC_TRACK() to traverse the instance. In short, PyType_GenericAlloc() cannot be modified for backward compatibility. Moreover, _PyObject_GC_TRACK() should only be used inside Python internals, since it's part the internal C API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 21:56:56 2021 From: report at bugs.python.org (Kaleb Barrett) Date: Tue, 29 Jun 2021 01:56:56 +0000 Subject: [issue44529] Using typing.Union in isinstance checks In-Reply-To: <1624904136.53.0.718038325255.issue44529@roundup.psfhosted.org> Message-ID: <1624931816.31.0.0307800921031.issue44529@roundup.psfhosted.org> Kaleb Barrett added the comment: Ah, this was implemented for 3.10 as a part of PEP 604. https://www.python.org/dev/peps/pep-0604/#isinstance-and-issubclass. Feel free to close. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:02:58 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:02:58 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC Message-ID: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> New submission from STINNER Victor : The PyType_GenericAlloc() function tracks the newly created object in the garbage collector (GC) as soon as memory is initialized, but before all object members are initialized. If a GC collection happens before the object is fully initialized, the traverse function of the newly created object can crash. This case is hypothetical for built-in types since their constructor should not trigger a GC collection. It is more likely in third party extensions and subclasses. Anyway, I propose to add a new _PyType_AllocNoTrack() function which allocates memory without tracking the newly allocated object directly in the GC. This function can be used to only track explicitly the object in the GC once it is fully initialized. ---------- components: C API messages: 396695 nosy: vstinner priority: normal severity: normal status: open title: Add _PyType_AllocNoTrack() function: allocate without tracking in the GC versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:17:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:17:49 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624933069.77.0.398339327304.issue44531@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25514 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26947 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:22:05 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:22:05 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624933325.44.0.428481212705.issue44531@roundup.psfhosted.org> STINNER Victor added the comment: In bpo-40142, I tried to modify _PyObject_GC_TRACK() to visit the object before tracking it, as done by PyObject_GC_Track(). Problem: PyType_GenericAlloc() cannot traverse the object since the object members are not initialized yet. For example, dict_traverse() can only be called at dict_new() exit. Here I propose a different approach. First, fix built-in types to only track instances when they are fully initialized. Avoid PyType_GenericAlloc(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:22:16 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:22:16 +0000 Subject: [issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid In-Reply-To: <1585778141.93.0.504215883297.issue40142@roundup.psfhosted.org> Message-ID: <1624933336.87.0.0382016868334.issue40142@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-44531 "Add _PyType_AllocNoTrack() function: allocate without tracking in the GC". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:25:22 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:25:22 +0000 Subject: [issue40142] Modify _PyObject_GC_TRACK() to ensure that newly tracked object is valid In-Reply-To: <1585778141.93.0.504215883297.issue40142@roundup.psfhosted.org> Message-ID: <1624933522.99.0.616361718485.issue40142@roundup.psfhosted.org> STINNER Victor added the comment: Attached gc_track.patch: my latest attempt to implement this idea. ---------- Added file: https://bugs.python.org/file50130/gc_track.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 22:31:25 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 02:31:25 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624933884.99.0.450289079478.issue44531@roundup.psfhosted.org> Change by STINNER Victor : ---------- pull_requests: +25515 pull_request: https://github.com/python/cpython/pull/26948 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 23:10:20 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 29 Jun 2021 03:10:20 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624936220.12.0.516353971853.issue43625@roundup.psfhosted.org> Andrei Kulakov added the comment: Skip: If I understand right, in the patch the last two types -- float and int, will never have an effect because if float(x) and int(x) succeed, so will complex(x), and conversely, if complex(x) fails, float and int will also fail. So the effect of the patch will be to tolerate any mix of numeric columns when the headers are textual. Which sounds fine to me, just want to confirm that sounds good to you, because the unit test in the patch is a much narrower case. I think the test should then be something like: a b c 1 1.1 5+0j 1.2 3+0j 4 and the code should be updated to just do `complex(x)` and remove float() and int() attempts. Another, more strict option, - would be to special case `0` to match int, float, and complex. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jun 28 23:45:28 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 29 Jun 2021 03:45:28 +0000 Subject: [issue44440] logging does not work as documented (setLevel) In-Reply-To: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> Message-ID: <1624938328.32.0.776943500297.issue44440@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 00:25:58 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 29 Jun 2021 04:25:58 +0000 Subject: [issue44492] Building a C extension on Big Sur and SDK v10.15 fails In-Reply-To: <1624409568.36.0.590312520398.issue44492@roundup.psfhosted.org> Message-ID: <1624940758.85.0.819435303679.issue44492@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 00:51:58 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 29 Jun 2021 04:51:58 +0000 Subject: [issue44521] str.removeprefix(): add strict: bool In-Reply-To: <1624874330.53.0.57173423417.issue44521@roundup.psfhosted.org> Message-ID: <1624942318.31.0.56924108642.issue44521@roundup.psfhosted.org> Dennis Sweeney added the comment: I'm +-0 on this. I would write something like this instead: assert whatever.startswith(prefix) result = whatever.removeprefix(prefix) Note that if this were to change, the corresponding methods would also have to change on bytes, bytearray, and collections.UserString. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 00:53:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 29 Jun 2021 04:53:58 +0000 Subject: [issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union In-Reply-To: <1616421230.45.0.492887326456.issue43595@roundup.psfhosted.org> Message-ID: <1624942438.31.0.267019817378.issue43595@roundup.psfhosted.org> Andrei Kulakov added the comment: Works for me, too - no error (MacOS, 3.9.1) ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 02:07:13 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 29 Jun 2021 06:07:13 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624946833.59.0.598128080287.issue44526@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 02:16:31 2021 From: report at bugs.python.org (Brandt Bucher) Date: Tue, 29 Jun 2021 06:16:31 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624947391.44.0.391945972751.issue44526@roundup.psfhosted.org> Brandt Bucher added the comment: I don?t think this is a typo. When x is 0, the point resides somewhere upon the vertical y axis. When y is 0, the point resides somewhere upon the horizontal x axis. Try plotting the points (0, 1) and (1, 0), for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 02:53:42 2021 From: report at bugs.python.org (junyixie) Date: Tue, 29 Jun 2021 06:53:42 +0000 Subject: [issue44532] multi subinterpreters use _PyStructSequence_InitType failed. Message-ID: <1624949622.19.0.942644638958.issue44532@roundup.psfhosted.org> New submission from junyixie : In _PyStructSequence_InitType, it will check type is initialized. but when we have multi subinterpreters, type may be initialized expected. when type already been initialized, should return 0 rather than throw exception. ```c /* PyTypeObject has already been initialized */ if (Py_REFCNT(type) != 0) { return 0; } ``` ```c int _PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc, unsigned long tp_flags) { PyMemberDef *members; Py_ssize_t n_members, n_unnamed_members; #ifdef Py_TRACE_REFS /* if the type object was chained, unchain it first before overwriting its storage */ if (type->ob_base.ob_base._ob_next) { _Py_ForgetReference((PyObject *)type); } #endif /* PyTypeObject has already been initialized */ if (Py_REFCNT(type) != 0) { PyErr_BadInternalCall(); return -1; } ``` ---------- components: Subinterpreters messages: 396703 nosy: JunyiXie priority: normal severity: normal status: open title: multi subinterpreters use _PyStructSequence_InitType failed. type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 03:04:58 2021 From: report at bugs.python.org (junyixie) Date: Tue, 29 Jun 2021 07:04:58 +0000 Subject: [issue44532] multi subinterpreters use _PyStructSequence_InitType failed. In-Reply-To: <1624949622.19.0.942644638958.issue44532@roundup.psfhosted.org> Message-ID: <1624950298.73.0.731841969369.issue44532@roundup.psfhosted.org> Change by junyixie : ---------- keywords: +patch pull_requests: +25516 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26949 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 03:15:06 2021 From: report at bugs.python.org (tygrus) Date: Tue, 29 Jun 2021 07:15:06 +0000 Subject: [issue44533] Where are the log file(s) Message-ID: <1624950906.15.0.177262141584.issue44533@roundup.psfhosted.org> New submission from tygrus : The Python app shows errors and says "Check the logs for full command output." But where are the logs? And how to understand the data in the logs? ---------- messages: 396704 nosy: tygrus priority: normal severity: normal status: open title: Where are the log file(s) type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:17:36 2021 From: report at bugs.python.org (Vinay Sajip) Date: Tue, 29 Jun 2021 08:17:36 +0000 Subject: [issue44440] logging does not work as documented (setLevel) In-Reply-To: <1623924619.02.0.4525598898.issue44440@roundup.psfhosted.org> Message-ID: <1624954656.98.0.660178477518.issue44440@roundup.psfhosted.org> Vinay Sajip added the comment: As Henk-Jaap points out, this is not a bug. You can't take a single sentence or even paragraph without considering the whole picture. In particular, this section https://docs.python.org/3/howto/logging.html#what-happens-if-no-configuration-is-provided explains clearly why the behaviour you noticed is as expected. Another section even depicts it pictorially: https://docs.python.org/3/howto/logging.html#logging-flow ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:19:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 29 Jun 2021 08:19:43 +0000 Subject: [issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data In-Reply-To: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org> Message-ID: <1624954783.63.0.340062409589.issue44530@roundup.psfhosted.org> Mark Shannon added the comment: I think this is a worthwhile improvement. A few comments on this issue and your PR. 1. We already have qualified names on functions and generators and those can be modified by @decorators. In those cases, the code object and the function would disagree. Code objects are immutable, so any thoughts on the usability implications of qualname differing between code object and function? 2. If we are adding a new attribute, it should be at the Python level. The internal layout of the code object is likely to change. (I have no problem with it being visible to tools like austin, just it won't be part of the API.) 3. As it stands, this is beneficial to only a small set of tools, but has a negative impact on memory use. If we were to leverage the new field to improve the performance of function creation (important for closures) by omitting the qualname (and defaulting to the code object's) then it would benefit everyone. ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:27:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Jun 2021 08:27:28 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624955248.01.0.873078629178.issue12022@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 20a88004bae8ead66a205a125e1fe979376fc3ea by Serhiy Storchaka in branch 'main': bpo-12022: Change error type for bad objects in "with" and "async with" (GH-26809) https://github.com/python/cpython/commit/20a88004bae8ead66a205a125e1fe979376fc3ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:28:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Jun 2021 08:28:24 +0000 Subject: [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument In-Reply-To: <1624261433.34.0.758010123752.issue44471@roundup.psfhosted.org> Message-ID: <1624955304.08.0.326466379015.issue44471@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6cb145d23f5cf69b6d7414877d142747cd3d134c by Serhiy Storchaka in branch 'main': bpo-44471: Change error type for bad objects in ExitStack.enter_context() (GH-26820) https://github.com/python/cpython/commit/6cb145d23f5cf69b6d7414877d142747cd3d134c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:29:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Jun 2021 08:29:06 +0000 Subject: [issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL In-Reply-To: <1304712442.84.0.0469522790948.issue12022@psf.upfronthosting.co.za> Message-ID: <1624955346.83.0.0721524498045.issue12022@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 04:29:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 29 Jun 2021 08:29:12 +0000 Subject: [issue44471] Raise TypeError in ExitStack.enter_context() for bad argument In-Reply-To: <1624261433.34.0.758010123752.issue44471@roundup.psfhosted.org> Message-ID: <1624955352.21.0.0948072301329.issue44471@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:00:47 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 29 Jun 2021 10:00:47 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1624960847.37.0.227259788863.issue44490@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Should `__getitem__` be implemented for `types.Union`? I can implement it if no one is working on it. P.S. mypy currently does not support it: ``` Value of type "types.Union" is not indexable ``` ---------- nosy: +uriyyo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:21:05 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 29 Jun 2021 10:21:05 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624960847.37.0.227259788863.issue44490@roundup.psfhosted.org> Message-ID: Ken Jin added the comment: Yurii, thanks for the offer. We only need to implement __getitem__ if union supports TypeVars. Which means __parameters__ need to be implemented too (or at least a private internal implementation of it). I interpreted Guido's message above as to wait and see if static type checkers even accept things like int | list[T]. Maybe he meant that if that syntax isnt valid then theres no point for us to implement it? PEP 604 leaves out how it deals with TypeVars, so adding this behavior may require us to update the PEP first (which will require approval from others). Anyways, there's no rush. We probably can't backport this so we have until the next minor release of Python (3.11 or later) to decide. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:47:16 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 29 Jun 2021 10:47:16 +0000 Subject: [issue44529] Using typing.Union in isinstance checks In-Reply-To: <1624904136.53.0.718038325255.issue44529@roundup.psfhosted.org> Message-ID: <1624963636.13.0.326141419539.issue44529@roundup.psfhosted.org> Change by Eric V. Smith : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:50:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 10:50:38 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624963838.8.0.372867470039.issue44523@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25518 pull_request: https://github.com/python/cpython/pull/26950 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:54:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 10:54:36 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624964076.09.0.744059261196.issue42588@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0d7f7975d55eff7e3dfcebd14e765fc6cd7d3e40 by andrei kulakov in branch 'main': bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834) https://github.com/python/cpython/commit/0d7f7975d55eff7e3dfcebd14e765fc6cd7d3e40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:54:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 10:54:55 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624964095.86.0.604475241136.issue42588@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25520 pull_request: https://github.com/python/cpython/pull/26952 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:54:49 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 10:54:49 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624964089.99.0.237481992532.issue42588@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25519 pull_request: https://github.com/python/cpython/pull/26951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 06:55:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 10:55:41 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624964141.64.0.794078416981.issue42588@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks, Ran and Andrei for your contributions! :) ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 07:14:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 11:14:55 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624965295.76.0.286504829821.issue42588@roundup.psfhosted.org> miss-islington added the comment: New changeset d9fc4c3deb617beb1d0bbfdb4efc905a4192ff0a by Miss Islington (bot) in branch '3.10': bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834) https://github.com/python/cpython/commit/d9fc4c3deb617beb1d0bbfdb4efc905a4192ff0a ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 07:50:13 2021 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 29 Jun 2021 11:50:13 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624967413.57.0.622260928168.issue43625@roundup.psfhosted.org> Skip Montanaro added the comment: Thanks @andrei.avk. You are right, only the complex test is required. I suppose it's okay to commit this, but reviewing the full code of the has_header method leaves me thinking this is just putting lipstick on a pig. If I read the code correctly, there are two (undocumented) tacit assumptions: 1. The non-header values are numeric. 2. If not numeric, they are fixed length strings whose length generally differs from the length of the putative header. The second criterion means this has a header: ab,de ghi,jkl ghi,jkl but this doesn't: abc,def ghi,jkl ghi,jkl It seems to me that it would be a good idea to at least expand on the documentation of that method and maybe add at least one test case where the CSV sample doesn't have a header. I'll try to get that done and attach a patch. ---------- versions: +Python 3.11 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 07:55:16 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 29 Jun 2021 11:55:16 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1624967716.25.0.745055557332.issue44524@roundup.psfhosted.org> Ken Jin added the comment: > Is this intentional? It seems a little inconsistent. The `__name__` attribute is for internal use only. It's subject to change every release along with other implementation details. Sorry, I don't really understand what this issue is requesting. Do you want to add the `split_module_names` function or standardize `__name__` or something else? Depending on what you're suggesting the follow up would be different. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 07:59:09 2021 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 29 Jun 2021 11:59:09 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624967949.84.0.280358325451.issue43625@roundup.psfhosted.org> Skip Montanaro added the comment: I retract my comment about fixed length strings in the non-numeric case. There are clearly test cases (which I probably wrote, considering the values) where the sample as a header but the values are of varying length. Misread of the code on my part. I have obviously not had enough coffee yet this morning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:10:41 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 29 Jun 2021 12:10:41 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624968641.64.0.162268349282.issue44526@roundup.psfhosted.org> Joannah Nanjekye added the comment: Since this is the intended behavior, we can just close the issue. ---------- nosy: +nanjekyejoannah _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:11:06 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Tue, 29 Jun 2021 12:11:06 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624968666.91.0.589077256553.issue44526@roundup.psfhosted.org> Joannah Nanjekye added the comment: I mean intended wording ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:14:15 2021 From: report at bugs.python.org (Roy Smith) Date: Tue, 29 Jun 2021 12:14:15 +0000 Subject: [issue44534] unittest.mock.Mock.unsafe doc is garbled Message-ID: <1624968855.9.0.632630406188.issue44534@roundup.psfhosted.org> New submission from Roy Smith : At https://docs.python.org/3.9/library/unittest.mock.html#unittest.mock.Mock, it says: unsafe: By default if any attribute starts with assert or assret will raise an AttributeError. That's not an English sentence. I think what was intended was, "By default accessing an attribute which starts with assert or assret will raise an AttributeError." ---------- assignee: docs at python components: Documentation messages: 396719 nosy: docs at python, roysmith priority: normal severity: normal status: open title: unittest.mock.Mock.unsafe doc is garbled versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:18:31 2021 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 29 Jun 2021 12:18:31 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624969111.39.0.406539459114.issue43625@roundup.psfhosted.org> Skip Montanaro added the comment: Here is a change to the has_header documentation and an extra test case documenting the behavior when the sample contains strings. I'm not sure about the wording of the doc change, perhaps you can tweak it? Seems kind of clumsy to me. If it seems okay to you @andrei.avk, can you fold it into your PR? ---------- Added file: https://bugs.python.org/file50131/hasheader.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:19:27 2021 From: report at bugs.python.org (Scott Stevens) Date: Tue, 29 Jun 2021 12:19:27 +0000 Subject: [issue16801] Preserve original representation for integers / floats in docstrings In-Reply-To: <1356699853.91.0.313275944642.issue16801@psf.upfronthosting.co.za> Message-ID: <1624969167.23.0.143528828611.issue16801@roundup.psfhosted.org> Scott Stevens added the comment: I'm now seeing docs.python.org has regressed. For 3.9, calls present their defaults in octal, in 3.10 (beta), they're presented in decimal. https://docs.python.org/3.10/library/pathlib.html#pathlib.Path.touch https://docs.python.org/3.10/library/os.html#os.mkdir Not sure if this is the right issue to be mentioning it on; if not, please let me know so I can file another issue. ---------- nosy: +Scott Stevens _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:28:18 2021 From: report at bugs.python.org (Skip Montanaro) Date: Tue, 29 Jun 2021 12:28:18 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624969698.17.0.197472473097.issue43625@roundup.psfhosted.org> Skip Montanaro added the comment: Here's a NEWS entry. ---------- Added file: https://bugs.python.org/file50132/2021-06-29-07-27-08.bpo-43625.ZlAxhp.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 08:44:02 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Jun 2021 12:44:02 +0000 Subject: [issue44535] Cannot build in VS 2022 Message-ID: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> New submission from Steve Dower : The project files require an additional check in PCbuild/python.props to select the right toolset for VisualStudioVersion=17.0. Without this, everything will refuse to build. The toolset is still v142, so there should be not compatibility issues. The problem is in detection, not use. ---------- assignee: steve.dower components: Build, Windows messages: 396723 nosy: paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Cannot build in VS 2022 type: compile error versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 09:12:35 2021 From: report at bugs.python.org (Maarten Derickx) Date: Tue, 29 Jun 2021 13:12:35 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624972355.3.0.149581554855.issue24339@roundup.psfhosted.org> Maarten Derickx added the comment: The route via gencodec or more generally via charmap_encode and charmap_decode seems to be one that is not possible without some low level CPython code adjustments. The reason for this is that charmap_encode and charmap_decode only seem to support mappings where a single encoded byte corresponds to multiple unicode points. However iso6937 is a mixed length encoding, meaning in this specific case that unicode characters sometimes need to be encoded as a single byte and sometimes with two bytes. For example chr(0x00c0) should be encoded as b'\xc1' + b'A'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 09:21:19 2021 From: report at bugs.python.org (Lars van Gemerden) Date: Tue, 29 Jun 2021 13:21:19 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1624972879.36.0.0852764007616.issue44524@roundup.psfhosted.org> Lars van Gemerden added the comment: I was not aware the __name__ attribute is an implementation detail. It is described in the docs: https://docs.python.org/3/reference/datamodel.html. I have been using it since python 2.7, for example for logging. The function ?split_module_names? is just a function to see what items in a module have and do not have a __name__ attribute; thought it might help proceedings. If I were to suggest an improvement, it would be that all classes and types (or minimally the abc?s) would have a __name__ attribute, being the name under which it can be imported. Also that the abc?s in typing and collections are as similar as possible. ---------- nosy: +lars2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 09:36:12 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 29 Jun 2021 13:36:12 +0000 Subject: [issue44533] Where are the log file(s) In-Reply-To: <1624950906.15.0.177262141584.issue44533@roundup.psfhosted.org> Message-ID: <1624973772.26.0.682584469346.issue44533@roundup.psfhosted.org> ?ric Araujo added the comment: The python interpreter does not create log files by itself, it would be the specific command or script that you ran that does that and prints the message you show. ---------- nosy: +eric.araujo resolution: -> third party status: open -> pending type: behavior -> versions: -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 09:47:58 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 29 Jun 2021 13:47:58 +0000 Subject: [issue16842] Allow to override a function signature for pydoc with a docstring In-Reply-To: <1357157305.88.0.0239428638229.issue16842@psf.upfronthosting.co.za> Message-ID: <1624974478.66.0.1267437278.issue16842@roundup.psfhosted.org> ?ric Araujo added the comment: This proposal pre-dates signature objects; I wonder if they can be used to handle the use cases here. ---------- versions: -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 09:49:35 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Tue, 29 Jun 2021 13:49:35 +0000 Subject: [issue16801] Preserve original representation for integers / floats in docstrings In-Reply-To: <1356699853.91.0.313275944642.issue16801@psf.upfronthosting.co.za> Message-ID: <1624974575.65.0.835183003897.issue16801@roundup.psfhosted.org> ?ric Araujo added the comment: Please open a ticket! This one is about docstrings and pydoc; docs.python.org is built from rst docs with sphinx. ---------- versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:03:34 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 29 Jun 2021 14:03:34 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1624975414.2.0.252797923964.issue44524@roundup.psfhosted.org> Ken Jin added the comment: Lars, yes you're right that __name__ is documented in datamodel, sorry I wasn't clear in my original message. What I meant was that specifically for the typing module, it's not exposed anywhere in its docs https://docs.python.org/3/library/typing.html. > If I were to suggest an improvement, it would be that all classes and types (or minimally the abc?s) would have a __name__ attribute, being the name under which it can be imported. I think this makes sense. It should be as simple as adding self.__name__ = name or some variant. Note that some types hack their names, such as TypeVar or ParamSpec. So it's not always that __name__ ?== type/class name. > Also that the abc?s in typing and collections are as similar as possible. We strive towards this but it's difficult to get it 100%. The abcs in typing are implemented in pure Python and alias the ones in collections, while the ones in collections are sometimes tied to C. AFAIK, most types in typing only do what the PEPs promise. I hope you understand. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:17:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 14:17:13 +0000 Subject: [issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data In-Reply-To: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org> Message-ID: <1624976233.72.0.854323418716.issue44530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This also has the side effect of making marshalled code objects bigger, and we keep adding to this in 3.11 with the new exception table and soon with PEP 657. Given that a lot of people are concerned about this and that this change only affects a very small set of tools, we need to analyze very carefully the balance. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:19:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 14:19:12 +0000 Subject: [issue42588] Improvements to graphlib.TopologicalSorter.static_order() documentation In-Reply-To: <1607353990.94.0.818492776719.issue42588@roundup.psfhosted.org> Message-ID: <1624976352.96.0.49555631718.issue42588@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3ba65cdcefcec7866be482138a5ea8aafbd07e59 by Miss Islington (bot) in branch '3.9': bpo-42588: Update the docs for the TopologicalSorter.static_order() method (GH-26834) (GH-26952) https://github.com/python/cpython/commit/3ba65cdcefcec7866be482138a5ea8aafbd07e59 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:20:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 14:20:50 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624976450.1.0.547989055296.issue44531@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Anyway, I propose to add a new _PyType_AllocNoTrack() function which allocates memory without tracking the newly allocated object directly in the GC. How is that going to help third party extensions and subclasses? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:25:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 14:25:25 +0000 Subject: =?utf-8?q?=5Bissue44526=5D_Doc_typo_in_=22What=E2=80=99s_New_In_Python_3?= =?utf-8?b?LjEwIiAoeC95LWF4aXMp?= In-Reply-To: <1624890291.98.0.24550553964.issue44526@roundup.psfhosted.org> Message-ID: <1624976725.9.0.518868946641.issue44526@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 Jun 29 10:26:09 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 29 Jun 2021 14:26:09 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1624976769.11.0.047029295572.issue43625@roundup.psfhosted.org> Andrei Kulakov added the comment: Skip: I've updated the PR Expanded the docs a bit, I think they give a good rough idea of the logic but I feel like they can probably be improved more, let me know what you think! I spent some time thinking about it but found it tricky! :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:29:49 2021 From: report at bugs.python.org (Kunal) Date: Tue, 29 Jun 2021 14:29:49 +0000 Subject: [issue43832] asyncio + multiprocessing = core dump in sem_trywait In-Reply-To: <1618329047.14.0.057176308941.issue43832@roundup.psfhosted.org> Message-ID: <1624976989.33.0.965241130066.issue43832@roundup.psfhosted.org> Kunal added the comment: I was trying to reproduce the problem and can get the core dump to happen with a smaller program as well -- it doesn't seem related to asyncio specifically but seems to be a bug with multiprocessing.Event (or probably the primitives inside it). ``` #!/usr/bin/env python import time import multiprocessing def master_func(event) -> None: print(f"Child: {event = }") print(f"Child: {event.is_set() = }") # Crashes here with SIGSEGV in sem_trywait print("Completed") if __name__ == "__main__": event = multiprocessing.Event() context_spawn = multiprocessing.get_context("spawn") proc = context_spawn.Process(target=master_func, args=(event, )) proc.start() print(f"Parent: {event = }") print(f"Parent: {event.is_set() = }") proc.join() ``` Switching to fork instead of spawn bypasses the issue. Trying to dig into this a little bit more. ---------- nosy: +knl _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:39:27 2021 From: report at bugs.python.org (Illia Volochii) Date: Tue, 29 Jun 2021 14:39:27 +0000 Subject: [issue43215] Document Happy Eyeballs arguments of asyncio.open_connection In-Reply-To: <1613229396.78.0.230354163599.issue43215@roundup.psfhosted.org> Message-ID: <1624977567.63.0.0125552008098.issue43215@roundup.psfhosted.org> Change by Illia Volochii : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:39:38 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 14:39:38 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624977578.24.0.108273571544.issue44531@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 823460daa9fab3d0cf00ec553d1e35635ef73d40 by Victor Stinner in branch 'main': bpo-44531: Fix type_repr() if tp_name is NULL (GH-26948) https://github.com/python/cpython/commit/823460daa9fab3d0cf00ec553d1e35635ef73d40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:40:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 14:40:31 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624977631.91.0.92981723875.issue44531@roundup.psfhosted.org> STINNER Victor added the comment: > How is that going to help third party extensions and subclasses? It doesn't solve bpo-40142 issue for third party extensions. About subclasses, I'm not sure if it's safe to call the traverse function if a subclass overrides it and visits its own member which are not in the built-in type (like dict or tuple). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:41:53 2021 From: report at bugs.python.org (Marc-Andre Lemburg) Date: Tue, 29 Jun 2021 14:41:53 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624977713.12.0.989939666094.issue24339@roundup.psfhosted.org> Marc-Andre Lemburg added the comment: Right, the charmap codec was built with the Unicode Consortium mappings in mind. However, you may have some luck decoding the two byte chars in ISO 6937 using combining code points in Unicode. With some extra post processing you could also normalize the output into single code points. If I find time, I may have a look at gencodec.py again and update it to more modern interfaces. I've long given up maintenance of Unicode in Python and only try to help by giving some guidance based on the original implementation design. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:44:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 14:44:03 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624977843.17.0.0283863756002.issue44531@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > About subclasses, I'm not sure if it's safe to call the traverse function if a subclass overrides it and visits its own member which are not in the built-in type (like dict or tuple). Technically the traverse should only call visit on the members, but in practice they can do whatever. I agree is not clear is a safe operation ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:46:03 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Jun 2021 14:46:03 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624975414.2.0.252797923964.issue44524@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: It sounds reasonable to add the __name__ attribute. Since these objects aren't really types, the default mechanism for constructing a type doesn't give them this. Are there other attributes that are missing? We should probably add those too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:48:36 2021 From: report at bugs.python.org (Kunal) Date: Tue, 29 Jun 2021 14:48:36 +0000 Subject: [issue43832] asyncio + multiprocessing = core dump in sem_trywait In-Reply-To: <1618329047.14.0.057176308941.issue43832@roundup.psfhosted.org> Message-ID: <1624978116.64.0.947048238377.issue43832@roundup.psfhosted.org> Kunal added the comment: Oh, it looks like it's because the context for the Event doesn't match when created this way (the default context on linux is fork). The problem goes away if the Event instance is created from the spawn context -- specifically, patching dump_core.py ``` @@ -22,14 +22,13 @@ def master_func(space:dict) -> None: if __name__ == "__main__": - this_event = multiprocessing.Event() + context_spawn = multiprocessing.get_context("spawn") + this_event = context_spawn.Event() this_space = dict( this_event=this_event, ) - context_spawn = multiprocessing.get_context("spawn") - master_proc = context_spawn.Process( ``` I think this can be closed; the incompatibility between contexts is also documented at https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Lock, thought it could be a little more explicit about potential segfaults. > Note that objects related to one context may not be compatible with processes for a different context. In pait's berticular, locks created using the fork context cannot be passed to processes started using the spawn or forkserver start methods. (Event uses a Lock under the hood) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:49:17 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 29 Jun 2021 14:49:17 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1624978157.82.0.696263507284.issue44531@roundup.psfhosted.org> STINNER Victor added the comment: For the background of this issue, please see bpo-38392: https://bugs.python.org/issue38392#msg354074 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 10:55:23 2021 From: report at bugs.python.org (=?utf-8?b?55Sz5rO36L2p?=) Date: Tue, 29 Jun 2021 14:55:23 +0000 Subject: [issue44536] wrong output of np.lcm.reduce(*awg) Message-ID: <1624978523.12.0.931215741886.issue44536@roundup.psfhosted.org> New submission from ??? <751630742 at qq.com>: np.lcm.reduce([1,2,3,100]) Out[125]: 300 np.lcm.reduce([1,2,3,100,101]) Out[126]: 30300 np.lcm.reduce([1,2,3,100,101,99019]) Out[127]: -1294691596 30300*99019 Out[128]: 3000275700 ---------- assignee: docs at python components: Documentation files: a text for lcm() in numpy.py messages: 396742 nosy: docs at python, zlwq priority: normal severity: normal status: open title: wrong output of np.lcm.reduce(*awg) versions: Python 3.8 Added file: https://bugs.python.org/file50133/a text for lcm() in numpy.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 11:06:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 15:06:20 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1624979180.59.0.469765254101.issue43950@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25521 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26955 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 11:07:49 2021 From: report at bugs.python.org (Maarten Derickx) Date: Tue, 29 Jun 2021 15:07:49 +0000 Subject: [issue24339] iso6937 encoding missing In-Reply-To: <1433078403.47.0.568019085367.issue24339@psf.upfronthosting.co.za> Message-ID: <1624979269.66.0.82600849097.issue24339@roundup.psfhosted.org> Maarten Derickx added the comment: Hi Marc-Andre Lemburg, Thanks for your responses and guidance. At least your pointers to charmap_encode and charmap_decode helped, since it shows at least what the general idea is on how to deal with these types of encodings. In the mean time I did produce some successes. I wrote some python code that can create character mappings based on the table in http://webstore.iec.ch/preview/info_isoiec6937%7Bed3.0%7Den.pdf so that we can be sure that there are no human errors in generating the mappings. I think my further approach is to write pure python versions of charmap_encode and charmap_decode that can handle the general case of multi byte encodings to unicode case. This won't be as fast as using the builtins written c. But at least gives maintainable and hopefully reusable code. Maybe later the c-implementation can be updated as well. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 11:36:52 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 29 Jun 2021 15:36:52 +0000 Subject: [issue44536] wrong output of np.lcm.reduce(*awg) In-Reply-To: <1624978523.12.0.931215741886.issue44536@roundup.psfhosted.org> Message-ID: <1624981012.64.0.430899604003.issue44536@roundup.psfhosted.org> Mark Dickinson added the comment: It looks as though you're reporting an issue with NumPy; this tracker is for the Python core language, which doesn't include NumPy. For NumPy bugs, use the NumPy bug tracker at https://github.com/numpy/numpy/issues. (Though I don't think this _is_ a NumPy bug: it's simply the result of integer overflow in NumPy.) ---------- nosy: +mark.dickinson resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 12:19:25 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 29 Jun 2021 16:19:25 +0000 Subject: [issue16801] Preserve original representation for integers / floats in docstrings In-Reply-To: <1356699853.91.0.313275944642.issue16801@psf.upfronthosting.co.za> Message-ID: <1624983565.35.0.854015744405.issue16801@roundup.psfhosted.org> Mark Dickinson added the comment: I suspect the difference is due to a change in the way that Sphinx handles the py:method directive: the rst source for `pathlib.Path.touch` hasn't changed between 3.9 and 3.10, but the 3.9 docs are built with Sphinx 2.4.4, while the 3.10 docs are built with Sphinx 3.2.1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 12:31:15 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 29 Jun 2021 16:31:15 +0000 Subject: [issue16801] Preserve original representation for integers / floats in docstrings In-Reply-To: <1356699853.91.0.313275944642.issue16801@psf.upfronthosting.co.za> Message-ID: <1624984275.69.0.422978276658.issue16801@roundup.psfhosted.org> Mark Dickinson added the comment: FWIW, the relevant change seems to be this one: https://github.com/sphinx-doc/sphinx/pull/7155 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 12:33:48 2021 From: report at bugs.python.org (Jakub Wilk) Date: Tue, 29 Jun 2021 16:33:48 +0000 Subject: [issue30717] Add unicode grapheme cluster break algorithm In-Reply-To: <1497986122.28.0.540580196076.issue30717@psf.upfronthosting.co.za> Message-ID: <1624984428.8.0.787615714629.issue30717@roundup.psfhosted.org> Change by Jakub Wilk : ---------- nosy: +jwilk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 12:52:05 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 29 Jun 2021 16:52:05 +0000 Subject: [issue43945] [Enum] standardize format() behavior In-Reply-To: <1619478272.35.0.783754187217.issue43945@roundup.psfhosted.org> Message-ID: <1624985525.27.0.174982680429.issue43945@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 12:54:53 2021 From: report at bugs.python.org (Andre Roberge) Date: Tue, 29 Jun 2021 16:54:53 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1624985693.76.0.723447365173.issue43950@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:16:08 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Tue, 29 Jun 2021 17:16:08 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624986968.21.0.331265564296.issue44523@roundup.psfhosted.org> Neil Schemenauer added the comment: It seems to me the old behaviour (don't forward hash) was done for good reasons. If the referent might go away, it is not valid to use it as a dict key since the hash and eq result changes. If it can't go away, what reason is there to use a weakref and not a direct reference? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:28:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Jun 2021 17:28:12 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624987692.59.0.585627526778.issue38062@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 12803c59d54ff1a45a5b08cef82652ef199b3b07 by Jack DeVries in branch 'main': bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935) https://github.com/python/cpython/commit/12803c59d54ff1a45a5b08cef82652ef199b3b07 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:28:17 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 17:28:17 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624987697.82.0.989098737246.issue38062@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25522 pull_request: https://github.com/python/cpython/pull/26956 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:28:23 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 17:28:23 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624987703.64.0.644548872349.issue38062@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25523 pull_request: https://github.com/python/cpython/pull/26957 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:30:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 17:30:45 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624987845.42.0.706385664969.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Neil for your input. I am indeed reverting that change to its previous behaviour. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:30:52 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:30:52 +0000 Subject: [issue1635741] Py_Finalize() doesn't clear all Python objects at exit Message-ID: <1624987852.92.0.516169363919.issue1635741@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:31:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 17:31:47 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1624987907.65.0.0741397158385.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Just also to be clear on my original message, reverting it to a previous behaviour would disallow some patterns that could be useful: >>> class A: ... ... ... >>> a = A() >>> d = {a: None} >>> weakref.proxy(a) in d True But I agree is better to revert back in any case ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:31:43 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:31:43 +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: <1624987903.82.0.94152020557.issue40077@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:32:10 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:32:10 +0000 Subject: [issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.) In-Reply-To: <1580484815.27.0.407070570821.issue39511@roundup.psfhosted.org> Message-ID: <1624987930.89.0.706694316243.issue39511@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:32:29 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:32:29 +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: <1624987949.67.0.958059416641.issue40601@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:33:52 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:33:52 +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: <1624988032.0.0.293279730702.issue15751@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:34:08 2021 From: report at bugs.python.org (h-vetinari) Date: Tue, 29 Jun 2021 17:34:08 +0000 Subject: [issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey) In-Reply-To: <1588698734.65.0.223552100195.issue40522@roundup.psfhosted.org> Message-ID: <1624988048.12.0.230366604632.issue40522@roundup.psfhosted.org> Change by h-vetinari : ---------- nosy: +h-vetinari _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:52:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Jun 2021 17:52:56 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624989176.68.0.98651699994.issue38062@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 08aa26e4355da6f916da0c97d00774800ee0fc46 by Miss Islington (bot) in branch '3.10': bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935) (GH-26956) https://github.com/python/cpython/commit/08aa26e4355da6f916da0c97d00774800ee0fc46 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 13:53:10 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Jun 2021 17:53:10 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624989190.71.0.767289539703.issue38062@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 02859df10591789c72eb185a4f7dd9cc1ea8dcbb by Miss Islington (bot) in branch '3.9': bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935) (GH-26957) https://github.com/python/cpython/commit/02859df10591789c72eb185a4f7dd9cc1ea8dcbb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 14:22:49 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Jun 2021 18:22:49 +0000 Subject: [issue38062] Clarify that atexit.unregister matches by equality, not identity In-Reply-To: <1568019088.84.0.443323623922.issue38062@roundup.psfhosted.org> Message-ID: <1624990969.47.0.117174324151.issue38062@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 Jun 29 15:09:17 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 29 Jun 2021 19:09:17 +0000 Subject: [issue6407] multiprocessing Pool should allow custom task queue In-Reply-To: <1246627398.56.0.0568609724018.issue6407@psf.upfronthosting.co.za> Message-ID: <1624993757.43.0.104810098182.issue6407@roundup.psfhosted.org> Irit Katriel added the comment: It should be possible to do this now through the context, but it's not documented: >>> import multiprocessing as mp >>> ctx = mp.get_context() >>> ctx.SimpleQueue > >>> ctx.SimpleQueue = list >>> ctx.SimpleQueue ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 16:11:11 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 29 Jun 2021 20:11:11 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1624997471.28.0.963139818501.issue43950@roundup.psfhosted.org> Change by Ammar Askar : ---------- nosy: +ammar2 nosy_count: 8.0 -> 9.0 pull_requests: +25524 pull_request: https://github.com/python/cpython/pull/26958 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 16:16:24 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Tue, 29 Jun 2021 20:16:24 +0000 Subject: [issue44530] Propagate qualname from the compiler unit to code objects for finer grained profiling data In-Reply-To: <1624919733.39.0.974767657181.issue44530@roundup.psfhosted.org> Message-ID: <1624997784.35.0.709432212946.issue44530@roundup.psfhosted.org> Gabriele N Tornetta added the comment: Thanks for the feedback. I certainly appreciate all the concerns around this proposed change. @Mark.Shannon 1. This is the desired behaviour as profiling data should be attached to the actual code objects that correlate with the actual source content. Besides, in this respect, given the immutability of code objects, qualname behaves like name. 2. At the Python level it is already possible to get the __qualname__ of a function (but not of a code object). As this is all I needed, I kept my initial implementation to the bare minimum. 3. I agree with this analysis. Whilst this increases the memory footprint, it might have the benefit of making the derivation of __qualname__ faster as this would now be cached on code objects. However, I also appreciate @pablogsal's point of view of evaluating the actual benefits. The extra point in favour of this change that I can make is that it would resolve name clashes in profiling data from tools that have minimal impact on the runtime. Whether this is enough to justify the extra memory cost is certainly up for debate. From my side, I don't have the numbers to make this case more concrete. As a next step, I'll look into exposing the new field to Python to see what it actually ends up looking like. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 16:16:30 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 29 Jun 2021 20:16:30 +0000 Subject: [issue33025] urlencode produces bad output from ssl.CERT_NONE and friends that chokes decoders In-Reply-To: <1520492267.34.0.467229070634.issue33025@psf.upfronthosting.co.za> Message-ID: <1624997790.56.0.523230956312.issue33025@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 16:40:27 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Jun 2021 20:40:27 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1624999227.27.0.248056575527.issue44490@roundup.psfhosted.org> Guido van Rossum added the comment: I intended for someone to write some test programs and report back here what mypy actually supports and what it doesn't. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:16:44 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 29 Jun 2021 22:16:44 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1625005004.74.0.345078088215.issue44490@roundup.psfhosted.org> Jack DeVries added the comment: mypy does not support __parameters__: (venv) ? cpython git:(main) cat repro.py from typing import TypeVar T = TypeVar('T') (int | list[T]).__parameters__ (venv) ? cpython git:(main) mypy --version mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e (venv) ? cpython git:(main) python --version Python 3.11.0a0 (venv) ? cpython git:(main) mypy repro.py repro.py:4: error: "types.Union" has no attribute "__parameters__" Found 1 error in 1 file (checked 1 source file) (venv) ? cpython git:(main) mypy also does not support __getitem__ (venv) ? cpython git:(main) cat repro.py from typing import TypeVar T = TypeVar('T') (int | list[T]).__getitem__ (venv) ? cpython git:(main) mypy --version ./mypy 0.920+dev.cae5d3c8b5f14d0796914aa6a113473ca3ffc38e (venv) ? cpython git:(main) python --version Python 3.11.0a0 (venv) ? cpython git:(main) mypy repro.py repro.py:4: error: Value of type "types.Union" is not indexable Found 1 error in 1 file (checked 1 source file) (venv) ? cpython git:(main) ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:20:12 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 29 Jun 2021 22:20:12 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625005212.97.0.04162412741.issue41180@roundup.psfhosted.org> Steve Dower added the comment: I'm going to revert this and replace it with a marshal.loads (and dumps) event instead. The performance impact on loading .pyc files is too great, as it triggers the hook for each function. Without severely modifying importlib we can't bypass the call that's accessible to Python code, and the important part to detect is marshal calls outside of regular imports. And wanted to mention that Yunfan Zhan suggested adding these events originally and I chose to go the other way. So my bad, and let's get it right now! ---------- assignee: -> steve.dower nosy: +gvanrossum resolution: fixed -> stage: resolved -> needs patch status: closed -> open versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:26:10 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Jun 2021 22:26:10 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1625005570.33.0.0604336861761.issue44490@roundup.psfhosted.org> Jelle Zijlstra added the comment: Mypy is definitely not going to support direct access to `__parameters__`; what Guido is referring to is whether usage of types.Union that would require `__parameters__` at runtime is accepted by mypy. For example, this: from typing import TypeVar T = TypeVar("T") Alias = int | list[T] def f(x: Alias[str]) -> None: pass But this produces `main.py:7: error: Variable "main.Alias" is not valid as a type`: mypy doesn't even recognize `|` as a type yet. I'd rather not focus too much though on what mypy does; it is one of many type checkers by now and does not tend to be the quickest in adding support for new features. Pyright does handle the file above as I'd expect, for what it's worth. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:41:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Jun 2021 22:41:43 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1625005570.33.0.0604336861761.issue44490@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: So I guess to expand on Jelle's example, Alias[str] should return (int | list[str]), right? That makes sense since that's how Union works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:43:44 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 29 Jun 2021 22:43:44 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1625006624.09.0.354347230774.issue44490@roundup.psfhosted.org> Jelle Zijlstra added the comment: I'd also be OK with returning a `types.GenericAlias(int | list[T], str)`, which might be simpler. It doesn't matter for static type checkers, and runtime type checkers can extract what they need anyway. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:58:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 22:58:55 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625007535.85.0.959248646766.issue44523@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25525 pull_request: https://github.com/python/cpython/pull/26959 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:58:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 22:58:57 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625007537.19.0.291249133003.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e2fea101fd5517f33371b04432842b971021c3bf by Pablo Galindo in branch 'main': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) https://github.com/python/cpython/commit/e2fea101fd5517f33371b04432842b971021c3bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 18:59:01 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 22:59:01 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625007541.51.0.541530193933.issue44523@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25526 pull_request: https://github.com/python/cpython/pull/26960 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:08:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 23:08:22 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625008102.93.0.121201788384.issue44523@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 Jun 29 19:19:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 29 Jun 2021 23:19:36 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625008776.01.0.194508857823.issue44523@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f790bc8084d3dfd723889740f9129ac8fcb2fa02 by Miss Islington (bot) in branch '3.9': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) (GH-26960) https://github.com/python/cpython/commit/f790bc8084d3dfd723889740f9129ac8fcb2fa02 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:19:31 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 29 Jun 2021 23:19:31 +0000 Subject: [issue44523] weakref.proxy documentation might be outdated In-Reply-To: <1624889705.43.0.546367758127.issue44523@roundup.psfhosted.org> Message-ID: <1625008771.01.0.493651267788.issue44523@roundup.psfhosted.org> miss-islington added the comment: New changeset 2df13e1211cf420bf6557df02e694bf1653a0ebe by Miss Islington (bot) in branch '3.10': bpo-44523: Remove the pass-through for hash() in weakref proxy objects (GH-26950) https://github.com/python/cpython/commit/2df13e1211cf420bf6557df02e694bf1653a0ebe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:35:17 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Jun 2021 23:35:17 +0000 Subject: [issue44537] Document PGO in devguide Message-ID: <1625009717.25.0.620179855703.issue44537@roundup.psfhosted.org> New submission from Guido van Rossum : The only docs for PGO seem to be in the toplevel README.rst. Sinec that is what's shown to all visitors to the GitHub repo, perhaps this information is not so useful there, and instead a section could be added to the devguide? (Ditto for LTO.) Note that for Windows this info is in PCbuild/readme.txt. It's perhaps okay to keep it there, and just mention in the devguide that the Windows info in there. FWIW, maybe we should get rid of the tradition that the toplevel README.rst file's heading gives the version? That tradition dates from the times when source distributions were done as tarballs... It would save one more place to update (there's another mention of the version later in README.rst which still points to 3.10). ---------- assignee: docs at python components: Documentation messages: 396764 nosy: docs at python, gvanrossum priority: normal severity: normal status: open title: Document PGO in devguide versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:41:33 2021 From: report at bugs.python.org (Tim) Date: Tue, 29 Jun 2021 23:41:33 +0000 Subject: [issue44538] ast.Slice 3.9.6 documentation bug Message-ID: <1625010093.71.0.0337806588286.issue44538@roundup.psfhosted.org> New submission from Tim : Based off the ast 3.9.6 documentation (https://docs.python.org/3/library/ast.html), we would expect `Slice` to inherit from `expr`. However, looking at `ast.Slice.__mro__` produces the following output: `(, , , )`. It appears that instead of inheriting from `expr`, `Slice` inherits from `slice` which appears to be a deprecated type. ---------- assignee: docs at python components: Documentation messages: 396765 nosy: c3-timjbaer, docs at python priority: normal severity: normal status: open title: ast.Slice 3.9.6 documentation bug type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:56:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 29 Jun 2021 23:56:45 +0000 Subject: [issue44537] Document PGO in devguide In-Reply-To: <1625009717.25.0.620179855703.issue44537@roundup.psfhosted.org> Message-ID: <1625011005.03.0.0506462729051.issue44537@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, there is now also info on how to build in the end user documentation in Doc/using/configure.rst. I am actually confused by the intention of documenting information about *building* CPython in the same place where we document *using* Python (and sometimes CPython), esp. given that we have a devguide. Maybe one of the docs owners can clarify where they thing PGO should be documented, and why? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 19:57:06 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 29 Jun 2021 23:57:06 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1625006624.09.0.354347230774.issue44490@roundup.psfhosted.org> Message-ID: Ken Jin added the comment: I don't think we need the types.GenericAlias(int | list[T], str) workaround. GenericAlias already has code for extracting __parameters__ and implementing __getitem__. Someone would need to refactor and reuse them for Union too. That should be enough to trick GenericAlias to treat Union as another GenericAlias(I don't remember if it checks for __origin__ as well) and cover other edge cases as well. @Yurii do you still plan to take this? If not, I'll start working on something later today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 21:28:22 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 01:28:22 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625016502.14.0.676499339317.issue41180@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25527 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26961 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jun 29 21:36:23 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 01:36:23 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625016983.43.0.731870689968.issue44535@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +25528 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26962 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 02:19:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Jun 2021 06:19:36 +0000 Subject: [issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket In-Reply-To: <1613416609.25.0.407610615564.issue43232@roundup.psfhosted.org> Message-ID: <1625033976.42.0.715862496609.issue43232@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1d08d85cbe49c0748a8ee03aec31f89ab8e81496 by Illia Volochii in branch 'main': bpo-43232: Remove previously deprecated methods on TransportSocket (GH-24538) https://github.com/python/cpython/commit/1d08d85cbe49c0748a8ee03aec31f89ab8e81496 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 02:19:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Jun 2021 06:19:34 +0000 Subject: [issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket In-Reply-To: <1613416609.25.0.407610615564.issue43232@roundup.psfhosted.org> Message-ID: <1625033974.31.0.667431114108.issue43232@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 03:12:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 30 Jun 2021 07:12:02 +0000 Subject: [issue44538] ast.Slice 3.9.6 documentation bug In-Reply-To: <1625010093.71.0.0337806588286.issue44538@roundup.psfhosted.org> Message-ID: <1625037122.64.0.0976219755527.issue44538@roundup.psfhosted.org> Serhiy Storchaka added the comment: What Python version did you tried? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 04:02:45 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 30 Jun 2021 08:02:45 +0000 Subject: [issue44490] PEP 604 Union (int | str) doesn't have __parameters__ In-Reply-To: <1624368599.83.0.338910210763.issue44490@roundup.psfhosted.org> Message-ID: <1625040165.85.0.708747554533.issue44490@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: @Ken I will pick up this issue, thanks for asking. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 04:12:46 2021 From: report at bugs.python.org (Mohamad Mansour) Date: Wed, 30 Jun 2021 08:12:46 +0000 Subject: [issue44539] Imghdr JPG Quantized Message-ID: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> New submission from Mohamad Mansour : Previous method to check JPG images was using the following command (h[6:10] in (b'JFIF', b'Exif')) However, its not always the case as some might start with b'\xff\xd8\xff\xdb' header. Reference: https://www.digicamsoft.com/itu/itu-t81-36.html https://web.archive.org/web/20120403212223/http://class.ee.iastate.edu/ee528/Reading%20material/JPEG_File_Format.pdf ---------- components: C API messages: 396771 nosy: m.mansour priority: normal severity: normal status: open title: Imghdr JPG Quantized 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 Wed Jun 30 04:28:04 2021 From: report at bugs.python.org (macmule) Date: Wed, 30 Jun 2021 08:28:04 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1625041684.73.0.359902967763.issue42514@roundup.psfhosted.org> macmule added the comment: Just wondering if any movement on this etc. This is something I've been struggling with too, and have attempted to overcome via Greg's project to no avail. ---------- nosy: +macmule _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 04:28:26 2021 From: report at bugs.python.org (Mohamad Mansour) Date: Wed, 30 Jun 2021 08:28:26 +0000 Subject: [issue44539] Imghdr JPG Quantized In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1625041706.23.0.828772937508.issue44539@roundup.psfhosted.org> Change by Mohamad Mansour : ---------- components: +Library (Lib) -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 04:32:42 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 30 Jun 2021 08:32:42 +0000 Subject: [issue25653] ctypes+callbacks+fork+selinux = crash In-Reply-To: <1447826584.36.0.973987165664.issue25653@psf.upfronthosting.co.za> Message-ID: <1625041962.36.0.240702022242.issue25653@roundup.psfhosted.org> Petr Viktorin added the comment: Here's a simpler reproducer. ---------- nosy: +petr.viktorin Added file: https://bugs.python.org/file50134/y.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 04:51:23 2021 From: report at bugs.python.org (Mohamad Mansour) Date: Wed, 30 Jun 2021 08:51:23 +0000 Subject: [issue44539] Imghdr JPG Quantized In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1625043083.24.0.602482128712.issue44539@roundup.psfhosted.org> Change by Mohamad Mansour : ---------- keywords: +patch pull_requests: +25529 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26964 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 05:01:13 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 30 Jun 2021 09:01:13 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1625043673.34.0.607378485999.issue42238@roundup.psfhosted.org> Julien Palard added the comment: Another true positive: ... versionchanged:: 3.11 from : 6cb145d23f5cf69b6d7414877d142747cd3d134c / https://github.com/python/cpython/pull/26820 I also think it can be implemented in rstlint. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 05:36:44 2021 From: report at bugs.python.org (Julien Palard) Date: Wed, 30 Jun 2021 09:36:44 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1625045804.03.0.816335715819.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +25530 pull_request: https://github.com/python/cpython/pull/26966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 06:25:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Jun 2021 10:25:36 +0000 Subject: [issue24499] Python Installer text piles up during installation process In-Reply-To: <1435161571.8.0.161419365704.issue24499@psf.upfronthosting.co.za> Message-ID: <1625048736.01.0.353134306527.issue24499@roundup.psfhosted.org> Irit Katriel added the comment: Please create a new issue if you are still seeing this on a current version. ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 08:44:01 2021 From: report at bugs.python.org (MB113) Date: Wed, 30 Jun 2021 12:44:01 +0000 Subject: [issue44540] venv: activate.bat fails for venv with special characters in PATH Message-ID: <1625057041.78.0.250792490415.issue44540@roundup.psfhosted.org> New submission from MB113 : If your virtual env Scripts folder is in a path with a special character (for batch-scripts) it will give this error: The system cannot find the path specified. In my case it was a '&' in my path. Now I see that the fix from specifically this issue: https://bugs.python.org/issue36634 has caused my problems. So in the end neither works. set "VIRTUAL_ENV=__VENV_DIR__" doesn't work with quotes set VIRTUAL_ENV=__VENV_DIR__ doesn't work with 'special chars' (&*) ---------- components: Library (Lib), Windows messages: 396776 nosy: MB113, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: venv: activate.bat fails for venv with special characters in PATH type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 09:25:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Jun 2021 13:25:53 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625059553.64.0.703631101877.issue34798@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +25531 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26967 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 09:27:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 30 Jun 2021 13:27:27 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625059647.15.0.47927038898.issue34798@roundup.psfhosted.org> Irit Katriel added the comment: I made PR26967 to break up the paragraph about the constructor params so that it's easier to read, and also added emphasis around the "sequence" point. ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 09:28:09 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 30 Jun 2021 13:28:09 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1625059689.09.0.1742912819.issue43770@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 10:35:26 2021 From: report at bugs.python.org (Lars) Date: Wed, 30 Jun 2021 14:35:26 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1625063726.4.0.841323476202.issue44524@roundup.psfhosted.org> Lars added the comment: I have been doing some research, but note that I don't have much experience with the typing module. That said, there seem to be 2 main cases: - '_SpecialForm': with instances Any, Union, etc. - '_BaseGenericAlias'/'_SpecialGenericAlias': base classes collections classes. I think '_SpecialForm' can be enhanced to have '__name__' by replacing the '_name' attribute with '__name__'. Maybe add '__qualname__' as well. I cannot say whether there are many more attributes that could be implemented to have the same meaning as in 'type'. The meaning of attributes like '__mro__' seem difficult to define. Alternatively '__getattr__' could be added (but that might be too much): def __getattr__(self, attr): return getattr(self._getitem, attr) '_BaseGenericAlias''_SpecialGenericAlias' the '__getattr__' method could perhaps be adapted (or overridden in '_SpecialGenericAlias') as follows, from: def __getattr__(self, attr): # We are careful for copy and pickle. # Also for simplicity we just don't relay all dunder names if '__origin__' in self.__dict__ and not _is_dunder(attr): return getattr(self.__origin__, attr) raise AttributeError(attr) to: def __getattr__(self, attr): if '__origin__' in self.__dict__: return getattr(self.__origin__, attr) raise AttributeError(attr) or perhaps: def __getattr__(self, attr): if '__origin__' in self.__dict__ and hasattr(type, attr): return getattr(self.__origin__, attr) raise AttributeError(attr) to forward unresolved attribute names to the original class. I have written some tools and tested some with the above solutions and this seems to solve the missing '__name__' issue and make the typing abc's much more in line with the collection abc's. However I did not do any unit/regression testing (pull the repo, etc.) tools are attached. ---------- Added file: https://bugs.python.org/file50135/typing_attributes.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 11:01:06 2021 From: report at bugs.python.org (qdinar) Date: Wed, 30 Jun 2021 15:01:06 +0000 Subject: =?utf-8?q?=5Bissue34723=5D_lower=28=29_on_Turkish_letter_=22=C4=B0=22_ret?= =?utf-8?q?urns_a_2-chars-long_string?= In-Reply-To: <1537279336.26.0.956365154283.issue34723@psf.upfronthosting.co.za> Message-ID: <1625065266.77.0.873176338854.issue34723@roundup.psfhosted.org> qdinar added the comment: ?ahin Kureta said: "I know it is not finalized and released yet but are you going to implement Version 14.0.0 of the Unicode Standard? It finally solves the issue of Turkish lower/upper case 'I' and 'i'." . this looks like that unicode version 14 has some new things about that. it is not so. it same as version 13. compare https://www.unicode.org/Public/13.0.0/ucd/SpecialCasing.txt and https://www.unicode.org/Public/14.0.0/ucd/SpecialCasing-14.0.0d8.txt ( if it is 404 try to enter from https://www.unicode.org/Public/14.0.0/ucd/ ). ---------- nosy: +qdinar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 11:47:41 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 30 Jun 2021 15:47:41 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1625068061.57.0.0572329550437.issue43425@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25532 pull_request: https://github.com/python/cpython/pull/26968 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 11:51:29 2021 From: report at bugs.python.org (Safihre) Date: Wed, 30 Jun 2021 15:51:29 +0000 Subject: [issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record In-Reply-To: <1561056169.29.0.814417679233.issue37355@roundup.psfhosted.org> Message-ID: <1625068289.6.0.121073588902.issue37355@roundup.psfhosted.org> Safihre added the comment: Is anyone available to give feedback on the remaining questions/problems in the PR? I don't want to be pushy and if it's only changed in 3.11, I understand, but just hoping for some progress :) Also willing to dive into it myself, but not a network/python-core specialist to really get all the details right away. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:09:04 2021 From: report at bugs.python.org (Tim) Date: Wed, 30 Jun 2021 16:09:04 +0000 Subject: [issue44538] ast.Slice 3.9.6 documentation bug In-Reply-To: <1625010093.71.0.0337806588286.issue44538@roundup.psfhosted.org> Message-ID: <1625069344.62.0.118696270707.issue44538@roundup.psfhosted.org> Tim added the comment: I was using 3.8. I followed the same steps on 3.9 and confirmed it worked - closing now. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:22:07 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 16:22:07 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625070127.7.0.849657595668.issue41180@roundup.psfhosted.org> Steve Dower added the comment: New changeset 139de04518bd98a975b7c98ab8a38e570dc585e4 by Steve Dower in branch 'main': bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26961) https://github.com/python/cpython/commit/139de04518bd98a975b7c98ab8a38e570dc585e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:24:29 2021 From: report at bugs.python.org (=?utf-8?q?Maciej_Kope=C4=87?=) Date: Wed, 30 Jun 2021 16:24:29 +0000 Subject: [issue44541] collections.abc.Sequence index implementation Message-ID: <1625070269.09.0.120970069586.issue44541@roundup.psfhosted.org> New submission from Maciej Kope? : Hello, https://github.com/python/cpython/blob/3.9/Lib/_collections_abc.py#L1012 Shouldn't the loop condition be i <= 0 not i < 0? The implementation now is causing not to search in 1-element sequences, since it raises ValueError. Please let me know if this is the expected behaviour. Kind regards, Maciej Kope? ---------- messages: 396783 nosy: LordVilgefortz priority: normal severity: normal status: open title: collections.abc.Sequence index implementation type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:25:05 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 30 Jun 2021 16:25:05 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1625070305.71.0.886884274406.issue43425@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25533 pull_request: https://github.com/python/cpython/pull/26969 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:29:10 2021 From: report at bugs.python.org (=?utf-8?q?Maciej_Kope=C4=87?=) Date: Wed, 30 Jun 2021 16:29:10 +0000 Subject: [issue44541] collections.abc.Sequence index implementation In-Reply-To: <1625070269.09.0.120970069586.issue44541@roundup.psfhosted.org> Message-ID: <1625070550.88.0.63836695127.issue44541@roundup.psfhosted.org> Maciej Kope? added the comment: Sorry for the hastily posted issue, when stop is not given this should work properly, and since stop is exclusive in python, this shall be expected behaviour. ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:33:43 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 16:33:43 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625070823.38.0.452361169937.issue41180@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25534 pull_request: https://github.com/python/cpython/pull/26970 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:34:19 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 16:34:19 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625070859.01.0.712775677006.issue41180@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25535 pull_request: https://github.com/python/cpython/pull/26971 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 12:46:03 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 16:46:03 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625071563.05.0.00273651762865.issue41180@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25536 pull_request: https://github.com/python/cpython/pull/26972 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 13:29:43 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 30 Jun 2021 17:29:43 +0000 Subject: [issue44541] collections.abc.Sequence index implementation In-Reply-To: <1625070269.09.0.120970069586.issue44541@roundup.psfhosted.org> Message-ID: <1625074183.27.0.255987973589.issue44541@roundup.psfhosted.org> Ken Jin added the comment: Closing this issue since OP(Maciej) has marked it as "not a bug". ---------- nosy: +kj stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 13:52:32 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 17:52:32 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625075552.9.0.147793364343.issue41180@roundup.psfhosted.org> Steve Dower added the comment: New changeset a5764d3d96341441d3f70fb5c96a82610a3f4842 by Steve Dower in branch '3.10': bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26970) https://github.com/python/cpython/commit/a5764d3d96341441d3f70fb5c96a82610a3f4842 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 13:52:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 17:52:42 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625075562.76.0.336983804566.issue41180@roundup.psfhosted.org> Steve Dower added the comment: New changeset 863e3d5c7e037b24b8294b041ed7686b522973d8 by Steve Dower in branch '3.9': bpo-41180: Replace marshal code.__new__ audit event with marshal.load[s] and marshal.dumps (GH-26971) https://github.com/python/cpython/commit/863e3d5c7e037b24b8294b041ed7686b522973d8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 13:53:16 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 17:53:16 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625075596.62.0.0923525830535.issue41180@roundup.psfhosted.org> Steve Dower added the comment: New changeset 95919b0d2744adb87acf696ae1de905cf02a95a6 by Steve Dower in branch 'main': bpo-41180: Fixes documentation to specify correct event name and add versionchanged (GH-26972) https://github.com/python/cpython/commit/95919b0d2744adb87acf696ae1de905cf02a95a6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 14:32:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 30 Jun 2021 18:32:46 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625077966.37.0.371566185809.issue33140@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 6.0 -> 7.0 pull_requests: +25537 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/26973 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 14:33:25 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 30 Jun 2021 18:33:25 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625078005.21.0.330631828439.issue33140@roundup.psfhosted.org> Andrei Kulakov added the comment: Created the PR: https://github.com/python/cpython/pull/26973/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 14:59:25 2021 From: report at bugs.python.org (Michael Cuthbert) Date: Wed, 30 Jun 2021 18:59:25 +0000 Subject: [issue40066] Enum: modify __repr__, __str__; update docs In-Reply-To: <1585165738.23.0.618463548627.issue40066@roundup.psfhosted.org> Message-ID: <1625079565.35.0.037087993883.issue40066@roundup.psfhosted.org> Michael Cuthbert added the comment: It may be helpful for the enum module to come with transitional functions like "pre310_str()" "pre310_repr()" "pre310_flag_str()" etc. so that people who are writing doctests that need to function on both < 3.10 and 3.10+ can temporarily do a "Enum.__str__ = pre310_str" in their test suites (and of course restore it later) until <=3.9 is no longer supported. Otherwise everyone with doctest suites will be doing this ourselves. ---------- nosy: +mscuthbert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:02:57 2021 From: report at bugs.python.org (Kevin Mehall) Date: Wed, 30 Jun 2021 19:02:57 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1625079777.94.0.361438899596.issue42369@roundup.psfhosted.org> Change by Kevin Mehall : ---------- keywords: +patch nosy: +kevinmehall nosy_count: 5.0 -> 6.0 pull_requests: +25538 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26974 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:06:20 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 19:06:20 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625079980.3.0.274540751907.issue44535@roundup.psfhosted.org> Steve Dower added the comment: New changeset d3a95c1b6eacbbbd92c294744e7ed41932f3f63e by Steve Dower in branch 'main': bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962) https://github.com/python/cpython/commit/d3a95c1b6eacbbbd92c294744e7ed41932f3f63e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:06:26 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Jun 2021 19:06:26 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625079986.16.0.852892106393.issue44535@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25539 pull_request: https://github.com/python/cpython/pull/26975 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:06:38 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Jun 2021 19:06:38 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625079998.46.0.769767822502.issue44535@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25540 pull_request: https://github.com/python/cpython/pull/26976 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:13:56 2021 From: report at bugs.python.org (Kevin Mehall) Date: Wed, 30 Jun 2021 19:13:56 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1625080436.08.0.184860929195.issue42369@roundup.psfhosted.org> Kevin Mehall added the comment: I think I found the root cause of this problem and proposed a fix in https://github.com/python/cpython/pull/26974 To monkey-patch this fix on existing versions of Python, I'm using: class PatchedSharedFile(zipfile._SharedFile): def __init__(self, *args): super().__init__(*args) self.tell = lambda: self._pos zipfile._SharedFile = PatchedSharedFile ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:20:08 2021 From: report at bugs.python.org (Leif Walsh) Date: Wed, 30 Jun 2021 19:20:08 +0000 Subject: [issue43412] object.h -Wcast-qual warning In-Reply-To: <1614982361.61.0.858230879301.issue43412@roundup.psfhosted.org> Message-ID: <1625080808.73.0.545423328047.issue43412@roundup.psfhosted.org> Leif Walsh added the comment: Duplicated by https://bugs.python.org/issue44378, which has a fix merged. ---------- nosy: +leif.walsh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:24:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Jun 2021 19:24:50 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625081090.47.0.708856625867.issue44535@roundup.psfhosted.org> miss-islington added the comment: New changeset 6843a3b9300eb80c2bf5dac7dd363dae9e6f000d by Miss Islington (bot) in branch '3.10': bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962) https://github.com/python/cpython/commit/6843a3b9300eb80c2bf5dac7dd363dae9e6f000d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:31:12 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 30 Jun 2021 19:31:12 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625081472.25.0.264377644044.issue44535@roundup.psfhosted.org> miss-islington added the comment: New changeset 67e394562d67cbcd0ac8114e5439494e7645b8f5 by Miss Islington (bot) in branch '3.9': bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962) https://github.com/python/cpython/commit/67e394562d67cbcd0ac8114e5439494e7645b8f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:37:54 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 19:37:54 +0000 Subject: [issue41180] marshal load bypass code.__new__ audit event In-Reply-To: <1593586712.19.0.6550600191.issue41180@roundup.psfhosted.org> Message-ID: <1625081874.58.0.77308384532.issue41180@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:38:30 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 19:38:30 +0000 Subject: [issue44535] Cannot build in VS 2022 In-Reply-To: <1624970642.63.0.621346715913.issue44535@roundup.psfhosted.org> Message-ID: <1625081910.15.0.569530510892.issue44535@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 15:45:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 19:45:42 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625082342.86.0.437050139514.issue33140@roundup.psfhosted.org> Steve Dower added the comment: We can't delete the definition without going through a deprecation process, as it will break existing code with a new exception at the point of access rather than the point of use. At best, we can short-circuit those errors and raise them with a more appropriate description. For 3.11, we can deprecate the function on Windows and plan to remove it in 3.13. I don't see any problem with this, but it's a different change from PR 26973. ---------- versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 16:00:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 30 Jun 2021 20:00:47 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625083247.8.0.429477576794.issue33140@roundup.psfhosted.org> Andrei Kulakov added the comment: Steve: it seems to me that the goal of normal deprecation process is, given that a functionality is available and documented, prepare to find a replacement for it by some future version. In this case it's documented not to be available and doesn't work so this should perhaps fall under fixing a bug? It's true that this is backwards incompatible for the reason you pointed out (and I missed), but I think breaking compatibility is ok in new versions for bug fixes? (as long as it's added to "what's new", which I haven't done yet). If I'm wrong about this, I'll go ahead and make another PR for deprecation and close this one.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 16:08:04 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 30 Jun 2021 20:08:04 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625083684.92.0.228919375308.issue33140@roundup.psfhosted.org> Steve Dower added the comment: I agree that's theoretically how it should go, but we've had enough examples of undocumented/buggy behaviour where the fix was worse than the bug (to the point where we brought back an undocumented C field that was deprecated in 3.0 because removing it in 3.8 broke too many people). A couple of versions with a warning on will reduce the surprise. People are (slowly) learning that DeprecationWarnings matter, so I don't think it'll be wasted effort. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 16:14:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 30 Jun 2021 20:14:28 +0000 Subject: [issue33140] shutil.chown should not be defined in Windows In-Reply-To: <1522018536.28.0.467229070634.issue33140@psf.upfronthosting.co.za> Message-ID: <1625084068.58.0.536785836868.issue33140@roundup.psfhosted.org> Andrei Kulakov added the comment: Steve: makes sense, I closed the PR; thanks for looking at this and taking the time to explain! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 16:44:45 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Wed, 30 Jun 2021 20:44:45 +0000 Subject: [issue39846] Register .whl as a unpack format in shutil unpack In-Reply-To: <1583317455.42.0.20954925139.issue39846@roundup.psfhosted.org> Message-ID: <1625085885.17.0.764199264779.issue39846@roundup.psfhosted.org> Dominic Davis-Foster added the comment: I have run into this myself and was surprised unpack_archive didn't support wheels. I would like to see support added, and don't mind doing the work myself. That said, I can see there being an issue with the number of supported zip-based formats ballooning: Java JARs, Android APKs etc. However, wheels have a use case for easily extracting them -- that's how they're installed. I can't see a use case for being able to *easily* extract other formats. If there's no opposition I will start work on a PR. ---------- nosy: +domdfcoding versions: +Python 3.11 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 17:43:47 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 30 Jun 2021 21:43:47 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1625089427.83.0.85847736079.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Irit. Reviewing now... ---------- assignee: -> jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 18:53:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 30 Jun 2021 22:53:59 +0000 Subject: [issue44313] Generate LOAD_ATTR+CALL_FUNCTION instead of LOAD_METHOD+CALL_METHOD for imports In-Reply-To: <1622824398.73.0.627770754352.issue44313@roundup.psfhosted.org> Message-ID: <1625093639.68.0.0382567296724.issue44313@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 1b28187a0e3e914ee48de8032cbba0a965dd5563 by Batuhan Taskaya in branch 'main': bpo-44313: generate LOAD_ATTR/CALL_FUNCTION for top-level imported objects (GH-26677) https://github.com/python/cpython/commit/1b28187a0e3e914ee48de8032cbba0a965dd5563 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 20:05:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jul 2021 00:05:49 +0000 Subject: [issue43412] object.h -Wcast-qual warning In-Reply-To: <1614982361.61.0.858230879301.issue43412@roundup.psfhosted.org> Message-ID: <1625097949.73.0.980064207133.issue43412@roundup.psfhosted.org> STINNER Victor added the comment: > Duplicated by https://bugs.python.org/issue44378, which has a fix merged. Right. I close the issue as a duplicate. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Py_IS_TYPE(): cast discards ?const? qualifier from pointer target type _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 20:30:53 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jul 2021 00:30:53 +0000 Subject: [issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC In-Reply-To: <1624932178.77.0.0459304316784.issue44531@roundup.psfhosted.org> Message-ID: <1625099453.08.0.498390433701.issue44531@roundup.psfhosted.org> STINNER Victor added the comment: New changeset 818628c2da99ba0376313971816d472c65c9a9fc by Victor Stinner in branch 'main': bpo-44531: Add _PyType_AllocNoTrack() function (GH-26947) https://github.com/python/cpython/commit/818628c2da99ba0376313971816d472c65c9a9fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 20:35:18 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Jul 2021 00:35:18 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1625099718.53.0.490835849971.issue43425@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset c8979f780e4b7d6db5693cb26a2956cc785abb48 by Dong-hee Na in branch 'main': bpo-43425: Update _osx_support not to use distutils.log (GH-26968) https://github.com/python/cpython/commit/c8979f780e4b7d6db5693cb26a2956cc785abb48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 20:35:20 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Jul 2021 00:35:20 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1625099720.7.0.871592305461.issue43425@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25541 pull_request: https://github.com/python/cpython/pull/26978 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 21:06:56 2021 From: report at bugs.python.org (Samuel Henrique) Date: Thu, 01 Jul 2021 01:06:56 +0000 Subject: [issue32732] LoggingAdapter ignores extra kwargs of Logger#log() In-Reply-To: <1517423175.51.0.467229070634.issue32732@psf.upfronthosting.co.za> Message-ID: <1625101616.88.0.711252795907.issue32732@roundup.psfhosted.org> Samuel Henrique added the comment: Hello Vinay Sajip, I would like to kindly ask you to please reconsider and give your thoughts on my description of the issue here. Let me try to work based on your last reply: > ...has been around since Jan 2008, and it seems that no one in that time has raised this as a must-have This is a fair statement and it certainly shows that this is not a big enough issue for enough people to complain about. I believe it falls into the "papercut" category of issues and people just override the "process" method when they hit it. > 1. If you want to pass different kwargs in every time, use a logger. > 2. If you want to pass particular contextual information in which fits the "extra" parameter approach, use a LoggerAdapter. > 3. If that doesn't do it for you, subclass LoggerAdapter and implement what you need. We could improve the logging library by removing the limitation #1 with no apparent downsides, so please bear with me for my example below. > You haven't really explained why you need this to work in this particular way, so I suspect it could be an XY problem. So Steffen Schuldenzucker already provided an use case, I have one which is very similar and hopefully easily recognizable as a common (or at least not rare) usage pattern of logging: As a logging user, I would like to have a set of extra keys in the formatter, some required and some optional, such that I can make use of LoggerAdapter to set the constant extra values only once, and still pass the dynamic extra values on each "log" method. Pseudo code: # assume logger is a logger object with a formatter that allows for dynamic extra keys (dynamic = optional extra keys) adapted_logger = logging.LoggerAdapter(logger, extra={"invocation_id": "invocation_id_value"}) adapted_logger.info("test", extra={"resource_owner": "resource_owner_value"}) In this example I expect the log entry to contain both extra keys: "invocation_id" and "resource_owner". invocation_id is reused in every log entry but resource_owner changes based on what's being processed. For reference, this is an example of a Formatter which allows for dynamic extra keys and formats log entries to json serialized strings: class ExtraFormatter(logging.Formatter): """ Dynamically adds any extra key to a json-like output. """ def format(self, record: logging.LogRecord) -> str: default_attrs = vars( logging.LogRecord(None, None, None, None, None, None, None) ).keys() extras = set(record.__dict__.keys()) - set(default_attrs) log_items = {"message": "%(message)s"} for attr in extras: log_items[attr] = f"%({attr})s" format_str = json.dumps(log_items) self._style._fmt = format_str return super().format(record) The reason I believe this is a papercut type of issue is that I would expect the Formatter to control whether or not to show the extra key, not the LoggerAdapter. It is counter intuitive to me that the LoggerAdapter would silently drop any extra keys provided to the log methods, and I would expect that LoggerAdapter would at least not allow for the parameter to be passed then (I don't like this alternative either, but it removes the feeling of being tricked). Again, this is a problem that can easily be workaround-ed by overriding the "process" method. But there seems to be a very good opportunity to improve the Adapter instead and avoid letting other people hit this issue. I'm curious about your opinion on any downsides to this change as I couldn't come up with anything. There is also a problem with the current documentation, in which the LoggerAdapter doc led me (and other people, when we had to debug this issue) to believe the Adapter would not silently drop the extra parameters. The only place where this behavior is mentioned is in the logging-cookbook, in the following part: "Of course, if you had passed an ?extra? keyword argument in the call to the adapter, it will be silently overwritten." The "Of course" part is a little bit weird cause it implies it's an obvious behavior, whereas the sentence just before this one says: "The default implementation of this method leaves the message alone, but inserts an ?extra? key in the keyword argument whose value is the dict-like object passed to the constructor.". Note how it uses the word "inserts" instead of "overrides". So the documentation has to be updated, either to mention this behavior in the LoggerAdapter documentation or to remove the part about extra being silently overwritten in the cookbook, the only place this is mentioned (if this gets changed). I worked on a patch, with tests, before noticing this issue was open, so I'm gonna attach my patch to this message anyway. I also pushed the commit to my fork at https://github.com/samueloph/cpython/commit/a0c0e68db9adc405d65fd529a7e17c0c026a85af To summarize, I would like you to consider what's the downside of performing such a change and the papercut factor of this issue. Thank you. ---------- keywords: +patch nosy: +samueloph Added file: https://bugs.python.org/file50136/bpo-32732_logger_adapter.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 21:12:06 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jul 2021 01:12:06 +0000 Subject: [issue43770] Rework C types initialization In-Reply-To: <1617832102.18.0.477515294136.issue43770@roundup.psfhosted.org> Message-ID: <1625101926.14.0.468231939228.issue43770@roundup.psfhosted.org> STINNER Victor added the comment: New changeset dd3adc013b21ec1338bb5fea2e2c04a4fc650306 by Victor Stinner in branch 'main': bpo-43770: Cleanup _PyObject_GetMethod() (GH-26946) https://github.com/python/cpython/commit/dd3adc013b21ec1338bb5fea2e2c04a4fc650306 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jun 30 21:20:31 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 01 Jul 2021 01:20:31 +0000 Subject: [issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils In-Reply-To: <1615093629.58.0.305422387924.issue43425@roundup.psfhosted.org> Message-ID: <1625102431.29.0.792174154298.issue43425@roundup.psfhosted.org> miss-islington added the comment: New changeset 94a4136c8eba349dc7eebe561ddaedbd0a89eb91 by Miss Islington (bot) in branch '3.10': bpo-43425: Update _osx_support not to use distutils.log (GH-26968) https://github.com/python/cpython/commit/94a4136c8eba349dc7eebe561ddaedbd0a89eb91 ---------- _______________________________________ Python tracker _______________________________________