From report at bugs.python.org Thu Jul 1 00:31:09 2021 From: report at bugs.python.org (Savage Hood) Date: Thu, 01 Jul 2021 04:31:09 +0000 Subject: [issue37355] SSLSocket.read does a GIL round-trip for every 16KB TLS record In-Reply-To: <1561056169.29.0.814417679233.issue37355@roundup.psfhosted.org> Message-ID: <1625113869.13.0.670770938624.issue37355@roundup.psfhosted.org> Change by Savage Hood : ---------- assignee: -> christian.heimes components: +Installation, Interpreter Core, Library (Lib), Windows, XML, ctypes, email nosy: +barry, paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 02:54:55 2021 From: report at bugs.python.org (Thomas) Date: Thu, 01 Jul 2021 06:54:55 +0000 Subject: [issue42369] Reading ZipFile not thread-safe In-Reply-To: <1605524871.74.0.395089652548.issue42369@roundup.psfhosted.org> Message-ID: <1625122495.76.0.984588360182.issue42369@roundup.psfhosted.org> Thomas added the comment: The monkey patch works for me! Thank you very much! (I have only tested reading, not writing). However, the lock contention of Python's ZipFile is so bad that using multiple threads actually makes the code run _slower_ than single threaded code when reading a zip file with many small files. For this reason, I am not using ZipFile any longer. Instead, I have implemented a subset of the zip spec without locks, which gives me a speedup of over 2500 % for reading many small files compared to ZipFile. I think that the architecture of ZipFile should be reconsidered, but this exceeds the scope of this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 03:32:48 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 01 Jul 2021 07:32:48 +0000 Subject: [issue42514] Relocatable framework for macOS In-Reply-To: <1606760917.9.0.450918621788.issue42514@roundup.psfhosted.org> Message-ID: <1625124768.04.0.924646989338.issue42514@roundup.psfhosted.org> Ronald Oussoren added the comment: I guess Ned and I are the only core devs that would be vaguely interested in working on this. I have no active plans to work on this. Having a relocatable framework would be nice, but doing this in a way that maintains all functionality, esp. w.r.t. the Python executable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 03:39:54 2021 From: report at bugs.python.org (Floating Sunfish) Date: Thu, 01 Jul 2021 07:39:54 +0000 Subject: [issue44542] Python 3.9.6 Can't Find `coverage` Message-ID: <1625125194.46.0.647938973687.issue44542@roundup.psfhosted.org> New submission from Floating Sunfish : `coverage` does not work in Python 3.9.6 (but it does in Python 3.9.5). It doesn't seem bundled with 3.9.6 because you can install it with `pip` (which normally says that it's already installed and doesn't install anything). Note that `coverage.exe` and its variants are all present in "C:\Python39\Scripts." The error I get is: Fatal error in launcher: Unable to create process using '"c:\python39\python.exe" "C:\Python39\Scripts\coverage.exe" run --source=. -m unittest -f ': The system cannot find the file specified. ---------- messages: 396811 nosy: sunfishscans priority: normal severity: normal status: open title: Python 3.9.6 Can't Find `coverage` type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 03:48:16 2021 From: report at bugs.python.org (Floating Sunfish) Date: Thu, 01 Jul 2021 07:48:16 +0000 Subject: [issue44542] Python 3.9.6 Can't Find `coverage` In-Reply-To: <1625125194.46.0.647938973687.issue44542@roundup.psfhosted.org> Message-ID: <1625125696.91.0.0590567962451.issue44542@roundup.psfhosted.org> Floating Sunfish added the comment: Turns out my Python Launcher wasn't uninstalled properly. Uninstalling it and reinstalling Python 3.9.6 resolved the issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 03:53:42 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Jul 2021 07:53:42 +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: <1625126022.87.0.92828692253.issue44313@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 04:40:11 2021 From: report at bugs.python.org (Antoine Pitrou) Date: Thu, 01 Jul 2021 08:40:11 +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: <1625128811.57.0.225492725732.issue37355@roundup.psfhosted.org> Change by Antoine Pitrou : ---------- nosy: +Matthew Rocklin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 04:49:52 2021 From: report at bugs.python.org (Harry) Date: Thu, 01 Jul 2021 08:49:52 +0000 Subject: [issue44543] Remove depreciated logging.warn() method Message-ID: <1625129392.07.0.706475155996.issue44543@roundup.psfhosted.org> New submission from Harry : The logging.warn() method as an alias for logging.warning() is a mysterious function in the logging module, as far as I can tell it was depreciated the minute it was added, originally only added for backwards compatibility. Up until 3.3 it was undocumented, and after that it was Depreciated and was set to be removed in 3.4 (https://bugs.python.org/issue13235). At this point, I believe this function only serves to create confusion as an obscure alternative to logging.warning() and should probably be removed in 3.11. ---------- components: Library (Lib) messages: 396813 nosy: Harry-Lees priority: normal severity: normal status: open title: Remove depreciated logging.warn() method type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 05:04:09 2021 From: report at bugs.python.org (Yurii Karabas) Date: Thu, 01 Jul 2021 09:04:09 +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: <1625130249.67.0.92963553107.issue44490@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25542 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 06:11:21 2021 From: report at bugs.python.org (Christian Heimes) Date: Thu, 01 Jul 2021 10:11:21 +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: <1625134281.69.0.158137179162.issue37355@roundup.psfhosted.org> Change by Christian Heimes : ---------- assignee: christian.heimes -> components: -Installation, Interpreter Core, Library (Lib), Windows, XML, ctypes, email versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 09:14:07 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 01 Jul 2021 13:14:07 +0000 Subject: [issue43216] Removal of @asyncio.coroutine in Python 3.11 In-Reply-To: <1613234875.25.0.783359316655.issue43216@roundup.psfhosted.org> Message-ID: <1625145247.31.0.741603692306.issue43216@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a1092f62492a3fcd6195bea94eccf8d5a300acb1 by Illia Volochii in branch 'main': bpo-43216: Remove @asyncio.coroutine (GH-26369) https://github.com/python/cpython/commit/a1092f62492a3fcd6195bea94eccf8d5a300acb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 09:40:19 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 01 Jul 2021 13:40:19 +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: <1625146819.4.0.500346208677.issue43425@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25543 pull_request: https://github.com/python/cpython/pull/26981 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 10:46:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Jul 2021 14:46:57 +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: <1625150817.96.0.993338408827.issue43234@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset ddd5f36971e2ffe20cc3f4b408425c847d168646 by Illia Volochii in branch 'main': bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540) https://github.com/python/cpython/commit/ddd5f36971e2ffe20cc3f4b408425c847d168646 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 10:48:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Jul 2021 14:48:27 +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: <1625150907.71.0.248785624647.issue43234@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your contribution Illia. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 11:16:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 01 Jul 2021 15:16:23 +0000 Subject: [issue44543] Remove depreciated logging.warn() method In-Reply-To: <1625129392.07.0.706475155996.issue44543@roundup.psfhosted.org> Message-ID: <1625152583.2.0.109724785062.issue44543@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 12:20:03 2021 From: report at bugs.python.org (jakirkham) Date: Thu, 01 Jul 2021 16:20:03 +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: <1625156403.19.0.35139179989.issue37355@roundup.psfhosted.org> Change by jakirkham : ---------- nosy: +jakirkham _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 12:24:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 01 Jul 2021 16:24:19 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten Message-ID: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> New submission from Andrei Kulakov : https://docs.python.org/3.11/library/textwrap.html The 3 functions - wrap, fill, shorten -- have a signature like `(..., **kwargs)`, where kwargs are instance attrs of TextWrap. It would be better to list all possible args in the signature because: - more convenient for users rather than scrolling back and forth between description of the function and the list under TextWrap - the list under TextWrap is so long it doesn't fit on one screen. It would be great to have a compact list in the signature of these 3 functions - it's confusing -- at first sight, it seems like **kwargs will be taken in to be used by a subclass or maybe stored as attrs on the instance and not used, and it seems like arbitrary kwargs can be given. - the only reason it was done so, I guess, is that the list is long and unwieldy. But that's also the reason why the listing under TextWrap takes up more than a screenful and so more of an argument to have a compact list in the signature. - in case of fill, some args are a no-op, so they can be omitted from the signature, that will make it much easier to see all effective arguments. ---------- assignee: docs at python components: Documentation messages: 396817 nosy: andrei.avk, docs at python priority: normal severity: normal status: open title: Add full list of possible args to textwrap: wrap, fill, shorten type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 12:33:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 01 Jul 2021 16:33:12 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1625157192.08.0.478821664691.issue44544@roundup.psfhosted.org> Andrei Kulakov added the comment: Additionally, I think this issue contributes to likelihood of people running into https://bugs.python.org/issue43518 or similar issues with these 3 functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 12:41:13 2021 From: report at bugs.python.org (William Manley) Date: Thu, 01 Jul 2021 16:41:13 +0000 Subject: [issue13788] os.closerange optimization In-Reply-To: <1326601765.34.0.310008166629.issue13788@psf.upfronthosting.co.za> Message-ID: <1625157673.92.0.800185944586.issue13788@roundup.psfhosted.org> William Manley added the comment: Linux has a close_range syscall since v5.9 (Oct 2020): https://man7.org/linux/man-pages/man2/close_range.2.html ---------- nosy: +wmanley _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 13:18:36 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 01 Jul 2021 17:18:36 +0000 Subject: [issue44543] Remove depreciated logging.warn() method In-Reply-To: <1625129392.07.0.706475155996.issue44543@roundup.psfhosted.org> Message-ID: <1625159916.81.0.395110069976.issue44543@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25544 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26982 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 13:23:37 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 01 Jul 2021 17:23:37 +0000 Subject: [issue44543] Remove depreciated logging.warn() method In-Reply-To: <1625129392.07.0.706475155996.issue44543@roundup.psfhosted.org> Message-ID: <1625160217.79.0.373841550714.issue44543@roundup.psfhosted.org> Jack DeVries added the comment: I'm not sure if there will be interest in merging this PR since it hasn't happened in all this time, but then again we've been emitting deprecation warnings from these functions and methods for a *decade* now. If the decision at this point is still not to move forward with removal, we should just remove the deprecation warnings and document it as a supported and bona-fide alias. Should that be the case, I'll close the PR I just created and get started with that work instead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:22:31 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 01 Jul 2021 18:22:31 +0000 Subject: [issue43518] textwrap.shorten does not always respect word boundaries In-Reply-To: <1615911865.24.0.216349409983.issue43518@roundup.psfhosted.org> Message-ID: <1625163751.74.0.500286730944.issue43518@roundup.psfhosted.org> Andrei Kulakov added the comment: Also see https://bugs.python.org/issue44544 which I think will help users avoid this issue. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:30:28 2021 From: report at bugs.python.org (skoolbeep) Date: Thu, 01 Jul 2021 18:30:28 +0000 Subject: [issue44545] ASSESSMENT TOOLS Message-ID: <1625164228.87.0.934989407093.issue44545@roundup.psfhosted.org> New submission from skoolbeep : Online assessment tools are a necessary part of remote learning education. If the teachers and professors have a firm hold on a student?s learning graph, he can do wonders in life! ---------- messages: 396822 nosy: skoolbeep priority: normal severity: normal status: open title: ASSESSMENT TOOLS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:31:04 2021 From: report at bugs.python.org (Jonathan Schweder) Date: Thu, 01 Jul 2021 18:31:04 +0000 Subject: [issue34629] Python3 regression for urllib(2).urlopen(...).fp for chunked http responses In-Reply-To: <1536683769.28.0.0269046726804.issue34629@psf.upfronthosting.co.za> Message-ID: <1625164264.36.0.577882090588.issue34629@roundup.psfhosted.org> Jonathan Schweder added the comment: Hello @tkruse, I have made some research and found that when using the Chunked transfer encoding [1], each chunk is preceded by its size in bytes, something that really happen if you check the content of one downloaded file from the example you provided [2]. So far, I would say that this is not a bug, it is just how the transfer encoding works. [1]: https://en.wikipedia.org/wiki/Chunked_transfer_encoding [2]: https://gist.github.com/jaswdr/95b2adc519d986c00b17f6572d470f2a ---------- nosy: +jaswdr _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:32:18 2021 From: report at bugs.python.org (skoolbeep) Date: Thu, 01 Jul 2021 18:32:18 +0000 Subject: [issue44545] ASSESSMENT TOOLS In-Reply-To: <1625164228.87.0.934989407093.issue44545@roundup.psfhosted.org> Message-ID: <1625164338.46.0.11423510376.issue44545@roundup.psfhosted.org> skoolbeep added the comment: Online assessment tools are a necessary part of remote learning education. If the teachers and professors have a firm hold on a student?s learning graph, he can do wonders in life! https://www.skoolbeep.com/blog/conduct-online-assessments-effectively/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:36:08 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Jul 2021 18:36:08 +0000 Subject: [issue44545] spam In-Reply-To: <1625164228.87.0.934989407093.issue44545@roundup.psfhosted.org> Message-ID: <1625164568.14.0.304955875474.issue44545@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: -> resolved status: open -> closed title: ASSESSMENT TOOLS -> spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:36:18 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Jul 2021 18:36:18 +0000 Subject: [issue44545] spam In-Reply-To: <1625164228.87.0.934989407093.issue44545@roundup.psfhosted.org> Message-ID: <1625164578.53.0.362985335572.issue44545@roundup.psfhosted.org> Change by Mark Dickinson : ---------- Removed message: https://bugs.python.org/msg396824 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:38:31 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Jul 2021 18:38:31 +0000 Subject: [issue44545] spam Message-ID: <1625164711.16.0.209778244747.issue44545@roundup.psfhosted.org> Change by Mark Dickinson : ---------- Removed message: https://bugs.python.org/msg396822 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 14:45:50 2021 From: report at bugs.python.org (skoolbeep) Date: Thu, 01 Jul 2021 18:45:50 +0000 Subject: [issue44546] ASSESSMENT TOOLS Message-ID: <1625165150.78.0.86979593254.issue44546@roundup.psfhosted.org> New submission from skoolbeep : We all are familiar with the age-old algorithm where people emphasize on grades. Grades matter, but so does an understanding of the topic. Online assessment tools are a necessary part of remote learning education. If the teachers and professors have a firm hold on a student?s learning graph, he can do wonders in life! https://www.skoolbeep.com/blog/conduct-online-assessments-effectively/ ---------- messages: 396825 nosy: skoolbeep priority: normal severity: normal status: open title: ASSESSMENT TOOLS _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 15:00:34 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Jul 2021 19:00:34 +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: <1625166034.46.0.293454801095.issue44313@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25545 pull_request: https://github.com/python/cpython/pull/26983 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 15:01:26 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Jul 2021 19:01:26 +0000 Subject: [issue44546] spam In-Reply-To: <1625165150.78.0.86979593254.issue44546@roundup.psfhosted.org> Message-ID: <1625166086.96.0.908651870177.issue44546@roundup.psfhosted.org> Change by Mark Dickinson : ---------- stage: -> resolved status: open -> closed title: ASSESSMENT TOOLS -> spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 15:01:36 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 01 Jul 2021 19:01:36 +0000 Subject: [issue44546] spam Message-ID: <1625166096.54.0.608365369119.issue44546@roundup.psfhosted.org> Change by Mark Dickinson : ---------- Removed message: https://bugs.python.org/msg396825 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 15:25:38 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 01 Jul 2021 19:25:38 +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: <1625167538.37.0.288221082443.issue44313@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 0d7f61ddb074659d8c18c8f5ac86a6a18e41f9e5 by Batuhan Taskaya in branch 'main': bpo-44313: bump up magic (#26983) https://github.com/python/cpython/commit/0d7f61ddb074659d8c18c8f5ac86a6a18e41f9e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 15:52:28 2021 From: report at bugs.python.org (Michael Amrhein) Date: Thu, 01 Jul 2021 19:52:28 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. Message-ID: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> New submission from Michael Amrhein : While int, float, complex and Decimal implement __int__, Fraction does not. Thus, checking for typing.SupportsInt for fractions fails, although int() succeeds, because Fraction implements __trunc__. This looks inconsistent. Easiest fix seems to be: Fraction.__int__ = Fraction.__trunc__ ---------- components: Library (Lib) messages: 396827 nosy: mamrhein priority: normal severity: normal status: open title: fraction.Fraction does not implement __int__. type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 16:15:05 2021 From: report at bugs.python.org (Phil Soucheray) Date: Thu, 01 Jul 2021 20:15:05 +0000 Subject: [issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start` Message-ID: <1625170505.27.0.877381236302.issue44548@roundup.psfhosted.org> New submission from Phil Soucheray : After running `start` on an indeterminate Progressbar, it animates to one side, goes back to the other and then right before it reaches the end it disappears. I've attached a sample script below and a screen recording. This is running on macOS 11.3 and python 3.9.6 with the tkinter version that is packaged with the 3.9.6 installer. ``` from tkinter import * from tkinter.ttk import * import time window = Tk() window.title('Test') window.geometry('400x250+1000+300') pb = Progressbar(window, orient=HORIZONTAL, length=100, mode='indeterminate') pb.pack(expand=True) Button(window, text='Start', command=pb.start).pack() window.mainloop() ``` ---------- components: Tkinter files: Screen Recording 2021-07-01 at 1.11.26 PM.mov messages: 396828 nosy: souch3 priority: normal severity: normal status: open title: ttk Indeterminate Progressbar Not Animating Correctly After `start` type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50137/Screen Recording 2021-07-01 at 1.11.26 PM.mov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 17:10:29 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 01 Jul 2021 21:10:29 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625173829.88.0.316821531202.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +25546 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26984 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 17:40:21 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 01 Jul 2021 21:40:21 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1625175621.25.0.852301604904.issue43908@roundup.psfhosted.org> Erlend E. Aasland added the comment: In inherit_slots() in Objects/typeobject.c, Py_TPFLAGS_HAVE_VECTORCALL inheritance depends on if the base type is a heap type or not. This aligns with PEP 590[1]: Heap types never inherit the vectorcall protocol because that would not be safe (heap types can be changed dynamically). AFAICS, inherit_slots() should now use Py_TPFLAGS_IMMUTABLETYPE to decide if Py_TPFLAGS_HAVE_VECTORCALL can be inherited, and the PEP should be updated. - [1] https://www.python.org/dev/peps/pep-0590/#subclassing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 18:29:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 01 Jul 2021 22:29:51 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1625175621.25.0.852301604904.issue43908@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: +1-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 18:35:30 2021 From: report at bugs.python.org (Hubert Badocha) Date: Thu, 01 Jul 2021 22:35:30 +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: <1625178930.25.0.159073957329.issue39710@roundup.psfhosted.org> Change by Hubert Badocha : ---------- nosy: +badochov nosy_count: 9.0 -> 10.0 pull_requests: +25547 pull_request: https://github.com/python/cpython/pull/26985 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 18:50:16 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 01 Jul 2021 22:50:16 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1625179816.13.0.655163325836.issue44544@roundup.psfhosted.org> Andrei Kulakov added the comment: > - in case of fill, some args are a no-op, so they can be omitted from the signature, that will make it much easier to see all effective arguments. I was mistaken here, this applies to `shorten`, not to `fill` func. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 19:26:15 2021 From: report at bugs.python.org (Ned Deily) Date: Thu, 01 Jul 2021 23:26:15 +0000 Subject: [issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start` In-Reply-To: <1625170505.27.0.877381236302.issue44548@roundup.psfhosted.org> Message-ID: <1625181975.2.0.704749758539.issue44548@roundup.psfhosted.org> Ned Deily added the comment: I can reproduce this behavior when using the current default 3.9.x macOS installer which uses Tk 8.6.8. It appears to work correctly if you instead use the alternate 3.9.x macOS universal2 installer which bundles Tk 8.6.11. The universal2 variant will be the default for Python 3.10 and may likely become the default for a future 3.9.x release. See if it solves the problem for you. https://www.python.org/downloads/release/python-396/ ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 20:01:49 2021 From: report at bugs.python.org (Leif Walsh) Date: Fri, 02 Jul 2021 00:01:49 +0000 Subject: [issue27657] urlparse fails if the path is numeric In-Reply-To: <1469908637.82.0.696114480311.issue27657@psf.upfronthosting.co.za> Message-ID: <1625184109.86.0.816011151434.issue27657@roundup.psfhosted.org> Leif Walsh added the comment: I don't mean to reopen a can of worms, but this affects requests, which I reported to them here: https://github.com/psf/requests/issues/5855 ---------- nosy: +leif.walsh _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 20:14:42 2021 From: report at bugs.python.org (Phil Soucheray) Date: Fri, 02 Jul 2021 00:14:42 +0000 Subject: [issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start` In-Reply-To: <1625170505.27.0.877381236302.issue44548@roundup.psfhosted.org> Message-ID: <1625184882.0.0.0898098051374.issue44548@roundup.psfhosted.org> Phil Soucheray added the comment: It looks like that has done the trick. Is there an expected time when there won't be different installers? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 20:43:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 02 Jul 2021 00:43:19 +0000 Subject: [issue43518] textwrap.shorten does not always respect word boundaries In-Reply-To: <1615911865.24.0.216349409983.issue43518@roundup.psfhosted.org> Message-ID: <1625186599.28.0.581135816005.issue43518@roundup.psfhosted.org> Andrei Kulakov added the comment: Some observations: - Just to be clear (because annesylvie implied this is caused by exclamation marks), punctuation at the end of the word is not required to hit this bug: In [44]: shorten("hello universe", width=7, placeholder="") Out[44]: 'hello u' (so for example adding an option to break at the boundary of word/punctuation would not fix this issue) - It would be good to fix this because my guess would be most code using `shorten` does it with default value of break_long_words, and this issue is easy to miss in testing. - My guess is that the goal of shorten is to return a shortened (okay, this much is obvious :) ) but representative snapshot of the text. - A user might also expect that it's consistent with TextWrapper, since it's essentially a wrapper around TextWrapper :) Therefore if we make a backwards incompatible change, the following would be also nice to have, perhaps requiring a new arg: width=5 1. universe => unive 2. hi universe => hi 3. hi universe => hi un 4. universe => universe # allow longer if can't get width without breaking words #4 would be consistent with TextWrapper handling of `break_long_words=False` Some option (perhaps new arg?) should produce both #1 and #2, the idea being that we remove the Nth word if it doesn't fit, but break the 1st word so that there's still representation of text rather than a blank. #3 would be the existing `break_long_words=True`, respecting width but providing max possible representation. - Generally speaking, shortening into one line is somewhat different than splitting into multiple lines, so it results in awkwardness when shortening is done by splitting into lines and keeping the first line. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 21:37:56 2021 From: report at bugs.python.org (Jim Jewett) Date: Fri, 02 Jul 2021 01:37:56 +0000 Subject: [issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start` In-Reply-To: <1625170505.27.0.877381236302.issue44548@roundup.psfhosted.org> Message-ID: <1625189876.95.0.721109213785.issue44548@roundup.psfhosted.org> Jim Jewett added the comment: It sounds like the fix is a configuration change already included in the next version, so ... I think that counts as a fix. ---------- nosy: +Jim.Jewett resolution: -> fixed status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 21:41:57 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 02 Jul 2021 01:41:57 +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: <1625190117.82.0.376147576538.issue43425@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset a7e251b07aa5f1a858a3e791a30dea78e93ab728 by Dong-hee Na in branch 'main': bpo-43425: Update setup.py not to use distutils.log (GH-26969) https://github.com/python/cpython/commit/a7e251b07aa5f1a858a3e791a30dea78e93ab728 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 21:42:10 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 01:42:10 +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: <1625190130.98.0.38445584034.issue43425@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25548 pull_request: https://github.com/python/cpython/pull/26986 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 22:05:33 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 02:05:33 +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: <1625191533.35.0.192783352171.issue43425@roundup.psfhosted.org> miss-islington added the comment: New changeset 956f1fc89475f6c8252a9eb0689bcf0eb69c15ea by Miss Islington (bot) in branch '3.10': bpo-43425: Update setup.py not to use distutils.log (GH-26969) https://github.com/python/cpython/commit/956f1fc89475f6c8252a9eb0689bcf0eb69c15ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 22:12:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 02:12:42 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625191962.32.0.321547688935.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: I'm going to merge both PRs. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 22:25:52 2021 From: report at bugs.python.org (Josh Rosenberg) Date: Fri, 02 Jul 2021 02:25:52 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625192752.34.0.14779446758.issue44547@roundup.psfhosted.org> Josh Rosenberg added the comment: Seems like an equally reasonable solution would be to make class's with __trunc__ but not __int__ automatically generate a __int__ in terms of __trunc__ (similar to __str__ using __repr__ when the latter is defined but not the former). The inconsistency is in both methods existing, but having the equivalence implemented in int() rather than in the type (thereby making SupportsInt behave unexpectedly, even though it's 100% true that obj.__int__() would fail). ---------- nosy: +josh.r _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 22:43:29 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 02 Jul 2021 02:43:29 +0000 Subject: [issue44548] ttk Indeterminate Progressbar Not Animating Correctly After `start` In-Reply-To: <1625170505.27.0.877381236302.issue44548@roundup.psfhosted.org> Message-ID: <1625193809.01.0.8433149169.issue44548@roundup.psfhosted.org> Ned Deily added the comment: Phil, there are still some as yet unresolved differences between using Tk 8.6.8 and 8.6.11, both positive and negative, and there are a few differences between using the two variants under all conditions that we want to resolve. So, at the moment, we will continue to supply the two variants for 3.9.x bugfix releases with the traditional (non-universal2) variant remaining the default but that may change in the future. ---------- resolution: fixed -> third party stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 23:45:22 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 03:45:22 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625197522.92.0.0159369896382.issue30256@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 11.0 -> 12.0 pull_requests: +25549 pull_request: https://github.com/python/cpython/pull/26987 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 23:45:28 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 03:45:28 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625197528.38.0.0509338274484.issue30256@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25550 pull_request: https://github.com/python/cpython/pull/26988 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 23:45:33 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 03:45:33 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625197533.44.0.197923315595.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 85b920498b42c69185540ecc2f5c4907fd38d877 by finefoot in branch 'main': bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341) https://github.com/python/cpython/commit/85b920498b42c69185540ecc2f5c4907fd38d877 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 1 23:46:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 03:46:45 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625197605.99.0.508273228054.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: (The original PR was too stale to merge, so I just merged the combined PR and added a Co-Authored-By header.) Now doing the backports. ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 00:15:56 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 04:15:56 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625199356.22.0.19471726117.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 3ec3e0f83c34eda1ad89b731e68f4a22a5f39333 by Miss Islington (bot) in branch '3.10': bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341) (#26987) https://github.com/python/cpython/commit/3ec3e0f83c34eda1ad89b731e68f4a22a5f39333 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 00:20:46 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 04:20:46 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625199646.93.0.316809328382.issue30256@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25551 pull_request: https://github.com/python/cpython/pull/26989 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 00:35:46 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 04:35:46 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625200546.66.0.796464452752.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8aa45de6c6d84397b772bad7e032744010bbd456 by Miss Islington (bot) in branch '3.9': bpo-30256: Add manager_owned keyword arg to AutoProxy (GH-16341) (GH-26989) https://github.com/python/cpython/commit/8aa45de6c6d84397b772bad7e032744010bbd456 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 00:56:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 04:56:34 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625201794.89.0.291303373256.issue30256@roundup.psfhosted.org> Guido van Rossum added the comment: Merged and backported to 3.10, 3.9. Let's forget about 3.8 or earlier (Lukasz removed the needs-backport-to-3.8 and -3.7 labels from GH-16341 on May 4). I should note that landing this was not a great experience: - There's a closed PR with the fix and another PR with a confusing title that has the fix plus a test. - The discussion on the issue and on the PRs was confusing. There was mention of a segfault reported on StackOverflow (but later it seemed to be a false alarm about a different fix), and in this issue Martijn Pieters brings up the question of whether AutoProxy is even needed, which is quite irrelevant to the bugfix. - It's unclear from reading the code in the PR how the test relates to the fix. - Therefore I tried to verify that the test actually failed if I undid the fix. But I found that it's rather unclear how to run the multiprocessing tests (and just those). And once I figured it out, they take a *long* time to run (there's a bug about that too somewhere). - I tried to revive the original PR (to give credit to its author) but found that it can't be reopened because of the master->main branch rename. - The open PR had some failing required tests so I couldn't land it without closing and reopening. More waiting. Eventually the tests passed and I could merge. On to the backports. - One of the backport PRs randomly didn't seem to get some test statuses, so I tried to restart them by closing and reopening the PR -- only to find that miss islington deleted the branch as soon as I closed the PR, so I couldn't reopen it either. So I had to delete and re-add the "needs-backport-to-3.9" label to the main PR, and wait. - Oh, and somehow there's a codecov test that always fails (in one of the original PRs, Antoine says to ignore it), so the backports didn't get auto-merged, so I had to wait for the other tests to pass and manually merge. The one positive experience was Martijn Pieters' long explanation on StackOverflow of what went wrong and why this was the correct fix. (Maybe he elaborated a bit much on the monkeypatch. :-) This treatise gave me the confidence that the fix was correct (enough) and should be merged. Parting shot: IMO we should not have accepted multiprocessing into the stdlib. It is a very useful module, but very complex, and would have been better off as a third-party module, with a more focused crew of maintainers and a quicker release cycle. (Almost everyone who uses multiprocessing needs to install other packages anyway.) ---------- stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 03:25:46 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jul 2021 07:25:46 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625210746.1.0.536771008477.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: FWIW, there's some history here: there's a good reason that fractions.Fraction didn't originally implement __int__. Back in the Bad Old Days, many Python functions that expected an integer would accept anything whose type implemented __int__ instead, and call __int__ to get the required integer. For example: Python 3.7.10 (default, Jun 1 2021, 23:43:35) [Clang 11.0.3 (clang-1103.0.32.62)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> chr(Decimal("45.67")) '-' Effectively, __int__ was being used to mean two different things: (1) this value can be used as an integer, and (2) this value can be truncated to an integer. The solution was to introduce two new dedicated magic methods __index__ and __trunc__ for these two different meanings. See PEP 357 and PEP 3141 for some of the details. So adding __int__ to fractions.Fraction would have made things like `chr(Fraction("5/2"))` possible, too. The behaviour above is still present (with a deprecation warning) in Python 3.9, and `chr(Decimal("45.67"))` has only finally been made a TypeError in Python 3.10. We may now finally be in a state where ill-advised uses of __int__ in internal functions have all been deprecated and removed, so that it's safe to re-add __int__ methods. But still, this seems mostly like an issue with the typing library. What is typing.SupportsInt intended to indicate? That an object can be used _as_ an integer, or that an object can be _truncated_ to an integer? ---------- nosy: +mark.dickinson type: behavior -> enhancement versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 03:50:18 2021 From: report at bugs.python.org (=?utf-8?b?0J7Qu9C10LMg0JzQsNGB0LvQvg==?=) Date: Fri, 02 Jul 2021 07:50:18 +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: <1625212218.3.0.870669031257.issue44520@roundup.psfhosted.org> ???? ????? added the comment: What are the next actions? Do I need to do something or are we waiting for something? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 04:35:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Jul 2021 08:35:05 +0000 Subject: [issue43518] textwrap.shorten does not always respect word boundaries In-Reply-To: <1615911865.24.0.216349409983.issue43518@roundup.psfhosted.org> Message-ID: <1625214905.25.0.151655971163.issue43518@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- assignee: -> serhiy.storchaka versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 04:55:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 08:55:39 +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: <1625216139.01.0.9139425703.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: As I wrote on the PR, and again on this issue, a PR that makes a behavior change (like this one) is not complete without a unit test (which fails before the change and passes after the change, and can show what the bug being fixed is). You could add such a test. In this case, it is also not clear that the current behavior is a bug at all, and if it is then what the fix should be (you propose to map None to ''. But why not 'None'? Why not 'Mary had a little lamb'? I suggested to return None rather than some arbitrary string). You could explain why you think it's a bug and why you think '' is the correct return value. Once you do write the test and there is consensus that it is a bug and we agree what the fix should be, it should be some core dev's top priority to review and merge the PR (as opposed to reviewing and merging another PR). So you could push it forward by explaining why this bug is important. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 05:34:25 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 09:34:25 +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: <1625218465.88.0.847582722953.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: The documentation states that this function accepts bytes: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote_from_bytes None is not of type bytes, so raising a TypeError is not unreasonable. It would certainly be wrong to return any string. It could have returned None but that doesn't make a massive usability difference and it's not worth changing now. I propose to close this as 'not a bug'. ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 05:42:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 09:42:21 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625218941.79.0.135805921877.issue34798@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25552 pull_request: https://github.com/python/cpython/pull/26990 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 05:42:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 09:42:39 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625218959.72.0.701156436118.issue34798@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 943e77d42d3f84b581f32c05f1fc8c05366b8ed3 by Irit Katriel in branch 'main': bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru? (GH-26967) https://github.com/python/cpython/commit/943e77d42d3f84b581f32c05f1fc8c05366b8ed3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 05:46:31 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Fri, 02 Jul 2021 09:46:31 +0000 Subject: [issue43832] asyncio + multiprocessing = core dump in sem_trywait In-Reply-To: <1618329047.14.0.057176308941.issue43832@roundup.psfhosted.org> Message-ID: <1625219191.27.0.0446466171344.issue43832@roundup.psfhosted.org> Change by Andrew Svetlov : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 06:08:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 10:08:07 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625220487.68.0.750930303897.issue34798@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 42c26282a123d14591e1aa31107e566b302a19ac by Miss Islington (bot) in branch '3.10': bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru? (GH-26967) (GH-26990) https://github.com/python/cpython/commit/42c26282a123d14591e1aa31107e566b302a19ac ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 06:08:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 10:08:55 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625220535.4.0.611238559848.issue34798@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 Jul 2 06:08:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 10:08:48 +0000 Subject: [issue34798] pprint ignores the compact parameter for dicts In-Reply-To: <1537886741.82.0.545547206417.issue34798@psf.upfronthosting.co.za> Message-ID: <1625220528.12.0.495024638033.issue34798@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 06:46:07 2021 From: report at bugs.python.org (siddhartha shankar mahato) Date: Fri, 02 Jul 2021 10:46:07 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability Message-ID: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> New submission from siddhartha shankar mahato : Python (3.9.5 and 3.9.6 are using Bzip2 1.0.6 which has a known critical vulnerability. CVE-2019-12900 (BDSA-2019-1844) 9.8 Critical NVD CVE-2016-3189 (BDSA-2019-2036). Please upgrade the same to a stable version. ---------- components: Windows messages: 396853 nosy: paul.moore, s.s.mahato, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: BZip 1.0.6 Critical Vulnerability type: crash versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:03:54 2021 From: report at bugs.python.org (skoolbeep) Date: Fri, 02 Jul 2021 11:03:54 +0000 Subject: [issue44550] DIGITAL CLASSROOM Message-ID: <1625223834.82.0.0485428221389.issue44550@roundup.psfhosted.org> New submission from skoolbeep : A digital classroom setup can be defined as a learning environment created with the help of electronic devices that run on software programmes. https://www.skoolbeep.com/blog/what-makes-up-a-good-digital-classroom/ ---------- messages: 396854 nosy: skoolbeep priority: normal severity: normal status: open title: DIGITAL CLASSROOM _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:34:53 2021 From: report at bugs.python.org (=?utf-8?b?0J7Qu9C10LMg0JzQsNGB0LvQvg==?=) Date: Fri, 02 Jul 2021 11:34:53 +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: <1625225693.13.0.854095096443.issue44520@roundup.psfhosted.org> ???? ????? added the comment: If you pass None to the quote_from_bytes function, then there is no point in the "if not bs" check, because it won't even reach it. This function is not with dynamic behavior, which violates python concepts. If you pass a string instead of bytes, it will throw a TypeError exception, it's ok. But if for some reason you need to pass None, and this happens, then the function does not behave as expected. Why even check that bs is not None, if this can never be? And if it does, there will always be a TypeError exception. ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:42:01 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jul 2021 11:42:01 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625226121.04.0.567882853241.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: I'm actually struggling to think of situations where typing.SupportsInt would be useful in its current form: if I'm writing a function that wants to do a duck-typed acceptance of integer-like things (for example because I want my function to work with NumPy integers as well as plain old Python ints) then I want an __index__ check rather than an __int__ check. If I'm writing a function that allows general numeric inputs, then I'm not sure why I'd be calling 'int' on those inputs. As another data point, complex supporting __int__ is a little bit of an oddity, since all that __int__ method does is raise a TypeError. @Michael: are you in a position to share the use-case that motivated opening the issue? I'd be interested to see any concrete uses of typing.SupportsInt. Maybe typing.SupportsIndex (or typing.UsableAsInt, or ... --- naming things is hard) is what we actually need? On this particular issue: I'm not opposed to adding __int__ to fractions.Fraction purely for the sake of consistency, but it's not yet clear to me that it solves any real issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:42:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 11:42:31 +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: <1625226151.31.0.288175137333.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: There is still a point in the "if not bs:" check, it will be true for bs which is an empty string. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:44:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 11:44:52 +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: <1625226292.16.0.92632281281.issue44520@roundup.psfhosted.org> Change by Irit Katriel : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:44:49 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jul 2021 11:44:49 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625226289.39.0.781630657626.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: > Maybe typing.SupportsIndex Apologies: that already exists, of course. It was introduced in #36972. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:47:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 11:47:41 +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: <1625226461.81.0.527526856106.issue44520@roundup.psfhosted.org> Change by Irit Katriel : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:47:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 11:47:37 +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: <1625226457.18.0.721536865192.issue44520@roundup.psfhosted.org> Irit Katriel added the comment: I meant: ... it will be true for bs which is an empty bytes(). You are thinking of b'' and None as if they are the same thing. They are not. If this was a check for None it would be "if bs is None" and not "if not bs". ---------- status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:54:40 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jul 2021 11:54:40 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625226880.69.0.910606472147.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: > As another data point, complex supporting __int__ is a little bit of an oddity, since all that __int__ method does is raise a TypeError. This was fixed in 3.10: #41974 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 07:54:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 02 Jul 2021 11:54:38 +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: <1625226878.73.0.414771294763.issue44520@roundup.psfhosted.org> Eric V. Smith added the comment: I agree this should be closed (and I'm closing it). I don't see any reason why this function should do something other than raise TypeError if given bs=None. If you want that behavior, write a small wrapper function. The "if not bs" check appears to be an optimization for the case of zero-length input. Hopefully the code would continue to work without that test (or instead testing for len(bs)==0), but in my opinion it's not worth the risk of removing or changing it. ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 08:52:25 2021 From: report at bugs.python.org (user_0101) Date: Fri, 02 Jul 2021 12:52:25 +0000 Subject: [issue44551] Substraction: unprecise result Message-ID: <1625230345.07.0.72241721033.issue44551@roundup.psfhosted.org> New submission from user_0101 : ``` >>> 2.11-1.56 0.5499999999999998 ``` ---------- messages: 396862 nosy: user_0101 priority: normal severity: normal status: open title: Substraction: unprecise result versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 08:57:30 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 02 Jul 2021 12:57:30 +0000 Subject: [issue44551] Substraction: unprecise result In-Reply-To: <1625230345.07.0.72241721033.issue44551@roundup.psfhosted.org> Message-ID: <1625230650.47.0.912863143079.issue44551@roundup.psfhosted.org> Eric V. Smith added the comment: This is not a bug, but expected floating point behavior. See https://docs.python.org/3/tutorial/floatingpoint.html ---------- nosy: +eric.smith resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 09:17:45 2021 From: report at bugs.python.org (Sergey Fedoseev) Date: Fri, 02 Jul 2021 13:17:45 +0000 Subject: [issue39759] os.getenv documentation is misleading In-Reply-To: <1582717466.93.0.921378424861.issue39759@roundup.psfhosted.org> Message-ID: <1625231865.02.0.438880036817.issue39759@roundup.psfhosted.org> Change by Sergey Fedoseev : ---------- nosy: +sir-sigurd _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 09:26:04 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 02 Jul 2021 13:26:04 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1625232364.1.0.357438076665.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25553 pull_request: https://github.com/python/cpython/pull/26992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 09:36:09 2021 From: report at bugs.python.org (Michael Amrhein) Date: Fri, 02 Jul 2021 13:36:09 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625232969.57.0.273722007446.issue44547@roundup.psfhosted.org> Michael Amrhein added the comment: The background is an implementation of __pow__ for a fixed-point decimal number: SupportsIntOrFloat = Union[SupportsInt, SupportsFloat] def __pow__(self, other: SupportsIntOrFloat, mod: Any = None) -> Complex: if isinstance(other, SupportsInt): exp = int(other) if exp == other: ... handle integer exponent if isinstance(other, SupportsFloat): # fractional exponent => fallback to float return float(self) ** float(other) return NotImplemented I came across SupportsInt and SupportsFloat, because they are used in typeshed as param types for int and float. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 10:08:59 2021 From: report at bugs.python.org (Erik Carstensen) Date: Fri, 02 Jul 2021 14:08:59 +0000 Subject: [issue44552] incomplete documentation of __main__.py Message-ID: <1625234939.05.0.135731046929.issue44552@roundup.psfhosted.org> New submission from Erik Carstensen : I can find partial information on how Python treats __main__.py here: https://docs.python.org/3/library/__main__.html However, it is not documented how python handles __main__.py when passing the Python package to the interpreter without -m. If I have a program defined by /tmp/foo/bar.py and a file /tmp/foo/__main__.py, and I run python /tmp/foo ... then Python will run __main__.py, with /tmp/foo prepended to sys.path. I find this behaviour unfortunate; to me it would make more sense to prepend /tmp to sys.path, because then "python /tmp/foo" would be equivalent to "PYTHONPATH=/tmp python -m foo". With the current behaviour, if __main__.py wants to import bar.py, then it must write 'import bar' or 'import foo.bar' depending on whether the interpreter was invoked with -m. Unfortunately, by Hyrum's Law, you can find people describing and encouraging reliance upon the current undocumented behaviour, e.g.: https://www.geeksforgeeks.org/usage-of-__main__-py-in-python/ so perhaps the behaviour can't be changed that easily. Therefore, my request is to document how it works. ---------- assignee: docs at python components: Documentation messages: 396865 nosy: docs at python, mandolaerik priority: normal severity: normal status: open title: incomplete documentation of __main__.py type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 10:10:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 02 Jul 2021 14:10:15 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625235015.82.0.0945337396905.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 98eee94421dcb42c15f2d7fc4cd21357722fbe2a by Pablo Galindo in branch 'main': bpo-43950: Add code.co_positions (PEP 657) (GH-26955) https://github.com/python/cpython/commit/98eee94421dcb42c15f2d7fc4cd21357722fbe2a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 10:53:38 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 02 Jul 2021 14:53:38 +0000 Subject: [issue44553] types.Union should support GC Message-ID: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> New submission from Ken Jin : types.Union objects can contain reference cycles, therefore causing memory leaks. E.g.:: ``` import sys, gc from typing import TypeVar gc.collect() for _ in range(10): sys.gettotalrefcount() T = TypeVar('T') U = int | list[T] T.blah = U del T del U gc.collect() ``` Result: 84470 0 84488 0 84504 0 84520 0 84536 0 I'm sending a small PR soon to implement GC methods to fix this. ---------- messages: 396867 nosy: gvanrossum, kj priority: normal severity: normal status: open title: types.Union should support GC versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 10:56:41 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 02 Jul 2021 14:56:41 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625237801.37.0.53657558811.issue44553@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +25554 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26993 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 11:02:34 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Jul 2021 15:02:34 +0000 Subject: [issue44550] SPAM Message-ID: <1625238154.23.0.574628122187.issue44550@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- Removed message: https://bugs.python.org/msg396854 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 11:02:16 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 02 Jul 2021 15:02:16 +0000 Subject: [issue44550] SPAM In-Reply-To: <1625223834.82.0.0485428221389.issue44550@roundup.psfhosted.org> Message-ID: <1625238136.05.0.613955704107.issue44550@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed title: DIGITAL CLASSROOM -> SPAM _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 11:27:09 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 02 Jul 2021 15:27:09 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625239629.47.0.119165760909.issue30256@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 12.0 -> 13.0 pull_requests: +25555 pull_request: https://github.com/python/cpython/pull/26994 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 12:47:22 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 02 Jul 2021 16:47:22 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625244442.51.0.622248096908.issue44547@roundup.psfhosted.org> Mark Dickinson added the comment: Thanks, that's helpful. I guess what you _really_ want there is a duck-typed "tell me whether this value is integral and if so give me the corresponding Python int", but that's not currently easily available, so I suppose x == int(x) is the next-best thing. Possibly the "right" way from the point of view of PEP 3141 is to be testing x == math.trunc(x) instead and asking for typing.SupportsTrunc, but it seems to me that __trunc__ never did really take off the way it was intended to. tl;dr: I agree it would make sense to add __int__ to fractions.Fraction for 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 12:53:24 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 16:53:24 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625244804.91.0.660362582804.issue30256@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25556 pull_request: https://github.com/python/cpython/pull/26996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 12:53:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 16:53:34 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625244814.2.0.715091223181.issue30256@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 2560c612c89ea2534b90a266aabf76dc74d93a12 by Ken Jin in branch 'main': bpo-30256: [doc] Fix formatting error in news (GH-26994) https://github.com/python/cpython/commit/2560c612c89ea2534b90a266aabf76dc74d93a12 ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:34:09 2021 From: report at bugs.python.org (Oscar Benjamin) Date: Fri, 02 Jul 2021 17:34:09 +0000 Subject: [issue41311] Add a function to get a random sample from an iterable (reservoir sampling) In-Reply-To: <1594858231.04.0.366290640753.issue41311@roundup.psfhosted.org> Message-ID: <1625247249.94.0.12302361879.issue41311@roundup.psfhosted.org> Oscar Benjamin added the comment: I was contacted by someone interested in this so I've posted the last version above as a GitHub gist under the MIT license: https://gist.github.com/oscarbenjamin/4c1b977181f34414a425f68589e895d1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:34:38 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 02 Jul 2021 17:34:38 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625247278.96.0.0898647299241.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25557 pull_request: https://github.com/python/cpython/pull/26997 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:37:33 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 17:37:33 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625247453.01.0.731828911902.issue30256@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25558 pull_request: https://github.com/python/cpython/pull/26998 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:38:13 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 17:38:13 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625247493.61.0.189661451303.issue30256@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 91db097358bcb00832e53d410035a8b7fcfdd9c3 by Miss Islington (bot) in branch '3.9': bpo-30256: [doc] Fix formatting error in news (GH-26994) (GH-26996) https://github.com/python/cpython/commit/91db097358bcb00832e53d410035a8b7fcfdd9c3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:40:00 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 17:40:00 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1493812414.86.0.361870744934.issue30256@psf.upfronthosting.co.za> Message-ID: <1625247600.87.0.0879318527278.issue30256@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 7a2d2ed1330e464ac186c09501ef51b8261f4292 by Irit Katriel in branch '3.10': [3.10] bpo-30256: [doc] Fix formatting error in news (GH-26994) (GH-26998) https://github.com/python/cpython/commit/7a2d2ed1330e464ac186c09501ef51b8261f4292 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 13:57:02 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 02 Jul 2021 17:57:02 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1625248622.07.0.182680976595.issue44544@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25559 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 14:57:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 02 Jul 2021 18:57:39 +0000 Subject: [issue30256] Adding a SyncManager Queue proxy to a SyncManager dict or Namespace proxy raises an exception In-Reply-To: <1625247600.87.0.0879318527278.issue30256@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Oh no! Was there a test for this that I ignored? Thanks for cleaning up after me.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 15:04:34 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 19:04:34 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625252674.75.0.253302561665.issue43950@roundup.psfhosted.org> miss-islington added the comment: New changeset ec8759b060eff83ff466f42c5a96d83a685016ce by Batuhan Taskaya in branch 'main': bpo-43950: optimize column table assembling with pre-sizing object (GH-26997) https://github.com/python/cpython/commit/ec8759b060eff83ff466f42c5a96d83a685016ce ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:05:24 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 02 Jul 2021 20:05:24 +0000 Subject: [issue44552] incomplete documentation of __main__.py In-Reply-To: <1625234939.05.0.135731046929.issue44552@roundup.psfhosted.org> Message-ID: <1625256324.71.0.577240995327.issue44552@roundup.psfhosted.org> Jack DeVries added the comment: This is documented in Doc/library/runpy.rst. Specifically, here: > For a simple script, the specified code is simply executed in a fresh module namespace. For a valid sys.path entry (typically a zipfile or directory), the entry is first added to the beginning of sys.path. The function then looks for and executes a __main__ module using the updated path. Note that there is no special protection against invoking an existing __main__ entry located elsewhere on sys.path if there is no such module at the specified location. https://docs.python.org/3/library/runpy.html#runpy.run_path However, I fully agree that Doc/library/__main__.rst is severely lacking; that's why I've rewritten it! Please consider providing your feedback on the open PR, and see bpo-39452 https://github.com/python/cpython/pull/26883 Note that the new docs in __main__.rst does explicitly reference runpy, so once merged, it'll guide people looking for this information in __main__.rst to the right place. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:23:40 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 02 Jul 2021 20:23:40 +0000 Subject: [issue44534] unittest.mock.Mock.unsafe doc is garbled In-Reply-To: <1624968855.9.0.632630406188.issue44534@roundup.psfhosted.org> Message-ID: <1625257420.75.0.825970195224.issue44534@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 2.0 -> 3.0 pull_requests: +25560 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27000 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:33:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Jul 2021 20:33:50 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625258030.06.0.248626243627.issue44547@roundup.psfhosted.org> Serhiy Storchaka added the comment: In ideal world we would use __int__ for (1), and __trunc__ for (2). But for some historical reasons __index__ was introduced for (1) and __int__ is only used in the int constructor, although it falls back to __trunc__. I am wondering whether one of __int__ or __trunc__ should be deprecated. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:47:02 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 02 Jul 2021 20:47:02 +0000 Subject: [issue44554] pdb.main is unnecessarily complicated Message-ID: <1625258822.01.0.642754622025.issue44554@roundup.psfhosted.org> New submission from Jason R. Coombs : While investigating issue44461, I observed some complexities to the current pdb.main implementation, some of which likely contributed to the bug being present. - variables are initialized to defaults (https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1677-L1678) and then mutated (https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1684-L1686) based on other variables. - mainpyfile is conditionally mutated based on previous values of conditionally mutated variables (https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1696). - There are three different blocks of code (https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1690-L1691, https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1696-L1698, and https://github.com/python/cpython/blob/ec8759b060eff83ff466f42c5a96d83a685016ce/Lib/pdb.py#L1711) that are conditionally run based on run_as_module. These factors mean that all of these lines of code are entangled in ways that are somewhat difficult to reason about. For example, it's unclear what states have been achieved by the time `pdb._run*` is constructed, or what exceptions may or may not be expected for these calls. A functional or OO approach would limit the amount of mutation and entanglement (through encapsulation or scoping). An OO approach would have a protocol or interface that captures the different behaviors required prior to and on invocation of `Pdb._run*`. For example, the PDB "targets" (script or module) could be modeled as separate classes and provide symmetric interfaces with (possibly degenerate) equivalent operations for each use-case. To be sure, the code that's present is adequate and in my opinion right on the border of benefiting from a more rigorous abstraction. The current imperative approach is fairly readable and mostly comprehensible. It's only because of the surprise behavior in the reported issue that I propose to step back and contemplate ways to alleviate the concerns above. ---------- components: Library (Lib) messages: 396877 nosy: iritkatriel, jaraco priority: normal severity: normal status: open title: pdb.main is unnecessarily complicated versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:48:51 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 02 Jul 2021 20:48:51 +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: <1625258931.27.0.970592896983.issue44388@roundup.psfhosted.org> miss-islington added the comment: New changeset 4bcef2bb48b3fd82011a89c1c716421b789f1442 by Matthew Clapp in branch 'main': bpo-44388: Update venv EnvBuilder.ensure_directories() docs. (GH-26663) https://github.com/python/cpython/commit/4bcef2bb48b3fd82011a89c1c716421b789f1442 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 16:50:26 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 02 Jul 2021 20:50:26 +0000 Subject: [issue44554] pdb.main is unnecessarily complicated In-Reply-To: <1625258822.01.0.642754622025.issue44554@roundup.psfhosted.org> Message-ID: <1625259026.76.0.466910209714.issue44554@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25561 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26992 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 17:03:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 02 Jul 2021 21:03:40 +0000 Subject: [issue39759] os.getenv documentation is misleading In-Reply-To: <1582717466.93.0.921378424861.issue39759@roundup.psfhosted.org> Message-ID: <1625259820.47.0.675246438182.issue39759@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not so uncommon to write: foo_rate = float(os.getenv("FOO_RATE", default_foo_rate)) where default_foo_rate is float. In any case the default value for the default parameter is not a string. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 17:20:05 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Fri, 02 Jul 2021 21:20:05 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). Message-ID: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> New submission from Daniel Fleischman : The following code takes quadratic time on the size of the dictionary passed, regardless of the dictionary (explanation below): ``` def slow_dictionary(d): while len(d) > 0: # Remove first element key = next(iter(d)) del d[key] ``` The problem is that when an element is deleted a NULL/NULL placeholder is set in its place (https://github.com/python/cpython/blob/818628c2da99ba0376313971816d472c65c9a9fc/Objects/dictobject.c#L1534) and when we try to find the first element with `next(iter(d))` the code needs to skip over all the NULL elements until it finds the first non-NULL element (https://github.com/python/cpython/blob/818628c2da99ba0376313971816d472c65c9a9fc/Objects/dictobject.c#L1713). I'm not sure of what is the best way to fix it, but note that simply adding a field to the struct with the position of the first non-NULL element is not enough, since a code that always deletes the SECOND element of the dictionary would still have linear operations. An easy (but memory-wasteful) fix would be to augment the struct PyDictKeyEntry with the indices of the next/previous non empty elements, and augment _dictkeysobject with the index of the first and last non empty elements (in other words, maintain an underlying linked list of the non empty entries). With this we can always iterate in O(1) per entry. (I tested it only on version 3.9.2, but I would be surprised if it doesn't happen in other versions as well). ---------- components: Interpreter Core messages: 396880 nosy: danielfleischman priority: normal severity: normal status: open title: Dictionary operations are LINEAR for any dictionary (for a particular code). type: performance versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 17:44:17 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Fri, 02 Jul 2021 21:44:17 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625262257.34.0.629356267613.issue44555@roundup.psfhosted.org> Daniel Fleischman added the comment: The linked list solution is not as easy to implement as I expected, because of insertions. :( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 17:51:44 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 02 Jul 2021 21:51:44 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1625262704.82.0.56337285965.issue43908@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25562 pull_request: https://github.com/python/cpython/pull/27001 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 18:09:29 2021 From: report at bugs.python.org (Erik Carstensen) Date: Fri, 02 Jul 2021 22:09:29 +0000 Subject: [issue44552] incomplete documentation of __main__.py In-Reply-To: <1625234939.05.0.135731046929.issue44552@roundup.psfhosted.org> Message-ID: <1625263769.65.0.955133789556.issue44552@roundup.psfhosted.org> Erik Carstensen added the comment: thanks for the pointer and sorry for the noise! I'll review your text. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 19:10:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 02 Jul 2021 23:10:59 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625267459.01.0.540582676292.issue11343@roundup.psfhosted.org> Irit Katriel added the comment: The patch relates to the old parser. With the new parser the 100*(+100*) example works. If we go to 1000 instead of 100 we get "SyntaxError: too many nested parentheses". >From the discussion it seems that the idea of a new exception type for implementation-limits vs "real" SyntaxErrors was rejected as not useful. Is there anything left to do on this issue? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 20:29:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 03 Jul 2021 00:29:19 +0000 Subject: [issue43493] EmailMessage mis-folding headers of a certain length In-Reply-To: <1615754789.09.0.690251462615.issue43493@roundup.psfhosted.org> Message-ID: <1625272159.72.0.816104649038.issue43493@roundup.psfhosted.org> Andrei Kulakov added the comment: I've looked into this and it seems to be somewhat intentional, as can be seen in this test case for example: test_headerregistry.py", line 1725, in test_fold_address_list + To: "Theodore H. Perfect" , + "My address is very long because my name is long" , + "Only A. Friend" Relevant code is here: https://github.com/python/cpython/blob/main/Lib/email/_header_value_parser.py#L2829-L2849 The logic goes like this: tstr = header value - try to add it to current line, if fits; continue to start of loop - try to add it to next line, if fits; continue to start of loop - split tstr; continue to start of loop So as you can see from test case, if split happened before step 2, the name would be split over 2 lines which is not ideal. I tested splitting before step 2, which fixed this bug but failed 11 test cases, all of which deal with email address folding. (To and From headers). So, is this actually an issue worth fixing? If the answer is yes, one option would be to special case Subject header and split it before going to step 2. IOW, the block that starts here: https://github.com/python/cpython/blob/4bcef2bb48b3fd82011a89c1c716421b789f1442/Lib/email/_header_value_parser.py#L2835 would need to be moved after the next block that starts 6 lines below. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 21:27:44 2021 From: report at bugs.python.org (Zan) Date: Sat, 03 Jul 2021 01:27:44 +0000 Subject: [issue44556] ctypes unittest crashes with libffi 3.4.2 Message-ID: <1625275664.18.0.784580950779.issue44556@roundup.psfhosted.org> New submission from Zan : Running the unittests after upgrading libffi to latest version 3.4.2 and recompiling python, leads to several tests in Lib/ctypes/test/ to crash with Abort: trap 6. This does not happen with version 3.3 of libffi. Steps to reproduce: git clone https://github.com/libffi/libffi cd libffi autoreconf -fvi export CC=/usr/bin/clang ./configure make sudo make install # installs into /usr/local git clone https://github.com/python/CPython cd CPython export CC=/usr/bin/clang export CXX=/usr/bin/clang++ export CPPFLAGS="-I/usr/local/include" export LDFLAGS="-L/usr/local/lib" ./configure --with-system-ffi make ./python Lib/ctypes/test/__main__.py -v ... test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) ... Abort trap: 6 If I repeat the above steps with 'git checkout v3.3' in libffi, all tests in ctypes complete successfully. Tested with : - python 3.11 commit ec8759b0 (current master), also tried 3.8.11 - libffi 3.4.2 - macOS 11.4, Xcode 12.5.1 - MacBook Air, x86_64, Intel Sky Lake, i5-8210Y ---------- components: ctypes messages: 396885 nosy: zan priority: normal severity: normal status: open title: ctypes unittest crashes with libffi 3.4.2 type: crash versions: Python 3.11, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 23:10:42 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Jul 2021 03:10:42 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625281842.38.0.559397890339.issue44555@roundup.psfhosted.org> Dennis Sweeney added the comment: For what it's worth, using collections.OrderedDict gives constant-time behavior you're looking for. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 2 23:11:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 03 Jul 2021 03:11:32 +0000 Subject: [issue43336] document whether io.TextIOBase.readline(size>0) will always read the full newline In-Reply-To: <1614392137.45.0.448589201829.issue43336@roundup.psfhosted.org> Message-ID: <1625281892.25.0.801893129775.issue43336@roundup.psfhosted.org> Andrei Kulakov added the comment: I don't think it's incorrect right now, from the POV of internal data of the stream, there's 6 chars, from the POV of caller, 5 chars are read. So this can be interpreted as 2 chars are combined into 1 char read. On the other hand if TextIOBase was reading '\r' and letting caller process it and then reading '\n....' that would be of course a recipe to shoot the user in the foot, and would require a warning in big red letters in the docs. (Or even better fixing it to do what it does now.) ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 00:03:28 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Sat, 03 Jul 2021 04:03:28 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625281842.38.0.559397890339.issue44555@roundup.psfhosted.org> Message-ID: Daniel Fleischman added the comment: Thank you for your message! I'm not particularly looking for an implementation, I was just surprised by this behavior. It can get even worse. Consider this example: ``` d = large_dict() # remove all but one element of d, runs in quadratic time as explained above while len(d) > 1: del d[next(iter(d))] # now iterating over d takes O(d), even when d has only one item: # the following prints one key, but takes O(N) for key in d: print(key) ``` I think this example is better, since a person would expect iterating over a singleton dictionary would be really fast, but it can be made as slow as one wants. A "print_keys()" function would reasonably be expected to take O(size of dictionary), but it doesn't. Am I right to think that this is a performance bug? On Fri, Jul 2, 2021, 8:10 PM Dennis Sweeney wrote: > > Dennis Sweeney added the comment: > > For what it's worth, using collections.OrderedDict gives constant-time > behavior you're looking for. > > ---------- > nosy: +Dennis Sweeney > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 00:22:14 2021 From: report at bugs.python.org (skoolbeep) Date: Sat, 03 Jul 2021 04:22:14 +0000 Subject: [issue44550] DIGITAL CLASSROOM Message-ID: <1625286134.24.0.465111735159.issue44550@roundup.psfhosted.org> New submission from skoolbeep : A digital classroom setup can be defined as a learning environment created with the help of electronic devices that run on software programmes. This means technology sets the tone of a digital classroom and facilitates access to networks and learning resources https://www.skoolbeep.com/blog/what-makes-up-a-good-digital-classroom/ ---------- status: closed -> open title: SPAM -> DIGITAL CLASSROOM versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 01:44:23 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Sat, 03 Jul 2021 05:44:23 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625291063.42.0.456646649814.issue44555@roundup.psfhosted.org> Daniel Fleischman added the comment: Please find attached a more complete example of the issue I am reporting. tl;dr: I can make `sum(d.values())` run in O(maximum_size_in_d's_history) instead of O(len(d)), even when len(d) == 1. The linked list approach would work in terms of making it faster, but we would still be using too much space. ---------- Added file: https://bugs.python.org/file50138/bad_dict_example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 02:25:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 06:25:01 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625293501.24.0.00787518996669.issue44555@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +methane, rhettinger, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 02:29:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 06:29:55 +0000 Subject: [issue44550] DIGITAL CLASSROOM In-Reply-To: <1625286134.24.0.465111735159.issue44550@roundup.psfhosted.org> Message-ID: <1625293795.32.0.980163279534.issue44550@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 02:30:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 06:30:46 +0000 Subject: [issue44550] DIGITAL CLASSROOM Message-ID: <1625293846.81.0.0920276571542.issue44550@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg396889 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 03:25:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 03 Jul 2021 07:25:09 +0000 Subject: [issue44550] Spam Message-ID: <1625297109.25.0.905705061394.issue44550@roundup.psfhosted.org> Change by Mark Dickinson : ---------- title: DIGITAL CLASSROOM -> Spam _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 04:35:30 2021 From: report at bugs.python.org (Julien Palard) Date: Sat, 03 Jul 2021 08:35:30 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1625301330.89.0.0490965102489.issue42238@roundup.psfhosted.org> Julien Palard added the comment: New changeset 01331f1a3cf86fd308e9a134bb867bf01fb191f5 by Julien Palard in branch 'main': bpo-42238: rstlint: Add two new checks. (GH-26966) https://github.com/python/cpython/commit/01331f1a3cf86fd308e9a134bb867bf01fb191f5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 04:55:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Sat, 03 Jul 2021 08:55:04 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625302504.76.0.492278594678.issue44555@roundup.psfhosted.org> Inada Naoki added the comment: Can https://bugs.python.org/issue32623 be a fix (or mitigation) of this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 06:35:09 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Jul 2021 10:35:09 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625308509.78.0.315995142586.issue44555@roundup.psfhosted.org> Dennis Sweeney added the comment: > Can https://bugs.python.org/issue32623 be a fix (or mitigation) of this issue? If such a change is implemented and dictionaries shrink when their fill falls below 1/8, the behavior of `while d: del d[next(iter(d))]` will remain quadradic: there will be `ma_used - dk_size/8` (linear in len(d)) iterations of that loop that scan over half that many dummies on average. However, such a change could nonetheless speed up `while d: del d[next(iter(d))]` by a constant factor. As of now, the loop scans over roughly n**2/2 dummies. After that change, assuming the dict starts 1/3 full so the size is 3*n, there would be: (n - 3*n/8)**2 / 2 dummy scans before shrinking => 25/128 * n**2 scans which would leave 3*n/8 entries remaining, on which the same process would repeat. The total scans would be bounded by (25/128 * n**2) + (25/128 * (3*n/8)**2) + (25/128 * (9*n/64)**2)) + ... = 25/128 * n**2 * (1 + 9/64 + 81/4096 + ...) = 25/128 * n**2 / (1 - 9/64) = 25/128 * n**2 * (64 / 55) = 5/22 * n**2 ... just under half the number of dummies to scan. If we were to shrink slightly more aggressively, at a fill of 1/6, it would be something like: (n - 3*n/6)**2 / 2 dummy scans before shrinking => n**2 / 8 scans, leaving n/2 remaining The total would then be bounded by (n**2 / 8) + ((n/2)**2 / 8) + ((n/4)**2 / 8) + ... = n**2 / 8 * (1 + 1/4 + 1/16 + ...) = n**2 / 8 / (1 - 1/4) = n**2 / 8 * (4 / 3) = n**2 / 6 ... about one third of the number of dummies to scan. This ignores the linear overhead of actually doing the re-sizing, which would dominate on small tables, so maybe there could be some threshold below which there would be no shrinking, say 256 (dk_log2_size=8) or so. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 06:39:58 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Jul 2021 10:39:58 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625308798.45.0.649993961301.issue44555@roundup.psfhosted.org> Dennis Sweeney added the comment: Alternate idea: the dict could shrink, if required, on the iter() call, whenever a keys/values/items iterator is initialized. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 07:13:17 2021 From: report at bugs.python.org (ROpdebee) Date: Sat, 03 Jul 2021 11:13:17 +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: <1625310797.28.0.0735529552164.issue44490@roundup.psfhosted.org> ROpdebee added the comment: It also lacks the __module__ attribute, causing it to be unusable in PEP 593 typing.Annotated types: from typing import Annotated x: Annotated[int | str, 'test'] Traceback (most recent call last): File "", line 1, in File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 298, in inner return cached(*args, **kwds) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1594, in __class_getitem__ return _AnnotatedAlias(origin, metadata) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1520, in __init__ super().__init__(origin, origin) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 976, in __init__ self.__module__ = origin.__module__ AttributeError: 'types.Union' object has no attribute '__module__'. Did you mean: '__reduce__'? ---------- nosy: +ROpdebee _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 07:39:34 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 03 Jul 2021 11:39:34 +0000 Subject: [issue37195] test_utime fails on MacOS Mojave (Kernel Version 18.6.0:) In-Reply-To: <1559912694.09.0.24854010798.issue37195@roundup.psfhosted.org> Message-ID: <1625312374.04.0.484825222938.issue37195@roundup.psfhosted.org> Felipe Rodrigues added the comment: Hi all! I'm seeing the same error that @pablogsal saw here, but I'm on Linux Mint 20.1 x86_64 (Kernel 5.4.0-77): ./python -m test test_os -R : -v == CPython 3.11.0a0 (heads/pr_26964:d375c08c75, Jul 3 2021, 07:47:01) [GCC 9.3.0] == Linux-5.4.0-77-generic-x86_64-with-glibc2.31 little-endian == cwd: /home/fbidu/collab/cpython/build/test_python_276759? == CPU count: 8 == encodings: locale=UTF-8, FS=utf-8 0:00:00 load avg: 0.71 Run tests sequentially 0:00:00 load avg: 0.71 [1/1] test_os (...) ====================================================================== FAIL: test_utime (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 797, in test_utime self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_by_indexed (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 815, in test_utime_by_indexed self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_by_times (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 824, in test_utime_by_times self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_dir_fd (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 857, in test_utime_dir_fd self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_directory (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 863, in test_utime_directory self._test_utime(set_time, filename=self.dirname) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_fd (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 844, in test_utime_fd self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ====================================================================== FAIL: test_utime_nofollow_symlinks (test.test_os.UtimeTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 834, in test_utime_nofollow_symlinks self._test_utime(set_time) File "/home/fbidu/collab/cpython/Lib/test/test_os.py", line 785, in _test_utime self.assertAlmostEqual(st.st_atime, atime_ns * 1e-9, delta=1e-6) AssertionError: 1.0 != 1.002003 within 1e-06 delta (0.002002999999999977 difference) ---------------------------------------------------------------------- Ran 314 tests in 1.172s FAILED (failures=7, skipped=46) Additional info based on what as asked here originally: ./python -m test.pythoninfo Python debug information ======================== CC.version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Py_DEBUG: Yes (sys.gettotalrefcount() present) _decimal.__libmpdec_version__: 2.5.1 builtins.float.double_format: IEEE, little-endian builtins.float.float_format: IEEE, little-endian config[_config_init]: 2 config[_init_main]: 1 config[_install_importlib]: 1 config[_isolated_interpreter]: 0 config[argv]: ['-m'] config[base_exec_prefix]: '/usr/local' config[base_executable]: '/home/fbidu/collab/cpython/python' config[base_prefix]: '/usr/local' config[buffered_stdio]: 1 config[bytes_warning]: 0 config[check_hash_pycs_mode]: 'default' config[configure_c_stdio]: 1 config[dev_mode]: 0 config[dump_refs]: 0 config[exec_prefix]: '/usr/local' config[executable]: '/home/fbidu/collab/cpython/python' config[faulthandler]: 0 config[filesystem_encoding]: 'utf-8' config[filesystem_errors]: 'surrogateescape' config[hash_seed]: 0 config[home]: None config[import_time]: 0 config[inspect]: 0 config[install_signal_handlers]: 1 config[interactive]: 0 config[isolated]: 0 config[malloc_stats]: 0 config[module_search_paths]: ['/usr/local/lib/python311.zip', '/home/fbidu/collab/cpython/Lib', '/home/fbidu/collab/cpython/build/lib.linux-x86_64-3.11-pydebug'] config[module_search_paths_set]: 1 config[optimization_level]: 0 config[orig_argv]: ['./python', '-m', 'test.pythoninfo'] config[parse_argv]: 2 config[parser_debug]: 0 config[pathconfig_warnings]: 1 config[platlibdir]: 'lib' config[prefix]: '/usr/local' config[program_name]: './python' config[pycache_prefix]: None config[pythonpath_env]: None config[quiet]: 0 config[run_command]: None config[run_filename]: None config[run_module]: 'test.pythoninfo' config[show_ref_count]: 0 config[site_import]: 1 config[skip_source_first_line]: 0 config[stdio_encoding]: 'utf-8' config[stdio_errors]: 'strict' config[tracemalloc]: 0 config[use_environment]: 1 config[use_hash_seed]: 0 config[user_site_directory]: 1 config[verbose]: 0 config[warn_default_encoding]: 0 config[warnoptions]: [] config[write_bytecode]: 1 config[xoptions]: [] datetime.datetime.now: 2021-07-03 08:30:26.860600 expat.EXPAT_VERSION: expat_2.2.8 fips.openssl_fips_mode: 0 gdb_version: GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 global_config[Py_BytesWarningFlag]: 0 global_config[Py_DebugFlag]: 0 global_config[Py_DontWriteBytecodeFlag]: 0 global_config[Py_FileSystemDefaultEncodeErrors]: 'surrogateescape' global_config[Py_FileSystemDefaultEncoding]: 'utf-8' global_config[Py_FrozenFlag]: 0 global_config[Py_HasFileSystemDefaultEncoding]: 0 global_config[Py_HashRandomizationFlag]: 1 global_config[Py_IgnoreEnvironmentFlag]: 0 global_config[Py_InspectFlag]: 0 global_config[Py_InteractiveFlag]: 0 global_config[Py_IsolatedFlag]: 0 global_config[Py_NoSiteFlag]: 0 global_config[Py_NoUserSiteDirectory]: 0 global_config[Py_OptimizeFlag]: 0 global_config[Py_QuietFlag]: 0 global_config[Py_UTF8Mode]: 0 global_config[Py_UnbufferedStdioFlag]: 0 global_config[Py_VerboseFlag]: 0 global_config[_Py_HasFileSystemDefaultEncodeErrors]: 0 locale.encoding: UTF-8 os.cpu_count: 8 os.environ[DISPLAY]: :0 os.environ[HOME]: /home/fbidu os.environ[LANG]: pt_BR.UTF-8 os.environ[PATH]: /home/fbidu/.poetry/bin:/home/fbidu/.pyenv/shims:/home/fbidu/.pyenv/bin:/home/fbidu/.poetry/bin:/home/fbidu/bin:/usr/local/bin:/home/fbidu/.local/bin:/home/fbidu/.poetry/bin:/home/fbidu/.local/bin:/home/fbidu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/fbidu/n/bin os.environ[SHELL]: /usr/bin/zsh os.environ[TERM]: xterm-256color os.getcwd: /home/fbidu/collab/cpython os.getegid: 1000 os.geteuid: 1000 os.getgid: 1000 os.getgrouplist: 1000, 4, 24, 27, 30, 46, 114, 134, 999 os.getgroups: 4, 24, 27, 30, 46, 114, 134, 999, 1000 os.getloadavg: (1.13, 0.77, 0.98) os.getrandom: ready (initialized) os.getresgid: (1000, 1000, 1000) os.getresuid: (1000, 1000, 1000) os.getuid: 1000 os.login: fbidu os.name: posix os.supports_bytes_environ: True os.supports_effective_ids: ['access'] os.supports_fd: ['chdir', 'chmod', 'chown', 'execve', 'listdir', 'pathconf', 'scandir', 'stat', 'statvfs', 'truncate', 'utime'] os.supports_follow_symlinks: ['access', 'chown', 'link', 'stat', 'utime'] os.umask: 0o002 os.uname: posix.uname_result(sysname='Linux', nodename='bDesk', release='5.4.0-77-generic', version='#86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021', machine='x86_64') path_config[exec_prefix]: '/usr/local' path_config[home]: None path_config[module_search_path]: '/usr/local/lib/python311.zip:/home/fbidu/collab/cpython/Lib:/home/fbidu/collab/cpython/build/lib.linux-x86_64-3.11-pydebug' path_config[prefix]: '/usr/local' path_config[program_full_path]: '/home/fbidu/collab/cpython/python' path_config[program_name]: './python' platform.architecture: 64bit ELF platform.libc_ver: glibc 2.31 platform.platform: Linux-5.4.0-77-generic-x86_64-with-glibc2.31 platform.python_implementation: CPython pre_config[_config_init]: 2 pre_config[allocator]: 0 pre_config[coerce_c_locale]: 0 pre_config[coerce_c_locale_warn]: 0 pre_config[configure_locale]: 1 pre_config[dev_mode]: 0 pre_config[isolated]: 0 pre_config[parse_argv]: 1 pre_config[use_environment]: 1 pre_config[utf8_mode]: 0 pwd.getpwuid(1000): pwd.struct_passwd(pw_name='fbidu', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='F. Bidu,,,', pw_dir='/home/fbidu', pw_shell='/usr/bin/zsh') pymem.allocator: pymalloc_debug pymem.with_pymalloc: True readline._READLINE_LIBRARY_VERSION: 8.0 readline._READLINE_RUNTIME_VERSION: 0x800 readline._READLINE_VERSION: 0x800 resource.RLIMIT_AS: (-1, -1) resource.RLIMIT_CORE: (0, -1) resource.RLIMIT_CPU: (-1, -1) resource.RLIMIT_DATA: (-1, -1) resource.RLIMIT_FSIZE: (-1, -1) resource.RLIMIT_MEMLOCK: (67108864, 67108864) resource.RLIMIT_MSGQUEUE: (819200, 819200) resource.RLIMIT_NICE: (0, 0) resource.RLIMIT_NOFILE: (1024, 1048576) resource.RLIMIT_NPROC: (127802, 127802) resource.RLIMIT_OFILE: (1024, 1048576) resource.RLIMIT_RSS: (-1, -1) resource.RLIMIT_RTPRIO: (0, 0) resource.RLIMIT_RTTIME: (-1, -1) resource.RLIMIT_SIGPENDING: (127802, 127802) resource.RLIMIT_STACK: (8388608, -1) resource.pagesize: 4096 socket.hostname: bDesk sqlite3.sqlite_version: 3.31.1 sqlite3.version: 2.6.0 ssl.HAS_SNI: True ssl.OPENSSL_VERSION: OpenSSL 1.1.1f 31 Mar 2020 ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 6, 15) ssl.OP_ALL: 0x80000054 ssl.OP_NO_TLSv1_1: 0x10000000 ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED ssl.SSLContext.minimum_version: TLSv1_2 ssl.SSLContext.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT ssl.SSLContext.verify_mode: CERT_REQUIRED ssl.default_https_context.maximum_version: MAXIMUM_SUPPORTED ssl.default_https_context.minimum_version: TLSv1_2 ssl.default_https_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.default_https_context.protocol: PROTOCOL_TLS_CLIENT ssl.default_https_context.verify_mode: CERT_REQUIRED ssl.stdlib_context.maximum_version: MAXIMUM_SUPPORTED ssl.stdlib_context.minimum_version: TLSv1_2 ssl.stdlib_context.options: OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x80000054 ssl.stdlib_context.protocol: PROTOCOL_TLS_CLIENT ssl.stdlib_context.verify_mode: CERT_NONE subprocess._USE_POSIX_SPAWN: True sys.abiflags: d sys.api_version: 1013 sys.builtin_module_names: ('_abc', '_ast', '_codecs', '_collections', '_functools', '_imp', '_io', '_locale', '_operator', '_signal', '_sre', '_stat', '_string', '_symtable', '_thread', '_tracemalloc', '_warnings', '_weakref', 'atexit', 'builtins', 'errno', 'faulthandler', 'gc', 'itertools', 'marshal', 'posix', 'pwd', 'sys', 'time', 'xxsubtype') sys.byteorder: little sys.dont_write_bytecode: False sys.executable: /home/fbidu/collab/cpython/python sys.filesystem_encoding: utf-8/surrogateescape sys.flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0, dev_mode=False, utf8_mode=0, warn_default_encoding=0) sys.float_info: sys.float_info(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.220446049250313e-16, radix=2, rounds=1) sys.float_repr_style: short sys.hash_info: sys.hash_info(width=64, modulus=2305843009213693951, inf=314159, nan=0, imag=1000003, algorithm='siphash24', hash_bits=64, seed_bits=128, cutoff=0) sys.hexversion: 51052704 sys.implementation: namespace(name='cpython', cache_tag='cpython-311', version=sys.version_info(major=3, minor=11, micro=0, releaselevel='alpha', serial=0), hexversion=51052704, _multiarch='x86_64-linux-gnu') sys.int_info: sys.int_info(bits_per_digit=30, sizeof_digit=4) sys.maxsize: 9223372036854775807 sys.maxunicode: 1114111 sys.path: ['/home/fbidu/collab/cpython', '/usr/local/lib/python311.zip', '/home/fbidu/collab/cpython/Lib', '/home/fbidu/collab/cpython/build/lib.linux-x86_64-3.11-pydebug', '/home/fbidu/.local/lib/python3.11/site-packages'] sys.platform: linux sys.prefix: /usr/local sys.stderr.encoding: utf-8/backslashreplace sys.stdin.encoding: utf-8/strict sys.stdout.encoding: utf-8/strict sys.thread_info: sys.thread_info(name='pthread', lock='semaphore', version='NPTL 2.31') sys.version: 3.11.0a0 (heads/pr_26964:d375c08c75, Jul 3 2021, 07:47:01) [GCC 9.3.0] sys.version_info: sys.version_info(major=3, minor=11, micro=0, releaselevel='alpha', serial=0) sysconfig[ABIFLAGS]: d sysconfig[CCSHARED]: -fPIC sysconfig[CC]: gcc -pthread sysconfig[CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall sysconfig[CONFIG_ARGS]: '--with-pydebug' sysconfig[HOST_GNU_TYPE]: x86_64-pc-linux-gnu sysconfig[MACHDEP]: linux sysconfig[MULTIARCH]: x86_64-linux-gnu sysconfig[OPT]: -g -Og -Wall sysconfig[PY_CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall sysconfig[PY_CFLAGS_NODIST]: -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal sysconfig[PY_STDMODULE_CFLAGS]: -Wno-unused-result -Wsign-compare -g -Og -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include sysconfig[Py_DEBUG]: 1 sysconfig[Py_ENABLE_SHARED]: 0 sysconfig[SHELL]: /bin/sh sysconfig[SOABI]: cpython-311d-x86_64-linux-gnu sysconfig[prefix]: /usr/local test_socket.HAVE_SOCKET_ALG: True test_socket.HAVE_SOCKET_BLUETOOTH: False test_socket.HAVE_SOCKET_CAN: True test_socket.HAVE_SOCKET_CAN_ISOTP: False test_socket.HAVE_SOCKET_CAN_J1939: True test_socket.HAVE_SOCKET_QIPCRTR: False test_socket.HAVE_SOCKET_RDS: False test_socket.HAVE_SOCKET_UDPLITE: True test_socket.HAVE_SOCKET_VSOCK: False test_support._is_gui_available: True test_support.python_is_optimized: False time.altzone: 10800 time.daylight: 0 time.get_clock_info(monotonic): namespace(implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, adjustable=False, resolution=1e-09) time.get_clock_info(perf_counter): namespace(implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, adjustable=False, resolution=1e-09) time.get_clock_info(process_time): namespace(implementation='clock_gettime(CLOCK_PROCESS_CPUTIME_ID)', monotonic=True, adjustable=False, resolution=1e-09) time.get_clock_info(thread_time): namespace(implementation='clock_gettime(CLOCK_THREAD_CPUTIME_ID)', monotonic=True, adjustable=False, resolution=1e-09) time.get_clock_info(time): namespace(implementation='clock_gettime(CLOCK_REALTIME)', monotonic=False, adjustable=True, resolution=1e-09) time.time: 1625311826.9446275 time.timezone: 10800 time.tzname: ('-03', '-03') tkinter.TCL_VERSION: 8.6 tkinter.TK_VERSION: 8.6 tkinter.info_patchlevel: 8.6.10 zlib.ZLIB_RUNTIME_VERSION: 1.2.11 zlib.ZLIB_VERSION: 1.2.11 ./configure | grep utime checking utime.h usability... yes checking utime.h presence... yes checking for utime.h... yes ./configure: line 10499: PKG_PROG_PKG_CONFIG: command not found checking for futimesat... yes checking for futimens... yes checking for futimes... yes checking for lutimes... yes checking for utimensat... yes checking for utimes... yes I'm running this on an AMD Ryzen 3 3300X CPU. My storage is a NVMe "Samsung SSD 980 PRO". Also this is a fresh clone of the cpython repo, all I did was running a ./configure --with-pydebug, building it and then I went on to work on reviewing the patch for bpo-44539 ---------- nosy: +fbidu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 07:40:38 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 03 Jul 2021 11:40:38 +0000 Subject: [issue44539] Imghdr JPG Quantized In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1625312438.05.0.500243075028.issue44539@roundup.psfhosted.org> Change by Felipe Rodrigues : ---------- nosy: +fbidu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 08:12:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 12:12:15 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625314335.01.0.877778370218.issue44553@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 1097384ce964dd63686b1aac706cd0fa764c2dc9 by Ken Jin in branch 'main': bpo-44553 : Implement GC methods for types.Union (GH-26993) https://github.com/python/cpython/commit/1097384ce964dd63686b1aac706cd0fa764c2dc9 ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 08:12:27 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Jul 2021 12:12:27 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625314347.95.0.503335984404.issue44553@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25563 pull_request: https://github.com/python/cpython/pull/27002 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 08:51:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 12:51:37 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1625316697.74.0.00871054037907.issue44501@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am still not sure that it is worth to add 50 lines of the C code to optimize 0.7% of calls. You have found 70000 examples of function calls with 3 or 4 constant arguments. Does it include tests? Could you please show several (or several hundreds) non-test examples? I am wondering how much of them are in tight loops and are not just executed once at module initialization time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 09:29:26 2021 From: report at bugs.python.org (Matheus Oliveira) Date: Sat, 03 Jul 2021 13:29:26 +0000 Subject: [issue44557] It's a bug? Dict Message-ID: <1625318966.36.0.655841423385.issue44557@roundup.psfhosted.org> New submission from Matheus Oliveira : a = {"a":1} b = a a["a"]=33 print(b, a) # {"a":33}, {"a":33} ---------- components: Interpreter Core messages: 396899 nosy: ymatheus63 priority: normal severity: normal status: open title: It's a bug? Dict type: resource usage versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 09:33:50 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Jul 2021 13:33:50 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625319230.31.0.745092216166.issue44553@roundup.psfhosted.org> miss-islington added the comment: New changeset 0856134542c1067d02c9027ddbb2a61916907e92 by Miss Islington (bot) in branch '3.10': bpo-44553 : Implement GC methods for types.Union (GH-26993) https://github.com/python/cpython/commit/0856134542c1067d02c9027ddbb2a61916907e92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 09:35:57 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 03 Jul 2021 13:35:57 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625319357.93.0.995713129312.issue44553@roundup.psfhosted.org> Ken Jin added the comment: Thanks for the helpful review and merge Serhiy. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 09:56:40 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 03 Jul 2021 13:56:40 +0000 Subject: [issue44557] It's a bug? Dict In-Reply-To: <1625318966.36.0.655841423385.issue44557@roundup.psfhosted.org> Message-ID: <1625320600.35.0.53838588356.issue44557@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This is not a bug since in this case assignment is referring to the same object and thus mutating one variable reflects change in other variable. Relevant FAQ : https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 09:59:33 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 03 Jul 2021 13:59:33 +0000 Subject: [issue44557] It's a bug? Dict In-Reply-To: <1625318966.36.0.655841423385.issue44557@roundup.psfhosted.org> Message-ID: <1625320773.9.0.70730710312.issue44557@roundup.psfhosted.org> Steven D'Aprano added the comment: This is not a bug. Assignment in Python does not make a copy, it creates a second name for the same object. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 10:03:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 03 Jul 2021 14:03:34 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <1625321014.89.0.905910626733.issue39100@roundup.psfhosted.org> Andrei Kulakov added the comment: Anton: thanks for the report! In the message you say you are not sure of the solution, and because of that not sending a patch, but then you created the PR; - please clarify. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 10:03:05 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 03 Jul 2021 14:03:05 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1625320985.85.0.407131368555.issue44501@roundup.psfhosted.org> Batuhan Taskaya added the comment: > I am still not sure that it is worth to add 50 lines of the C code to optimize 0.7% of calls. As I stated, the reason that this is 'relatively' lower is that there are just too many calls, so it just allocates a rather small part of the total pie. > Does it include tests? Yes, to some extent (some packages include tests, some don't). > function calls with 3 or 4 constant arguments. Does it include tests? Could you please show several (or several hundreds) non-test examples? Here are 2 gists (attached together) that contain the locations where such function calls are performed within a loop (the first one contains your first query, 3 and 4 arguments and the second one contains 5+). I added an extra guard to check whether filename starts with test_ or not, so it should be generally free of tests (at least the ones that follow the general convention). I didn't deal with doing an extreme analysis, it just checks whether there call is made under any for/while's loop so there might be some false positives. https://gist.github.com/isidentical/8743aca3f7815cd19ee71579ca5ba974 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 10:36:05 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 14:36:05 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1625322965.78.0.662136995626.issue43443@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25564 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27004 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 10:38:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 14:38:10 +0000 Subject: [issue44129] zipfile: Add descriptive global variables for general purpose bit flags In-Reply-To: <1620968007.4.0.439932400929.issue44129@roundup.psfhosted.org> Message-ID: <1625323090.95.0.290427524083.issue44129@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 556d5ad11fb380868c19beeba53d49f89c27f32d by Daniel Hillier in branch 'main': bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118) https://github.com/python/cpython/commit/556d5ad11fb380868c19beeba53d49f89c27f32d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 10:39:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 14:39:18 +0000 Subject: [issue44129] zipfile: Add descriptive global variables for general purpose bit flags In-Reply-To: <1620968007.4.0.439932400929.issue44129@roundup.psfhosted.org> Message-ID: <1625323158.48.0.658745503692.issue44129@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your contribution Daniel. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:00:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 03 Jul 2021 15:00:50 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1625324450.14.0.469582087422.issue44501@roundup.psfhosted.org> Serhiy Storchaka added the comment: Great! Common examples are str.replace(), re.Match.groups() and __exit__(None, None, None). Common anti-patterns include slice(None, None, None) (why not slice(None)?) and datetime(1970, 1, 1) (it should be a global constant). I suspect that in most of other examples the function execution time is too large to make the optimization meaningful. BTW, why do you not fold 2-argument calls? It would add 2-argument str.replace() and str.split(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:14:12 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 03 Jul 2021 15:14:12 +0000 Subject: [issue44501] Packing constant call arguments In-Reply-To: <1624472022.52.0.0584361591595.issue44501@roundup.psfhosted.org> Message-ID: <1625325252.1.0.128727238899.issue44501@roundup.psfhosted.org> Batuhan Taskaya added the comment: > BTW, why do you not fold 2-argument calls? Seems like it is making stuff worse. > I suspect that in most of other examples the function execution time is too large to make the optimization meaningful. This is (to some extent) a constant folding pass, so I don't think it makes sense to expect it to optimize the general workload of the function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:30:56 2021 From: report at bugs.python.org (Jakub Wilk) Date: Sat, 03 Jul 2021 15:30:56 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1625326256.83.0.6338653001.issue35866@roundup.psfhosted.org> Jakub Wilk added the comment: I can no longer reproduce the bug with Python from git. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:33:50 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Jul 2021 15:33:50 +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: <1625326430.08.0.708259923454.issue34266@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25565 pull_request: https://github.com/python/cpython/pull/27005 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:33:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 15:33:44 +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: <1625326424.27.0.271054767391.issue34266@roundup.psfhosted.org> Irit Katriel added the comment: New changeset d968a638fcbf9030c999cfacd4c9bf0656e779c4 by Irit Katriel in branch 'main': bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) https://github.com/python/cpython/commit/d968a638fcbf9030c999cfacd4c9bf0656e779c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:44:12 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 15:44:12 +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: <1625327052.57.0.699325067505.issue34266@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25566 pull_request: https://github.com/python/cpython/pull/27006 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 11:47:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 15:47:07 +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: <1625327227.07.0.155361317287.issue34266@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 12:05:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 16:05:55 +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: <1625328355.16.0.0140834439752.issue34266@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 21be6cb0304ba143980b7e4c875cb5b9db30952b by Miss Islington (bot) in branch '3.9': bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27005) https://github.com/python/cpython/commit/21be6cb0304ba143980b7e4c875cb5b9db30952b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 12:28:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 16:28:54 +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: <1625329734.88.0.901691111277.issue34266@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 33022f9e86878c84c605de27aae4bd782ecb8da6 by Irit Katriel in branch '3.10': [3.10] bpo-34266: [pdb] handle ValueError from shlex.split() (GH-26656) (GH-27006) https://github.com/python/cpython/commit/33022f9e86878c84c605de27aae4bd782ecb8da6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 12:29:03 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 16:29:03 +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: <1625329743.22.0.651683723474.issue34266@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 12:32:32 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 03 Jul 2021 16:32:32 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1625329952.48.0.708617690642.issue44461@roundup.psfhosted.org> Irit Katriel added the comment: I've close PR26937 since we're not going for that. The test from it might still be useful, so I'm copying it here: def test_package_without_a_main(self): pkg_name = 't_pkg' module_name = 't_main' os_helper.rmtree(pkg_name) modpath = pkg_name + '/' + module_name os.makedirs(modpath) with open(modpath + '/__init__.py', 'w') as f: pass self.addCleanup(os_helper.rmtree, pkg_name) stdout, stderr = self._run_pdb(['-m', modpath.replace('/', '.')], "") self.assertIn( "'t_pkg.t_main' is a package and cannot be directly executed", stdout) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 12:44:46 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Sat, 03 Jul 2021 16:44:46 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625330685.99.0.159982141427.issue44555@roundup.psfhosted.org> Daniel Fleischman added the comment: I think the idea of augmenting the struts to maintain a linked list of elements together with periodically shrinking on removal would solve both time and space issues, right? Space will be always linear, and operations would still be constant amortized time (of course the worst case of removing will be linear because of the shrinking, but I guess this behavior is expected). I wrote a worse example in bad_dict_example.py submitted to this issue. This example would be fixed simply by the shrinking, but as is it's a pretty unexpected bug, as a simple sum(d.values()) can take milliseconds on a dictionary with only one entry (both key and value are int). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 13:03:18 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 03 Jul 2021 17:03:18 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625331798.62.0.478993460744.issue44555@roundup.psfhosted.org> Dennis Sweeney added the comment: OrderedDict already uses a linked list alongside a dictionary and meets all of your timing expectations, but has a higher memory usage, as linked lists generally do. Since so many Python objects use dictionaries under the hood, it would probably not be worth it to completely change the dict structure and the memory usage of Python as a whole to only benefit this uncommon case. See Objects/dictnotes.txt for the highest priority use cases of dicts. Per the OrderedDict docs, ordering is only secondary for dicts, but it's the focus for OrderedDicts. Just like you wouldn't send a list to do the job of a deque or vice versa, I don't think you should send an dict to do the job of an OrderedDict or vice versa. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 13:25:15 2021 From: report at bugs.python.org (Rupert Tombs) Date: Sat, 03 Jul 2021 17:25:15 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency Message-ID: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> New submission from Rupert Tombs : operator.countOf behaves differently in its docstring and its c and python implementations when `is` and `==` differ. help(countOf) -> countOf(a, b, /) Return the number of times b occurs in a. This could be read to say that it returns equal to `sum(x is b for x in a)`. Its python implementation returns `sum(x == b for x in a)`. Since its c implementation uses `PyObject_RichCompareBool`, it returns `sum(x is b or x == b for x in a)`. Results of these implementations can differ when `x is b` does not imply `x == b`; that could be from an __eq__ method, but the the float NaN is a real example since NaN != NaN. The issue is demonstrated with a possible fix here https://godbolt.org/z/cPT7TToG7 Since the c version has been in the wild for decades, I suggest that it should be taken to define the function; the python should be updated to match it, and the docstring could say "Return the number of items in a which are, or which equal, b." I will open a pull request with these changes shortly. ---------- assignee: docs at python components: Documentation, Library (Lib) messages: 396917 nosy: docs at python, rtombs priority: normal severity: normal status: open title: operator.countOf `is` / `==` inconsistency type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 13:25:23 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Sat, 03 Jul 2021 17:25:23 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625333123.6.0.395883377405.issue44555@roundup.psfhosted.org> Daniel Fleischman added the comment: Thank you again, Dennis. I would disagree with your conclusion for mainly 3 reasons: 1. The linked list proposal would increase the memory usage by 2 Py_ssize_t per entry, plus another 2 for the whole dictionary. I don't think this is an overwhelming amount of extra memory for Python, but of course it's open for discussion. Insertions and removals would become marginally slower (I'll try to measure it), membership wouldn't suffer, and iteration would become O(1) per element iterated on. 2. I think that this case is covered by "Dynamic Mappings" in the document you've linked to. 3. This is not about the ordering in ducts being first or second nature. Please read the example in bad_dict_example.py to see a bad case where hearing over a dict of size 1 can take milliseconds. I want to reiterate (pun not intended) that this is not a use case for me, but it surprised me that dictionaries display this behavior. It's not hard to imagine a real use case where it just happens that someone deletes elements from a dictionary in insertion order. Or that someone deletes all keys but the last inserted (in any order), resulting in a dictionary that takes way too long to iterate on. Thank you for the discussion. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 13:44:33 2021 From: report at bugs.python.org (Rupert Tombs) Date: Sat, 03 Jul 2021 17:44:33 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625334273.37.0.186814707099.issue44558@roundup.psfhosted.org> Change by Rupert Tombs : ---------- keywords: +patch pull_requests: +25567 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27007 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 14:01:04 2021 From: report at bugs.python.org (=?utf-8?b?R2VybcOhbiBNw6luZGV6IEJyYXZv?=) Date: Sat, 03 Jul 2021 18:01:04 +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: <1625335264.76.0.200794291228.issue41249@roundup.psfhosted.org> Germ?n M?ndez Bravo added the comment: The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, so that it can resolve the forward reference with the same globals as the ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass should then pass the dictionary?s module name to the annotations? forward references via the added `module`?s keyword argument in `typing._type_check()`. I can work in a pull request with this solution and discuss any potential problems. ---------- nosy: +Kronuz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 14:09:33 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 18:09:33 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625335773.18.0.0532981594705.issue44553@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This commits seems to have broken the tracerefs buildbots: https://buildbot.python.org/all/#/builders/484/builds/322 https://buildbot.python.org/all/#/builders/678/builds/127 Please, take a look at soon as possible, otherwise per the buildbot policy we will need to revert the commits to avoid masking other issues. ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 14:47:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 18:47:16 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625338036.92.0.392731169572.issue44553@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 15:04:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 19:04:46 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625339086.39.0.825723575605.issue44553@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25568 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27008 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 16:00:36 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 03 Jul 2021 20:00:36 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625342436.9.0.5017114169.issue44553@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25569 pull_request: https://github.com/python/cpython/pull/27009 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 16:00:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 20:00:55 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625342455.44.0.288481307802.issue44553@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset bc3961485639cc73de7c4c7eed1b56f3c74939bf by Pablo Galindo in branch 'main': bpo-44553: Correct failure in tp_new for the union object (GH-27008) https://github.com/python/cpython/commit/bc3961485639cc73de7c4c7eed1b56f3c74939bf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 16:07:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 20:07:19 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625342839.25.0.603614500207.issue44553@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 Jul 3 16:25:16 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 03 Jul 2021 20:25:16 +0000 Subject: [issue15373] copy.copy() does not properly copy os.environment In-Reply-To: <1342454937.95.0.386630033182.issue15373@psf.upfronthosting.co.za> Message-ID: <1625343916.71.0.97467803717.issue15373@roundup.psfhosted.org> Andrei Kulakov added the comment: I think it may be good to deprecate and discourage use of `os.environ.copy()`, and add a new method `os.environ.asdict()`. And possibly have `__copy__` raise an error pointing users to `os.environ.asdict()`. I'm not sure what to do about pickling. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 16:42:57 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sat, 03 Jul 2021 20:42:57 +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: <1625344977.55.0.793156378681.issue41249@roundup.psfhosted.org> Nils Kattenbeck added the comment: > The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, so that it can resolve the forward reference with the same globals as the ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass should then pass the dictionary?s module name to the annotations? forward references via the added `module`?s keyword argument in `typing._type_check()`. I can work in a pull request with this solution and discuss any potential problems. While this seems like a good solution I would still like to figure out why TypedDict do not preserve MRO. Because for now I have not found a reason nor did someone on the typing-sig mailinglist have a clue. Should there (no longer) be a reason for this then this problem has a trivial solution (just re-add the MRO and use that). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 16:51:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 20:51:17 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625345477.85.0.823801141699.issue44553@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 000b9e803a7ec067da0a43f9a3fec16f1078215a by Miss Islington (bot) in branch '3.10': bpo-44553: Correct failure in tp_new for the union object (GH-27008) (GH-27009) https://github.com/python/cpython/commit/000b9e803a7ec067da0a43f9a3fec16f1078215a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:44:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 03 Jul 2021 21:44:45 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625348685.45.0.674260348578.issue44553@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks for the fix, Pablo! Ken Jin, we learned something today! ---------- nosy: +Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:47:21 2021 From: report at bugs.python.org (=?utf-8?b?R2VybcOhbiBNw6luZGV6IEJyYXZv?=) Date: Sat, 03 Jul 2021 21:47:21 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1625344977.55.0.793156378681.issue41249@roundup.psfhosted.org> Message-ID: <456DB7C6-55CD-4329-AB6E-813D580F09E6@gmail.com> Germ?n M?ndez Bravo added the comment: Nils, unfortunately, fixing the MRO here won?t fix the issue because `TypedDict.__annotations__` in the class copies the annotations from the parent classes, and when the type evaluation is made, it?s made using the copied annotation found in the bottommost class (which is thus then expected to be a forward reference in the same module as the class that inherited them. This producing the exact same problem of missing type. The most likely reason for incomplete MRO is that `TypeDict` extends a class? `__annotations__` with all of it?s parent?s `__annotations__`, so the final class has the complete set of annotations of all of its parents, so having the full inheritance chain made less sense, after all the final dictionary class has all the annotations. > On Jul 3, 2021, at 13:43, Nils Kattenbeck wrote: > > ? > Nils Kattenbeck added the comment: > >> The way I fixed this is I added `__forward_module__` to `typing.ForwardRef`, so that it can resolve the forward reference with the same globals as the ones specified by the module in `__forward_module__`. `TypedDict`'s metaclass should then pass the dictionary?s module name to the annotations? forward references via the added `module`?s keyword argument in `typing._type_check()`. I can work in a pull request with this solution and discuss any potential problems. > > While this seems like a good solution I would still like to figure out why TypedDict do not preserve MRO. Because for now I have not found a reason nor did someone on the typing-sig mailinglist have a clue. Should there (no longer) be a reason for this then this problem has a trivial solution (just re-add the MRO and use that). > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:50:33 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sat, 03 Jul 2021 21:50:33 +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: <1625349033.91.0.786535863737.issue44530@roundup.psfhosted.org> Gabriele N Tornetta added the comment: @pablogsal Commit a0252ab9add7d48e9e0604ebf97342e46cf00419 exposes co_qualname to Python. I've added a test case to check that the result coincides with the current implementation of __qualname__. Is there a "standard" way for me to quantify the memory impact of these kinds of changes? @Mark.Shannon I'll look into making __qualname__ use __code__.co_qualname as a next step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:52:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jul 2021 21:52:31 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1625349151.64.0.914675330311.issue35866@roundup.psfhosted.org> Change by STINNER Victor : ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:52:49 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jul 2021 21:52:49 +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: <1625349169.75.0.0218861935148.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: Good news: this change fixed bpo-35866 "concurrent.futures deadlock". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 17:53:10 2021 From: report at bugs.python.org (STINNER Victor) Date: Sat, 03 Jul 2021 21:53:10 +0000 Subject: [issue35866] concurrent.futures deadlock In-Reply-To: <1548929111.09.0.517798780255.issue35866@roundup.psfhosted.org> Message-ID: <1625349190.56.0.404718959596.issue35866@roundup.psfhosted.org> STINNER Victor added the comment: Great! I close the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 18:03:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 22:03:05 +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: <1625349785.13.0.498127714335.issue44530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Is there a "standard" way for me to quantify the memory impact of these kinds of changes? That is a pointer size per code object. The most standard way is to calculate the size of all pyc files in the stdlib after compiling them all with "-m compileall -r 1000 Lib". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 18:10:25 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 03 Jul 2021 22:10:25 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625348685.45.0.674260348578.issue44553@roundup.psfhosted.org> Message-ID: Ken Jin added the comment: Woops, thanks for the quick fix Pablo. I'm guessing the takeaway here is that we should start tracking a GC-ed object as early as possible? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 18:35:33 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sat, 03 Jul 2021 22:35:33 +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: <1625351733.51.0.623375153866.issue44530@roundup.psfhosted.org> Gabriele N Tornetta added the comment: > That is a pointer size per code object. The most standard way is to calculate the size of all pyc files in the stdlib after compiling them all with "-m compileall -r 1000 Lib". This yields the following numbers between what was main when I branched off and the tip of my branch: # main (7569c0fe91): 25_059_438 bytes # bpo-445303-code-qualname (a0252ab9ad): 25_511_492 bytes So that seems to be about half a MB increase over 25 MB (about 2% relative increase). This is potentially just an interim result, as at first sight it looks like MAKE_FUNCTION could require one less argument (the qualname), which can now be taken from the code object. So not quite the final picture yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 18:43:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 03 Jul 2021 22:43:56 +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: <1625352236.77.0.677818045531.issue44530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > So that seems to be about half a MB increase over 25 MB (about 2% relative increase). I personally think that is acceptable, so I would be supportive of the patch but for context, many folks have indicated that they are worried about this size getting bigger during previous discussions, so we need to still think collectively :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 21:15:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 04 Jul 2021 01:15:32 +0000 Subject: [issue43418] FTPLib error when server returns byte message instead of string In-Reply-To: <1615037606.06.0.879407636626.issue43418@roundup.psfhosted.org> Message-ID: <1625361332.52.0.268530196531.issue43418@roundup.psfhosted.org> Andrei Kulakov added the comment: This is an issue with cowrie, I've commented on it here: https://github.com/cowrie/cowrie/issues/1394 . In short, cowrie overrides FTP class and opens `self.file` in binary mode. Various FTP methods will break or work incorrectly if `self.file` is in binary mode. This can be closed as not a bug. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 21:48:24 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 04 Jul 2021 01:48:24 +0000 Subject: [issue44559] Enum: revert to 3.9 Message-ID: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> New submission from Ethan Furman : >From the SC (was Re: Enum -- last call for comments on 3.10 changes) -------------------------------------------------------------------- > The Steering Council discussed this topic at our meeting yesterday. We have some > discomfort about the changes to Enum?s str and repr in Python 3.10, both in the > specific changes and in the way the changes were decided on. No knock on Ethan or > others who participated in those decisions, it?s just that to us, the changes > cumulatively feel like they need a more formal, centralized discussion to understand > all the issues in detail. > > While we?re stopping short of requiring it, the Steering Council strongly suggests that > for Python 3.10, the changes in Enum?s str and repr be reverted back to the Python 3.9 > behavior, and that a PEP be written for Python 3.11. The changes were primarily spurred both by the changes to re.RegexFlag and by unfortunate choices made in enum.Flag regarding aliases and iteration that were corrected. Unfortunately, it proved too difficult to revert the Flag repr() while keeping the corrections, so the entire enum module is being reverted to its 3.9 version. All the bug-fixes, performance improvements, and other enhancements will have to wait for 3.11. ---------- assignee: ethan.furman components: Library (Lib) messages: 396935 nosy: barry, brett.cannon, ethan.furman, pablogsal, twouters, willingc priority: release blocker severity: normal status: open title: Enum: revert to 3.9 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 21:53:28 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 04 Jul 2021 01:53:28 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1625363608.99.0.038627542601.issue44559@roundup.psfhosted.org> Change by Ethan Furman : ---------- keywords: +patch pull_requests: +25570 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27010 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 3 22:57:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 04 Jul 2021 02:57:21 +0000 Subject: [issue43474] http.server.BaseHTTPRequestHandler end_header() fails In-Reply-To: <1615460999.3.0.75730553286.issue43474@roundup.psfhosted.org> Message-ID: <1625367441.31.0.195404982197.issue43474@roundup.psfhosted.org> Andrei Kulakov added the comment: Why do you need to `end_headers()` before first doing `send_header()`? I guess the normal use should be: if headers: for h in headers: send_header(h) end_headers() ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 00:08:50 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 04 Jul 2021 04:08:50 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1625371730.26.0.148155197257.issue44559@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 9bf7c2d638a582af2444bc864feba13ab8957b68 by Ethan Furman in branch '3.10': [3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010) https://github.com/python/cpython/commit/9bf7c2d638a582af2444bc864feba13ab8957b68 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 00:09:31 2021 From: report at bugs.python.org (Ethan Furman) Date: Sun, 04 Jul 2021 04:09:31 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1625371771.92.0.254596492728.issue44559@roundup.psfhosted.org> Change by Ethan Furman : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 01:44:17 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 04 Jul 2021 05:44:17 +0000 Subject: [issue44553] types.Union should support GC In-Reply-To: <1625237618.48.0.776218166977.issue44553@roundup.psfhosted.org> Message-ID: <1625377457.05.0.591676694384.issue44553@roundup.psfhosted.org> Ken Jin added the comment: Oh I didn't see Pablo's message on the PR: > @Fidget-Spinner For next occasions, the problem with this is that PyObject_GC_Del cannot be called like that because it overrides a bunch of cleanups like the call to _Py_ForgetReference and other possible handling. Thanks for the explanation! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 04:32:11 2021 From: report at bugs.python.org (TommyLike Hu) Date: Sun, 04 Jul 2021 08:32:11 +0000 Subject: [issue44560] Unrecognized charset "eucgb2312_cn" in email header for many MUA Message-ID: <1625387531.16.0.849810673355.issue44560@roundup.psfhosted.org> New submission from TommyLike Hu : Email module is used for email message decode and encode, if the header content is gb2312 encoded for example "??", by design we would finally have a rfc-2047 encoded header as below: ``` =?eucgb2312_cn?b?1tDOxA==?= ``` the test script is as below: ``` from email import header, charset h = header.make_header([(str("??").encode("gb2312"), charset.Charset("gb2312"))]) print(h.encode()) ``` My question is why don't we use "gb2312" as the charset in rfc-2047 encoded string, considering the "eucgb2312_cn" is only python awareness. Thanks ---------- components: email messages: 396939 nosy: barry, r.david.murray, tommylikehu priority: normal severity: normal status: open title: Unrecognized charset "eucgb2312_cn" in email header for many MUA type: behavior versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 05:00:50 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 04 Jul 2021 09:00:50 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625389250.65.0.841185948639.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25571 pull_request: https://github.com/python/cpython/pull/27011 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 05:58:47 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Jul 2021 09:58:47 +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: <1625392727.19.0.879839712343.issue26724@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 06:11:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Jul 2021 10:11:27 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1625393487.25.0.655348444272.issue44473@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 06:19:44 2021 From: report at bugs.python.org (Gabriele N Tornetta) Date: Sun, 04 Jul 2021 10:19:44 +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: <1625393984.74.0.714971415654.issue44530@roundup.psfhosted.org> Gabriele N Tornetta added the comment: With commit 7a12d31a8c22cae7a9c1a2239a1bb54adee33622 the new figures are # main (7569c0fe91): 25_059_438 bytes # bpo-445303-code-qualname (7a12d31a8c): 25_089_917 bytes which is a 0.1% relative increase :). This is likely due to the fact that with the change MAKE_FUNCTION needs to pop one less value from the TOS, as the qualname now comes from the code object. I think the PR is now good for a first review. I think I'd need some help with the documentation sources. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 07:53:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 04 Jul 2021 11:53:16 +0000 Subject: [issue44560] Unrecognized charset "eucgb2312_cn" in email header for many MUA In-Reply-To: <1625387531.16.0.849810673355.issue44560@roundup.psfhosted.org> Message-ID: <1625399596.03.0.250761256965.issue44560@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 08:09:13 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 04 Jul 2021 12:09:13 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625400553.45.0.720913997501.issue44558@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10, serhiy.storchaka, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 08:17:47 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 04 Jul 2021 12:17:47 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625401067.63.0.494395786617.issue44558@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25572 pull_request: https://github.com/python/cpython/pull/27012 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 09:33:38 2021 From: report at bugs.python.org (Steven Hsu) Date: Sun, 04 Jul 2021 13:33:38 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation Message-ID: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> New submission from Steven Hsu : In https://github.com/python/cpython/blob/main/Doc/distributing/index.rst, there are three expired hyperlinks: .. _Project structure: \ https://packaging.python.org/tutorials/distributing-packages/ .. _Building and packaging the project: \ https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project .. _Uploading the project to the Python Packaging Index: \ https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi And it should be fixed in this way: .. _Project structure: \ https://packaging.python.org/tutorials/packaging-projects/#packaging-python-projects .. _Building and packaging the project: \ https://packaging.python.org/tutorials/packaging-projects/#creating-the-package-files .. _Uploading the project to the Python Packaging Index: \ https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives Thanks. ---------- assignee: docs at python components: Documentation files: index.rst messages: 396941 nosy: StevenHsuYL, docs at python priority: normal severity: normal status: open title: Some expired hyperlinks in Python documentation type: enhancement versions: Python 3.9 Added file: https://bugs.python.org/file50139/index.rst _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 09:40:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 04 Jul 2021 13:40:28 +0000 Subject: [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10 In-Reply-To: <1615324586.52.0.680787948676.issue43453@roundup.psfhosted.org> Message-ID: <1625406028.97.0.387172415739.issue43453@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25573 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27013 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 11:13:06 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 04 Jul 2021 15:13:06 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625411586.53.0.611711967625.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25574 pull_request: https://github.com/python/cpython/pull/27015 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 11:15:43 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 04 Jul 2021 15:15:43 +0000 Subject: [issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0 In-Reply-To: <1612019921.62.0.653210880281.issue43077@roundup.psfhosted.org> Message-ID: <1625411743.81.0.77219869616.issue43077@roundup.psfhosted.org> Jacob Walls added the comment: Presumably this can be closed. ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 11:18:35 2021 From: report at bugs.python.org (Jacob Walls) Date: Sun, 04 Jul 2021 15:18:35 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1625411915.8.0.585597338665.issue35277@roundup.psfhosted.org> Jacob Walls added the comment: Presumably this can be closed. ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 11:34:00 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 04 Jul 2021 15:34:00 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new Message-ID: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> New submission from Ken Jin : Ref: comment chain at https://github.com/python/cpython/pull/27008#discussion_r663450441. setup_ga fails only if PyTuple_Pack fails, which usually happens when Python is out of memory. The cleanup code for setup_ga shouldn't use PyObject_GC_DEL as mentioned in Pablo's comment above. I don't know how to add a test for out of memory, so I'll send a PR without test soon. ---------- messages: 396944 nosy: kj, pablogsal priority: normal severity: normal status: open title: types.GenericAlias should decref instead of using delete in tp_new versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 11:42:19 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 04 Jul 2021 15:42:19 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625413339.28.0.287554207738.issue44562@roundup.psfhosted.org> Change by Ken Jin : ---------- keywords: +patch pull_requests: +25575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27016 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:30:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 04 Jul 2021 16:30:45 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625416245.81.0.597208002488.issue44558@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:47:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 16:47:44 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625417264.4.0.136404343802.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d33943a6c368c2184e238019c63ac7a267da5594 by Ken Jin in branch 'main': bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) https://github.com/python/cpython/commit/d33943a6c368c2184e238019c63ac7a267da5594 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:49:12 2021 From: report at bugs.python.org (=?utf-8?b?R2VybcOhbiBNw6luZGV6IEJyYXZv?=) Date: Sun, 04 Jul 2021 16:49:12 +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: <1625417352.65.0.764681331887.issue41249@roundup.psfhosted.org> Change by Germ?n M?ndez Bravo : ---------- keywords: +patch pull_requests: +25576 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27017 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:49:59 2021 From: report at bugs.python.org (=?utf-8?b?R2VybcOhbiBNw6luZGV6IEJyYXZv?=) Date: Sun, 04 Jul 2021 16:49:59 +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: <1625417399.8.0.702341470559.issue41249@roundup.psfhosted.org> Germ?n M?ndez Bravo added the comment: I added a pull request with my fix here: https://github.com/python/cpython/pull/27017 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:54:01 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Jul 2021 16:54:01 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625417641.96.0.387925030745.issue44562@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25578 pull_request: https://github.com/python/cpython/pull/27019 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 12:53:56 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Jul 2021 16:53:56 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625417636.79.0.931366332035.issue44562@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25577 pull_request: https://github.com/python/cpython/pull/27018 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 13:53:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Jul 2021 17:53:59 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625421239.6.0.372212200898.issue44562@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is the same bug in ga_new(): tp_free is called directly. And is is correct to call deallocator for not initialized GenericAlias object? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 13:55:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 17:55:46 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625421346.58.0.865920905981.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4684a34c8d2a2ffac7b779edb4ba57f043783478 by Miss Islington (bot) in branch '3.9': bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) (GH-27018) https://github.com/python/cpython/commit/4684a34c8d2a2ffac7b779edb4ba57f043783478 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 13:55:42 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Jul 2021 17:55:42 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625421342.57.0.609362650408.issue44562@roundup.psfhosted.org> miss-islington added the comment: New changeset 68330b681a4b63cedad58fcfd1d9573209bad21d by Miss Islington (bot) in branch '3.10': bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) https://github.com/python/cpython/commit/68330b681a4b63cedad58fcfd1d9573209bad21d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 13:58:50 2021 From: report at bugs.python.org (Paul Moore) Date: Sun, 04 Jul 2021 17:58:50 +0000 Subject: [issue43077] Update bundled pip to 21.0.1 and setuptools to 52.0.0 In-Reply-To: <1612019921.62.0.653210880281.issue43077@roundup.psfhosted.org> Message-ID: <1625421530.96.0.798396082353.issue43077@roundup.psfhosted.org> Change by Paul Moore : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:02:31 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Jul 2021 18:02:31 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625421751.9.0.795490576911.issue43950@roundup.psfhosted.org> miss-islington added the comment: New changeset 44f91fc802a2b71312e9abd9e8e9dcbf02e8216d by Batuhan Taskaya in branch 'main': bpo-43950: use 0-indexed column offsets for bytecode positions (GH-27011) https://github.com/python/cpython/commit/44f91fc802a2b71312e9abd9e8e9dcbf02e8216d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:05:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 18:05:11 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625421911.82.0.837434840903.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > And is is correct to call deallocator for not initialized GenericAlias object? The correct thing to do is to call Py_DECREF so the object is properly unlinked and the other potential cleanups work. Calling the deallocator directly is almost always dangerous. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:11:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Jul 2021 18:11:14 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build Message-ID: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> New submission from Serhiy Storchaka : In tee.fromiterable() the non-initialized tee object can be deleted by without calling _Py_ForgetReference() in debug build. See also issue44553 and issue44562. The proposed PR rewrites the code so that it no longer need to delete not completely initialized tee object. ---------- components: Extension Modules messages: 396952 nosy: kj, pablogsal, rhettinger, serhiy.storchaka priority: normal severity: normal status: open title: Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:15:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Jul 2021 18:15:15 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625422515.62.0.383794418939.issue44563@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25579 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27020 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:19:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Jul 2021 18:19:00 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625422740.9.0.638618774777.issue44562@roundup.psfhosted.org> Serhiy Storchaka added the comment: But is alias->origin initialized to safely call Py_XDECREF(alias->origin)? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:28:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 18:28:51 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625423331.05.0.610379951754.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > But is alias->origin initialized to safely call Py_XDECREF(alias->origin)? Why would that be unsafe? PyType_GenericAlloc sets all fields to NULL so that is going to either be NULL or have an object, no? setup_ga only sets alias->origin if there has been no failures ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:47:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 04 Jul 2021 18:47:17 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625424437.91.0.775014598001.issue44562@roundup.psfhosted.org> Serhiy Storchaka added the comment: AFAIK PyType_GenericAlloc is used indirectly in ga_new(), but not in Py_GenericAlias(). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 14:53:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 18:53:36 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625424816.54.0.416375147663.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > AFAIK PyType_GenericAlloc is used indirectly in ga_new(), but not in Py_GenericAlias(). Oh, I see what you mean, that's a good point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:01:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 19:01:48 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625425308.34.0.970939489711.issue44562@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25580 pull_request: https://github.com/python/cpython/pull/27021 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:05:12 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 04 Jul 2021 19:05:12 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625425512.04.0.501800906943.issue43950@roundup.psfhosted.org> miss-islington added the comment: New changeset 693cec0e2dcafa393ed5cdaa606f8dc8e3876adf by Batuhan Taskaya in branch 'main': bpo-43950: include position in dis.Instruction (GH-27015) https://github.com/python/cpython/commit/693cec0e2dcafa393ed5cdaa606f8dc8e3876adf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:08:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 19:08:27 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625425707.12.0.00796222598907.issue44562@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25581 pull_request: https://github.com/python/cpython/pull/27022 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:08:55 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Jul 2021 19:08:55 +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: <1625425735.02.0.510873023457.issue36663@roundup.psfhosted.org> Irit Katriel added the comment: As mentioned above, I think this is redundant because the traceback is on exc_value.__traceback__. Closing as there was not reply to my question, but correct me if I misunderstood the issue. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:26:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 19:26:43 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625426803.04.0.457355338705.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fe847a62852c3baaec6c97a5e2e7b2e66732bdb8 by Pablo Galindo in branch '3.9': Revert "bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) (GH-27018)" (GH-27022) https://github.com/python/cpython/commit/fe847a62852c3baaec6c97a5e2e7b2e66732bdb8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:32:48 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 04 Jul 2021 19:32:48 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625427168.45.0.769572545982.issue43950@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +25582 pull_request: https://github.com/python/cpython/pull/27023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:32:55 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 04 Jul 2021 19:32:55 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625427175.14.0.337582571339.issue43950@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +25582, 25583, 25584 pull_request: https://github.com/python/cpython/pull/27023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:32:54 2021 From: report at bugs.python.org (Ammar Askar) Date: Sun, 04 Jul 2021 19:32:54 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625427174.92.0.703463921624.issue43950@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +25582, 25583 pull_request: https://github.com/python/cpython/pull/27023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 15:42:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Jul 2021 19:42:57 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1625427777.14.0.407673499576.issue36521@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +gvanrossum, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 16:59:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Sun, 04 Jul 2021 20:59:48 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1625432388.75.0.395461479283.issue44561@roundup.psfhosted.org> Irit Katriel added the comment: Thanks, do you mind creating a github PR to fix this? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 17:02:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 04 Jul 2021 21:02:20 +0000 Subject: [issue36521] Consider removing docstrings from co_consts in code objects In-Reply-To: <1554339855.64.0.463077014069.issue36521@roundup.psfhosted.org> Message-ID: <1625432540.79.0.703943846979.issue36521@roundup.psfhosted.org> Guido van Rossum added the comment: In 3.11 the code object will definitely change. We may well put the docstring in a dedicated attribute. ---------- nosy: +Guido.van.Rossum versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 19:14:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 04 Jul 2021 23:14:40 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625440480.31.0.25972659895.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5644c7b3ffd49bed58dc095be6e6148e0bb4431e by Ammar Askar in branch 'main': bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958) https://github.com/python/cpython/commit/5644c7b3ffd49bed58dc095be6e6148e0bb4431e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 20:19:38 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 05 Jul 2021 00:19:38 +0000 Subject: [issue13788] os.closerange optimization In-Reply-To: <1326601765.34.0.310008166629.issue13788@psf.upfronthosting.co.za> Message-ID: <1625444378.91.0.0119818515255.issue13788@roundup.psfhosted.org> Gregory P. Smith added the comment: Code needed in a modern patch: 1) Use the system call if compile time configure detected it may be available. (if we just use syscall() rather than a libc wrapper, a configure check may not be necessary, but various #ifdefs likely are) 2) If (1) produces an error saying it isn't available at runtime (ie: running on a kernel that doesn't support it, regardless of where we were built), fall back to another approach (3) 3) if iterating over /proc/$pid/fd works at runtime, use that; else (4) 4) the existing brute force code. ---------- stage: -> needs patch versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 21:10:51 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 05 Jul 2021 01:10:51 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1625447451.88.0.901458521051.issue41486@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset a9a69bb3ea1e6cf54513717212aaeae0d61b24ee by Ma Lin in branch 'main': bpo-41486: zlib uses an UINT32_MAX sliding window for the output buffer (GH-26143) https://github.com/python/cpython/commit/a9a69bb3ea1e6cf54513717212aaeae0d61b24ee ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 21:10:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 01:10:55 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1625447455.93.0.402503894146.issue41486@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25585 pull_request: https://github.com/python/cpython/pull/27025 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 21:33:03 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 01:33:03 +0000 Subject: [issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module In-Reply-To: <1596621344.28.0.22443935276.issue41486@roundup.psfhosted.org> Message-ID: <1625448783.8.0.43245507966.issue41486@roundup.psfhosted.org> miss-islington added the comment: New changeset 22bcc0768e0f7eda2ae4de63aef113b1ddb4ddef by Miss Islington (bot) in branch '3.10': bpo-41486: zlib uses an UINT32_MAX sliding window for the output buffer (GH-26143) https://github.com/python/cpython/commit/22bcc0768e0f7eda2ae4de63aef113b1ddb4ddef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 4 23:48:08 2021 From: report at bugs.python.org (Steven Hsu) Date: Mon, 05 Jul 2021 03:48:08 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1625456888.99.0.63729880443.issue44561@roundup.psfhosted.org> Change by Steven Hsu : ---------- keywords: +patch pull_requests: +25586 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27027 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 00:08:06 2021 From: report at bugs.python.org (Ma Lin) Date: Mon, 05 Jul 2021 04:08:06 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1625458086.87.0.673762080825.issue44549@roundup.psfhosted.org> Ma Lin added the comment: If you update python/cpython-source-deps, I can submit a simple PR to python/cpython. I want to submit a PR to python/cpython-source-deps, but I think it?s better for a credible person to do this. ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 00:24:06 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 05 Jul 2021 04:24:06 +0000 Subject: [issue44564] DeprecationWarning in test_enum over formatting Message-ID: <1625459046.43.0.477755678755.issue44564@roundup.psfhosted.org> New submission from Karthikeyan Singaravelan : It seems the line above this is wrapped under a block to check for deprecation warning but this line got missed out. PYTHONWARNINGS=always ./python.exe -Wall -m test test_enum 0:00:00 load avg: 3.91 Run tests sequentially 0:00:00 load avg: 3.91 [1/1] test_enum /Users/kasingar/stuff/python/cpython/Lib/test/test_enum.py:2324: DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an integer-based Enum, to maintain the current display self.assertEqual(OkayEnum.one, '{}'.format(OkayEnum.one)) == Tests result: SUCCESS == 1 test OK. Total duration: 257 ms Tests result: SUCCESS ---------- components: Library (Lib) keywords: newcomer friendly messages: 396967 nosy: ethan.furman, xtreak priority: normal severity: normal status: open title: DeprecationWarning in test_enum over formatting type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 00:33:42 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 05 Jul 2021 04:33:42 +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: <1625459622.11.0.0997744307121.issue38291@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This change seems to emit deprecation warnings in test_pydoc. PYTHONWARNINGS=always ./python.exe -Wall -m test test_pydoc 0:00:00 load avg: 2.57 Run tests sequentially 0:00:00 load avg: 2.57 [1/1] test_pydoc /Users/kasingar/stuff/python/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.io is deprecated, import directly from typing instead. typing.io will be removed in Python 3.12. if not cls.__name__.startswith("_") and cls.__module__ == "builtins"), /Users/kasingar/stuff/python/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.re is deprecated, import directly from typing instead. typing.re will be removed in Python 3.12. if not cls.__name__.startswith("_") and cls.__module__ == "builtins"), test_pydoc passed in 31.6 sec == Tests result: SUCCESS == 1 test OK. Total duration: 31.7 sec Tests result: SUCCESS ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 00:40:09 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 05 Jul 2021 04:40:09 +0000 Subject: [issue42889] Incorrect behavior after ast node visits In-Reply-To: <1610351139.91.0.540037450972.issue42889@roundup.psfhosted.org> Message-ID: <1625460009.8.0.140949947166.issue42889@roundup.psfhosted.org> Xinmeng Xia added the comment: This crash cannot be reproduced again on the master branch of CPython. It seems that this bug has been fixed. Should we close this issue and mark it as "fixed"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 00:50:10 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Mon, 05 Jul 2021 04:50:10 +0000 Subject: [issue42813] Extra spaces cause unexpected EOF error in "compile" function with mode "single" In-Reply-To: <1609662788.81.0.389452774776.issue42813@roundup.psfhosted.org> Message-ID: <1625460610.18.0.764595909232.issue42813@roundup.psfhosted.org> Xinmeng Xia added the comment: Program like following reports error on CPython(master branch), however this program can work well on PyPy. I think this is a bug in CPython ============================== string =""" if 1: print("hello") """ compile(string, "", "single") ============================== Traceback (most recent call last): File "/home/xxm/Desktop/IFuzzer/test/test1.py", line 304, in compile(string, "", "single") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 4 SyntaxError: unexpected EOF while parsing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 02:52:45 2021 From: report at bugs.python.org (Chris Withers) Date: Mon, 05 Jul 2021 06:52:45 +0000 Subject: [issue44534] unittest.mock.Mock.unsafe doc is garbled In-Reply-To: <1624968855.9.0.632630406188.issue44534@roundup.psfhosted.org> Message-ID: <1625467965.72.0.423850229151.issue44534@roundup.psfhosted.org> Chris Withers added the comment: New changeset abb08e3af6aa19928007a349592e95e6de38467f by Jack DeVries in branch 'main': bpo-44534: fix wording and docstring sync in unittest.Mock GH27000 https://github.com/python/cpython/commit/abb08e3af6aa19928007a349592e95e6de38467f ---------- nosy: +cjw296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 04:01:18 2021 From: report at bugs.python.org (Florian Bruhin) Date: Mon, 05 Jul 2021 08:01:18 +0000 Subject: [issue43248] platform.libc_ver() returns no information on Alpine Linux In-Reply-To: <1613646818.72.0.219281463951.issue43248@roundup.psfhosted.org> Message-ID: <1625472078.54.0.218449412445.issue43248@roundup.psfhosted.org> Change by Florian Bruhin : ---------- nosy: +The Compiler _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 04:23:54 2021 From: report at bugs.python.org (Inada Naoki) Date: Mon, 05 Jul 2021 08:23:54 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625473434.72.0.678414929805.issue44555@roundup.psfhosted.org> Inada Naoki added the comment: iterating whole over the dict is O(n) where n is the historical max size of the dict. On the other hand, there are no guarantee about `next(iter(d))` is O(1). The guarantee is O(n) at worst case. And your example is the worst case. So this is not a bug. As Dennis wrote, we won't add doubly linked list to the dict only for this purpose. OrderedDict is for the use case. I don't have any better idea than bpo-32623. More ideas are welcome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 04:31:57 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 05 Jul 2021 08:31:57 +0000 Subject: [issue41676] asyncio.Event.wait broken link from asyncio.Event In-Reply-To: <1598882077.33.0.587005753181.issue41676@roundup.psfhosted.org> Message-ID: <1625473917.84.0.36424022575.issue41676@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Asyncio Event Documentation Links Incorrect _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 04:52:50 2021 From: report at bugs.python.org (STINNER Victor) Date: Mon, 05 Jul 2021 08:52:50 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625475170.36.0.290233336525.issue44562@roundup.psfhosted.org> STINNER Victor added the comment: > Revert "bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) (GH-27018)" (GH-27022) That's a good idea :-) The reverted commit caused many segfaults on macOS: https://buildbot.python.org/all/#/builders/108/builds/122 4 tests failed: test_cmd_line_script test_multiprocessing_main_handling test_tarfile test_trace ---------- nosy: +vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:03:33 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 05 Jul 2021 09:03:33 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625475813.77.0.14191975791.issue44562@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25587 pull_request: https://github.com/python/cpython/pull/27028 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:04:40 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 05 Jul 2021 09:04:40 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625475880.63.0.903676640143.issue44558@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 09302405d22e86884d6058226790c0cdf5b72f14 by Dong-hee Na in branch 'main': bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012) https://github.com/python/cpython/commit/09302405d22e86884d6058226790c0cdf5b72f14 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:04:57 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 05 Jul 2021 09:04:57 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1625475897.49.0.867228793426.issue38291@roundup.psfhosted.org> Ken Jin added the comment: > This change seems to emit deprecation warnings in test_pydoc. test_typing emits them too as it tests importing things from __all__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:05:01 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 09:05:01 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625475901.12.0.644825378046.issue44558@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25589 pull_request: https://github.com/python/cpython/pull/27030 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:04:55 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 09:04:55 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625475895.87.0.266438523944.issue44558@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25588 pull_request: https://github.com/python/cpython/pull/27029 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:06:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Mon, 05 Jul 2021 09:06:48 +0000 Subject: [issue41576] document BaseException in favour of bare except in error tutorial In-Reply-To: <1597749008.64.0.991645904634.issue41576@roundup.psfhosted.org> Message-ID: <1625476008.18.0.131223791346.issue41576@roundup.psfhosted.org> Erlend E. Aasland added the comment: Serhiy/Terry: Is further discussion needed? Can this be closed, or should the proposed PR be applied (after resolving any issues)? ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:09:06 2021 From: report at bugs.python.org (kevinshi) Date: Mon, 05 Jul 2021 09:09:06 +0000 Subject: [issue44565] python configure config.status: error: cannot find input file: `config.sh.in' Message-ID: <1625476146.85.0.858438616021.issue44565@roundup.psfhosted.org> New submission from kevinshi : config.status: error: cannot find input file: `config.sh.in' ---------- components: Installation messages: 396977 nosy: kevinshi priority: normal severity: normal status: open title: python configure config.status: error: cannot find input file: `config.sh.in' type: compile error versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:42:53 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 05 Jul 2021 09:42:53 +0000 Subject: [issue1462485] StopIteration raised in body of 'with' statement suppressed Message-ID: <1625478173.11.0.495155689203.issue1462485@roundup.psfhosted.org> Thomas Grainger added the comment: ``` import contextlib @contextlib.contextmanager def foo(): yield class StartIrritation(StopIteration): pass with foo(): raise StartIrritation ``` ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:45:40 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 05 Jul 2021 09:45:40 +0000 Subject: [issue44566] StopIteration subclass raised in body of 'with' statement suppressed Message-ID: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> New submission from Thomas Grainger : https://bugs.python.org/issue1462485 import contextlib @contextlib.contextmanager def foo(): yield class StartIrritation(StopIteration): pass with foo(): raise StartIrritation ---------- messages: 396979 nosy: graingert, ncoghlan, yselivanov priority: normal severity: normal status: open title: StopIteration subclass raised in body of 'with' statement suppressed 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 Jul 5 05:46:06 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 05 Jul 2021 09:46:06 +0000 Subject: [issue1462485] StopIteration raised in body of 'with' statement suppressed Message-ID: <1625478366.09.0.822235921884.issue1462485@roundup.psfhosted.org> Thomas Grainger added the comment: apologies I meant to post this on a new ticket ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:51:56 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 09:51:56 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625478716.42.0.810455554109.issue44558@roundup.psfhosted.org> miss-islington added the comment: New changeset 1f8486fd50ad4666078eb40ce9f24e8aac17a395 by Miss Islington (bot) in branch '3.10': bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012) https://github.com/python/cpython/commit/1f8486fd50ad4666078eb40ce9f24e8aac17a395 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:52:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 09:52:08 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625478728.8.0.259074268698.issue44558@roundup.psfhosted.org> miss-islington added the comment: New changeset 9f47d872dbebdd95fd6b0a3351aeafaf82dfd203 by Miss Islington (bot) in branch '3.9': bpo-44558: Make the implementation consistency of operator.indexOf (GH-27012) https://github.com/python/cpython/commit/9f47d872dbebdd95fd6b0a3351aeafaf82dfd203 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 05:52:56 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 05 Jul 2021 09:52:56 +0000 Subject: [issue44566] StopIteration subclass raised in body of 'with' statement suppressed In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1625478776.33.0.68470455202.issue44566@roundup.psfhosted.org> Thomas Grainger added the comment: This is the output: ``` Traceback (most recent call last): File "/home/graingert/projects/close.py", line 5, in foo yield File "/home/graingert/projects/close.py", line 12, in raise StartIrritation __main__.StartIrritation The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/graingert/projects/close.py", line 11, in with foo(): File "/usr/lib/python3.10/contextlib.py", line 151, in __exit__ self.gen.throw(type, value, traceback) RuntimeError: generator raised StopIteration ``` Note that this was fixed in @contextlib.asynccontextmanager ``` import asyncio import contextlib @contextlib.asynccontextmanager async def foo(): yield class StartIrritation(StopIteration): pass async def amain(): try: async with foo(): raise StartIrritation except StartIrritation: print("good") except RuntimeError: print("bad") asyncio.run(amain()) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 06:02:11 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 05 Jul 2021 10:02:11 +0000 Subject: [issue44566] StopIteration subclass raised in body of 'with' statement suppressed In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1625479331.53.0.600853909119.issue44566@roundup.psfhosted.org> Change by Thomas Grainger : ---------- keywords: +patch pull_requests: +25590 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27024 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 06:09:29 2021 From: report at bugs.python.org (kevinshi) Date: Mon, 05 Jul 2021 10:09:29 +0000 Subject: [issue44565] python configure config.status: error: cannot find input file: `config.sh.in' In-Reply-To: <1625476146.85.0.858438616021.issue44565@roundup.psfhosted.org> Message-ID: <1625479769.22.0.946962648442.issue44565@roundup.psfhosted.org> kevinshi added the comment: thanks i'm resolved! It because system's env has the same name for config.sh ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 06:10:23 2021 From: report at bugs.python.org (kevinshi) Date: Mon, 05 Jul 2021 10:10:23 +0000 Subject: [issue44565] python configure config.status: error: cannot find input file: `config.sh.in' In-Reply-To: <1625476146.85.0.858438616021.issue44565@roundup.psfhosted.org> Message-ID: <1625479823.12.0.712209067296.issue44565@roundup.psfhosted.org> Change by kevinshi : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 06:35:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Jul 2021 10:35:10 +0000 Subject: [issue42889] Incorrect behavior after ast node visits In-Reply-To: <1610351139.91.0.540037450972.issue42889@roundup.psfhosted.org> Message-ID: <1625481310.7.0.294379490884.issue42889@roundup.psfhosted.org> Terry J. Reedy added the comment: We usually used 'fixed' for 'fixed in this issue'. In any case, 'Resolution' is secdondary to 'Status'. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 06:36:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 10:36:18 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625481378.05.0.809025489322.issue26280@roundup.psfhosted.org> Irit Katriel added the comment: This looks like a case of specialization. ---------- nosy: +Mark.Shannon, gvanrossum, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 07:11:03 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 11:11:03 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625483463.09.0.215230976022.issue44562@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25591 pull_request: https://github.com/python/cpython/pull/27031 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 07:10:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 11:10:57 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625483457.3.0.943439154305.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b324c4c5f763c5116a97db8591e6dcb94456570a by Pablo Galindo in branch 'main': bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021) https://github.com/python/cpython/commit/b324c4c5f763c5116a97db8591e6dcb94456570a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 07:34:30 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 11:34:30 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625484870.36.0.299856946334.issue44562@roundup.psfhosted.org> miss-islington added the comment: New changeset d17cc1ff9fe82b17bbe589b83e440959c8f135d7 by Miss Islington (bot) in branch '3.10': bpo-44562: Use PyType_GenericAlloc in Py_GenericAlias (GH-27021) https://github.com/python/cpython/commit/d17cc1ff9fe82b17bbe589b83e440959c8f135d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 08:17:13 2021 From: report at bugs.python.org (Steven Hsu) Date: Mon, 05 Jul 2021 12:17:13 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1625487433.35.0.36250285839.issue44561@roundup.psfhosted.org> Change by Steven Hsu : ---------- pull_requests: +25592 pull_request: https://github.com/python/cpython/pull/27032 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 09:35:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 13:35:46 +0000 Subject: [issue4600] __class__ assignment: new-style? heap? == confusing In-Reply-To: <1228771522.72.0.688992536212.issue4600@psf.upfronthosting.co.za> Message-ID: <1625492146.32.0.539429763049.issue4600@roundup.psfhosted.org> Irit Katriel added the comment: The error messages are different now: >>> class C: pass ... >>> c = C() >>> c.__class__ = 1 Traceback (most recent call last): File "", line 1, in TypeError: __class__ must be set to a class, not 'int' object >>> c.__class__ = object Traceback (most recent call last): File "", line 1, in TypeError: __class__ assignment only supported for mutable types or ModuleType subclasses >>> ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 09:58:02 2021 From: report at bugs.python.org (Sergey Fedoseev) Date: Mon, 05 Jul 2021 13:58:02 +0000 Subject: [issue44022] urllib http client possible infinite loop on a 100 Continue response In-Reply-To: <1620061983.98.0.377096987447.issue44022@roundup.psfhosted.org> Message-ID: <1625493482.64.0.177885308847.issue44022@roundup.psfhosted.org> Change by Sergey Fedoseev : ---------- nosy: +sir-sigurd nosy_count: 8.0 -> 9.0 pull_requests: +25593 pull_request: https://github.com/python/cpython/pull/27033 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 10:20:23 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 14:20:23 +0000 Subject: [issue23609] Export PyModuleObject in moduleobject.h In-Reply-To: <1425832317.75.0.265889084011.issue23609@psf.upfronthosting.co.za> Message-ID: <1625494823.83.0.782289820271.issue23609@roundup.psfhosted.org> Irit Katriel added the comment: + PEP 489 authors. ---------- nosy: +iritkatriel, ncoghlan, petr.viktorin, scoder _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 10:29:23 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Jul 2021 14:29:23 +0000 Subject: [issue23609] Export PyModuleObject in moduleobject.h In-Reply-To: <1425832317.75.0.265889084011.issue23609@psf.upfronthosting.co.za> Message-ID: <1625495363.79.0.611511358626.issue23609@roundup.psfhosted.org> Stefan Behnel added the comment: Could you explain a bit why you want to subclass "PyModuleObject" in C? Why isn't a Python subclass or an independent (non-module) C extension type enough? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 10:30:28 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Jul 2021 14:30:28 +0000 Subject: [issue23609] Export PyModuleObject in moduleobject.h In-Reply-To: <1425832317.75.0.265889084011.issue23609@psf.upfronthosting.co.za> Message-ID: <1625495428.63.0.119684487337.issue23609@roundup.psfhosted.org> Change by Stefan Behnel : ---------- components: +C API -Interpreter Core type: -> enhancement versions: +Python 3.11 -Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 10:33:00 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 05 Jul 2021 14:33:00 +0000 Subject: [issue23609] Export PyModuleObject in moduleobject.h In-Reply-To: <1425832317.75.0.265889084011.issue23609@psf.upfronthosting.co.za> Message-ID: <1625495580.26.0.117741268541.issue23609@roundup.psfhosted.org> Stefan Behnel added the comment: I only just noticed that the original request is from 2015. My guess is that this is a resolved problem, given the available options. I'll close this ticket as outdated. Please comment if this is still an issue. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 10:44:13 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 14:44:13 +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: <1625496253.85.0.3872761452.issue44022@roundup.psfhosted.org> miss-islington added the comment: New changeset 7ac7a0c0f03c60934bc924ee144db170a0e0161f by Sergey Fedoseev in branch 'main': bpo-44022: Fix Sphinx role in NEWS entry (GH-27033) https://github.com/python/cpython/commit/7ac7a0c0f03c60934bc924ee144db170a0e0161f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:18:22 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 15:18:22 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625498302.58.0.697111751796.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset 1b133ab8412e4f6a53914212df7a7656f376256d by Steve Dower in branch 'main': bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on Windows (GH-26984) https://github.com/python/cpython/commit/1b133ab8412e4f6a53914212df7a7656f376256d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:19:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 15:19:10 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625498350.9.0.225602747017.issue44479@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25594 pull_request: https://github.com/python/cpython/pull/27034 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:19:26 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 05 Jul 2021 15:19:26 +0000 Subject: [issue43388] shutil._fastcopy_sendfile() makes wrong (?) assumption about sendfile() return value In-Reply-To: <1614787613.45.0.094604330239.issue43388@roundup.psfhosted.org> Message-ID: <1625498366.42.0.836888583176.issue43388@roundup.psfhosted.org> Andrei Kulakov added the comment: Wouldn't this create infinite loop if a file cannot be fully copied for some reason? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:28:45 2021 From: report at bugs.python.org (=?utf-8?q?Lorenz_H=C3=BCdepohl?=) Date: Mon, 05 Jul 2021 15:28:45 +0000 Subject: [issue43388] shutil._fastcopy_sendfile() makes wrong (?) assumption about sendfile() return value In-Reply-To: <1614787613.45.0.094604330239.issue43388@roundup.psfhosted.org> Message-ID: <1625498925.02.0.730126233507.issue43388@roundup.psfhosted.org> Lorenz H?depohl added the comment: Sure, as written it would. As I said: Error handling etc. left out for clarity, just to point out the new structure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:40:12 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 15:40:12 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625499612.56.0.274570459089.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25595 pull_request: https://github.com/python/cpython/pull/27035 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:43:31 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 15:43:31 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1625499612.59.0.777869653592.issue44479@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Thanks, I tried this and it works beautifully! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:45:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 15:45:51 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625499951.16.0.473628423909.issue26280@roundup.psfhosted.org> Guido van Rossum added the comment: Very much so. Irit, do you want to give it a try? (Note there are helpful instructions now in Python/adaptive.md.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:47:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 15:47:54 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625500074.26.0.778456660317.issue26280@roundup.psfhosted.org> Irit Katriel added the comment: Sure, I'll have a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:51:01 2021 From: report at bugs.python.org (schwaerz) Date: Mon, 05 Jul 2021 15:51:01 +0000 Subject: [issue44567] venv fails when called from within long path on Windows Message-ID: <1625500261.64.0.225547269039.issue44567@roundup.psfhosted.org> New submission from schwaerz : When trying to create a venv from within a long path name in Windows 10 (long paths enabled in the registry), python crashes. Used python 3.9.6. When reducing the path length by one character, it starts working. When disabling the long path support in Windows, I get an error message about paths being too long. btw.: I can see same / similar behavior when using virtualenv/pipenv/poetry (did not try any other venv-like tooling...) For the instructions please check the following snippet: d:\slave\workspace\1--folder-with-232-character-absolute-path-length----------------------------------------------------------------------------------------------------------------------------------------------------------------232>python -m venv .venv Error: Command '['d:\\slave\\workspace\\1--folder-with-232-character-absolute-path-length----------------------------------------------------------------------------------------------------------------------------------------------------------------232\\.venv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 3221226505. %Errorlevel% sometimes was 1 and sometimes was -1073740791 (0xc0000409). Unfortunately I cannot recalled what I had to do to get the latter one... I tried with python 3.8.0, too. Same behavior. ---------- components: Windows messages: 397000 nosy: paul.moore, schwaerz, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: venv fails when called from within long path on Windows versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 11:58:42 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 15:58:42 +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: <1625500722.7.0.0607990295595.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: Can that be fixed by changing test_pydoc? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:01:18 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 05 Jul 2021 16:01:18 +0000 Subject: [issue43384] Include regen-stdlib-module-names in regen-all In-Reply-To: <1614755289.13.0.914626827133.issue43384@roundup.psfhosted.org> Message-ID: <1625500878.11.0.86949768901.issue43384@roundup.psfhosted.org> Andrei Kulakov added the comment: This can be closed based on PR comment by nascheme. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:22:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 16:22:51 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625502171.17.0.699759243898.issue44562@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 51a29c42f10bd9368db9a21f2f63319be2e30b95 by Ken Jin in branch '3.9': [3.9] bpo-44562: Remove invalid PyObject_GC_Del from error path of types.GenericAlias ? (GH-27016) (GH-27028) https://github.com/python/cpython/commit/51a29c42f10bd9368db9a21f2f63319be2e30b95 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:23:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 16:23:49 +0000 Subject: [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10 In-Reply-To: <1615324586.52.0.680787948676.issue43453@roundup.psfhosted.org> Message-ID: <1625502229.49.0.493568434675.issue43453@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 17f94e28882e1e2b331ace93f42e8615383dee59 by andrei kulakov in branch 'main': bpo-43453: Update and re-add example to typing runtime_checkable (#27013) https://github.com/python/cpython/commit/17f94e28882e1e2b331ace93f42e8615383dee59 ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:28:15 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 16:28:15 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625502495.38.0.621794860939.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset f3289a50503ed1a809d77fb03744bdcc7b9f1093 by Steve Dower in branch '3.10': bpo-44479: Regenerate test_frozenmain.h and frozen_hello.h during build on Windows (GH-26984) https://github.com/python/cpython/commit/f3289a50503ed1a809d77fb03744bdcc7b9f1093 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:28:55 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 16:28:55 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625502535.57.0.991513210388.issue44479@roundup.psfhosted.org> Steve Dower added the comment: Great! I backported to 3.10, but we never took the other changes back to 3.9 so it can stop there. ---------- assignee: -> steve.dower resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:34:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 16:34:14 +0000 Subject: [issue44562] types.GenericAlias should decref instead of using delete in tp_new In-Reply-To: <1625412840.28.0.957157169127.issue44562@roundup.psfhosted.org> Message-ID: <1625502854.08.0.657015726546.issue44562@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 Jul 5 12:37:53 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Mon, 05 Jul 2021 16:37:53 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625503073.61.0.967861568932.issue44555@roundup.psfhosted.org> Daniel Fleischman added the comment: Thank you for your reply. I didn't know that this was the expected behavior (found it at https://wiki.python.org/moin/TimeComplexity): "For these operations, the worst case n is the maximum size the container ever achieved, rather than just the current size. For example, if N objects are added to a dictionary, then N-1 are deleted, the dictionary will still be sized for N objects (at least) until another insertion is made." Thank you for pointing out! I still disagree with this design since it's not how a person using a hash map expects it to behave. That said, this link clearly shows that it's *not* a bug, and that we just have different opinions on what is the best trade-off between space, code complexity, and speed, especially on something as ubiquitous as a dictionary. Just one final attempt to gain support for my idea before I close the issue. When I proposed a linked list I didn't mean an "intro to programming" linked list, with pointers and a new malloc for every node. I meant simply adding two fields to PyDictKeyEntry with the indices of the next and previous valid entries. There would be a tiny memory overhead, and we would get a data structure that behaves how one would reasonably expect it to (compare with hash table found in the standard libraries of other languages. It's usually unexpected for an operation in a data structure to take time proportional to its historical value). I will close this issue in two days if there are no further replies. Thank you for the discussion! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:38:06 2021 From: report at bugs.python.org (tongxiaoge) Date: Mon, 05 Jul 2021 16:38:06 +0000 Subject: [issue44568] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault Message-ID: <1625503086.3.0.822137637944.issue44568@roundup.psfhosted.org> New submission from tongxiaoge : I have reproduced this problem in the latest versions of Python 3.8.10 and 3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. The failure log is as follows? [ 457s] 0:02:34 load avg: 9.29 Re-running test_ssl in verbose mode [ 457s] test_ssl: testing with 'OpenSSL 1.1.1f 31 Mar 2020' (1, 1, 1, 6, 15) [ 457s] under 'Linux-4.19.36-vhulk1907.1.0.h748.eulerosv2r8.aarch64-aarch64-with-glibc2.17' [ 457s] HAS_SNI = True [ 457s] OP_ALL = 0x80000054 [ 457s] OP_NO_TLSv1_1 = 0x10000000 [ 457s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok [ 457s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok [ 457s] test_check_hostname (test.test_ssl.ContextTests) ... ok [ 457s] test_ciphers (test.test_ssl.ContextTests) ... ok [ 457s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault [ 457s] [ 457s] Current thread 0x0000ffff8e225010 (most recent call first): [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 483 in __new__ [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in test_constructor [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in _callTestMethod [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in run [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in __call__ [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__ [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__ [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in run [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2030 in _run_suite [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2152 in run_unittest [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in test_main [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 153 in _runtest [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 694 in _main [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 637 in main [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 715 in main [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in _main [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 87 in _run_code [ 457s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 194 in _run_module_as_main [ 457s] /var/tmp/rpm-tmp.gGVNgB: line 50: 2329201 Segmentation fault (core dumped) WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug $(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils -x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio [ 457s] error: Bad exit status from /var/tmp/rpm-tmp.gGVNgB (%check) ---------- components: Tests messages: 397008 nosy: sxt1001 priority: normal severity: normal status: open title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault type: crash versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:45:43 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 16:45:43 +0000 Subject: [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10 In-Reply-To: <1615324586.52.0.680787948676.issue43453@roundup.psfhosted.org> Message-ID: <1625503543.21.0.190948973196.issue43453@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25596 pull_request: https://github.com/python/cpython/pull/27036 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 12:47:05 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 05 Jul 2021 16:47:05 +0000 Subject: [issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary Message-ID: <1625503625.05.0.62837078116.issue44569@roundup.psfhosted.org> New submission from Ammar Askar : During the implementation of PEP 657, Terry Jan Reedy pointed out that in the format method of traceback.StackSummary there are two roles being fulfilled, there is some logic to handle omitting repeated lines involved in recursive calls and then the core per-frame formatting logic: https://github.com/python/cpython/blob/17f94e28882e1e2b331ace93f42e8615383dee59/Lib/traceback.py#L484-L503 To allow the per-line formatting to be overridden easily, these lines should be split into a separate method. ---------- assignee: ammar2 components: Library (Lib) messages: 397009 nosy: BTaskaya, ammar2, pablogsal, terry.reedy priority: normal severity: normal status: open title: traceback.py: Allow customization of per-frame line formatting in StackSummary versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:04:37 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Mon, 05 Jul 2021 17:04:37 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625504677.4.0.879646163754.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25597 pull_request: https://github.com/python/cpython/pull/27037 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:08:37 2021 From: report at bugs.python.org (Eryk Sun) Date: Mon, 05 Jul 2021 17:08:37 +0000 Subject: [issue44567] venv fails when called from within long path on Windows In-Reply-To: <1625500261.64.0.225547269039.issue44567@roundup.psfhosted.org> Message-ID: <1625504917.76.0.53665411371.issue44567@roundup.psfhosted.org> Eryk Sun added the comment: The secure CRT string functions such as wcscpy_s() and wcscat_s() invoke the invalid parameter handler if the destination string is too small. This defaults to a fastfail that terminates with the status code 0xC0000409, subcode 5 (FAST_FAIL_INVALID_ARG). We're using buffers sized MAXPATHLEN+1 in PC/getpathp.c, which supports 256 characters plus a terminating null. We could increase the buffer size, but bear in mind that Windows itself doesn't completely support running applications from a long path. So you may still hit road blocks. ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:15:18 2021 From: report at bugs.python.org (schwaerz) Date: Mon, 05 Jul 2021 17:15:18 +0000 Subject: [issue44567] venv fails when called from within long path on Windows In-Reply-To: <1625500261.64.0.225547269039.issue44567@roundup.psfhosted.org> Message-ID: <1625505318.74.0.403448048569.issue44567@roundup.psfhosted.org> schwaerz added the comment: I see. Reading https://docs.python.domainunion.de/3/using/windows.html#removing-the-max-path-limitation I thought that the long paths on Win10 are supposed to be supported in general. Is there any blocker in particular which I should keep in mind? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:22:39 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 05 Jul 2021 17:22:39 +0000 Subject: [issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary In-Reply-To: <1625503625.05.0.62837078116.issue44569@roundup.psfhosted.org> Message-ID: <1625505759.99.0.107545799794.issue44569@roundup.psfhosted.org> Change by Ammar Askar : ---------- keywords: +patch pull_requests: +25598 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27038 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:38:16 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 05 Jul 2021 17:38:16 +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: <1625506696.57.0.539745958279.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: We could easily do what Ken did in PR-26811, and add "warnings.filterwarnings("default", category=DeprecationWarning)" to the test, but I would like to understand what is going on first. It seems the warnings are generated by test_builtin_with_more_than_four_children, which doesn't operate on typing directly. Here is a repro, without tests: srittau at blitz:~/Projekte/cpython (typing-io *)$ ./python -Wall Python 3.11.0a0 (heads/main:17f94e2888, Jul 5 2021, 19:19:04) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pydoc >>> import typing >>> doc = pydoc.TextDoc() >>> x = doc.docclass(object) /home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.io is deprecated, import directly from typing instead. typing.io will be removed in Python 3.12. if not cls.__name__.startswith("_") and cls.__module__ == "builtins"), /home/srittau/Projekte/cpython/Lib/pydoc.py:1344: DeprecationWarning: typing.re is deprecated, import directly from typing instead. typing.re will be removed in Python 3.12. if not cls.__name__.startswith("_") and cls.__module__ == "builtins"), >>> Same warning when calling "help(object)". This is not great. I assume that it is somehow related to pydoc.docclass() iterating over the the items of typing, but only if typing was imported. Please not that "io" and "re" are not part of typing.__all__. I will investigate more. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:46:03 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Jul 2021 17:46:03 +0000 Subject: [issue4600] __class__ assignment: new-style? heap? == confusing In-Reply-To: <1228771522.72.0.688992536212.issue4600@psf.upfronthosting.co.za> Message-ID: <1625507163.22.0.528811619683.issue4600@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:49:01 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 05 Jul 2021 17:49:01 +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: <1625507341.37.0.927706412592.issue38291@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- pull_requests: +25599 pull_request: https://github.com/python/cpython/pull/27039 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 13:52:46 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 05 Jul 2021 17:52: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: <1625507566.28.0.321817517173.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: pr-27039 suppresses warnings when accessing `typing.{re,io}.__module__`, which should fix this warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 14:07:07 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 18:07:07 +0000 Subject: [issue44567] venv fails when called from within long path on Windows In-Reply-To: <1625500261.64.0.225547269039.issue44567@roundup.psfhosted.org> Message-ID: <1625508427.76.0.661173774609.issue44567@roundup.psfhosted.org> Steve Dower added the comment: It enables it for accessing from within Python, but doesn't enable Python itself to be installed into a long path. And because a venv is essentially an installation, they're included in that. (Possibly %PYTHONPATH% entries are too.) I haven't checked how widely MAXPATHLEN is used, but it may be safe enough to just raise it. However, I think that's going to have a memory impact, because the paths used for initialization are kept around for the whole length of the application now. It might be okay though, not sure how many paths are kept. I'm still keen to see the whole getpath implementation replaced with Python code (with suitably injected native helpers), which would make it much easier for us to use dynamically allocated strings of any length. The current implementation is a way off being able to handle this. ---------- versions: +Python 3.11 -Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 14:08:39 2021 From: report at bugs.python.org (Steve Dower) Date: Mon, 05 Jul 2021 18:08:39 +0000 Subject: [issue44567] venv fails when called from within long path on Windows In-Reply-To: <1625500261.64.0.225547269039.issue44567@roundup.psfhosted.org> Message-ID: <1625508519.72.0.66779126253.issue44567@roundup.psfhosted.org> Steve Dower added the comment: Oh, and there's no harm in adding a note to that doc section explicitly pointing out that it doesn't enable CPython itself to be installed to a long path, and it may not enable packages to be imported from long paths in all scenarios (as it's very feasible that some 3rd party DLLs won't handle long paths). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 14:34:29 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 18:34:29 +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: <1625510068.99.0.0918475799352.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: Why not just change "typing.io" to "typing"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 15:07:34 2021 From: report at bugs.python.org (Neil Schemenauer) Date: Mon, 05 Jul 2021 19:07:34 +0000 Subject: [issue43384] Include regen-stdlib-module-names in regen-all In-Reply-To: <1614755289.13.0.914626827133.issue43384@roundup.psfhosted.org> Message-ID: <1625512054.35.0.182367660608.issue43384@roundup.psfhosted.org> Change by Neil Schemenauer : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 15:15:08 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 05 Jul 2021 19:15:08 +0000 Subject: [issue4600] __class__ assignment error message confusing In-Reply-To: <1228771522.72.0.688992536212.issue4600@psf.upfronthosting.co.za> Message-ID: <1625512508.85.0.0407702827281.issue4600@roundup.psfhosted.org> Terry J. Reedy added the comment: I neglected to mention above what c is. I Irit guessed right as >>> class C: pass ... >>> c = C() is what I (also) usually do for examples and testing. Removing "new-style" elsewhere solved the issue with the error message for "ob.__class__ = non_class_object". The new error message for "ob.__class__ = someclass" replaces 'heap' with 'mutable'. But it can still be confusing as the qualification in __class__ assignment only supported for mutable types or ModuleType subclasses applies to both type(ob) and someclass and the same error is given if either does not qualify. The use of the plural 'types' allows but does not mandate this interpretation. Also, "mutable types" means that the types are mutable, not their instances. Although 'list' is sometimes referred to as a 'mutable type' because its instances are, 'list' itself is not mutable and does not qualify here. I am closing this issue, which is about the error message, because the new message is accurate when understood. I cannot think of any better one-line message. Explaining the background needed to understand should be done elsewhere. Andre, I nosied you in case the above would help you improve Friendly's explanation of this error. I was a bit confused myself until I did more experiments. Note: Even when type(ob) and someclass both 'qualify', the assignment will fail if instances are 'incompatible'. Let M be a subclass of types.ModuleType. c.__class__ = M # fails with TypeError: __class__ assignment: 'M' object layout differs from 'C' The difference is obvious by looking as dir(c) and dir(M('somename')). ---------- nosy: +aroberge title: __class__ assignment: new-style? heap? == confusing -> __class__ assignment error message confusing versions: +Python 3.11 -Python 3.3 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 15:40:12 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Mon, 05 Jul 2021 19:40:12 +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: <1625514012.14.0.138892136543.issue38291@roundup.psfhosted.org> Sebastian Rittau added the comment: typing.io is not referenced in either the tests or the implementation for pydoc. What happens is basically: typing.io is a class, so its derived from object. When formatting the docstring for object, the formatter queries the __module__ attribute of all sub-classes of object, including typing.io, so that it can include the sub-classes in its output: -------------- Help on class object in module builtins: class object | The base class of the class hierarchy. | | When called, it accepts no arguments and returns a new featureless | instance that has no instance attributes and cannot be given any. | | Built-in subclasses: | anext_awaitable | async_generator | async_generator_asend | async_generator_athrow | ... and 88 other subclasses | [...] -------------- Before the PR this failed, as accessing any typing.io.__module__ printed the warning. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:38:37 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 20:38:37 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625517517.89.0.211165025671.issue44555@roundup.psfhosted.org> Raymond Hettinger added the comment: > I still disagree with this design since it's not > how a person using a hash map expects it to behave. All mapping data structures have tradeoffs. For the core dict type, we chose a structure that benefits most Python users most of the time. If a user expects that the core dict type magically handles all cases optimally, that is a bug in their expectation, not a bug in Python. For the atypical pattern shown in slow_dictionary(), we recommend choosing a different data structure such as an OrderedDict or simply storing the keys in a deque. This isn't a blow-off answer -- the stated goal of the collections module is to offer "specialized container datatypes providing alternatives to Python?s general purpose built-in containers, dict, list, set, and tuple." Those alternatives have different performance characteristics that may better serve particular access patterns. Thanks for the suggestion, but this is not a bug. It is an intentional design decision. Changing the dict implementation to a linked list would make your case perform better but would make most users worse off. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:42:04 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 20:42:04 +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: <1625517724.22.0.137833803002.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: Thanks for the explanation. Let's reopen the issue for now. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:45:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 20:45:01 +0000 Subject: [issue44566] StopIteration subclass raised in body of 'with' statement suppressed In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1625517901.44.0.338168776326.issue44566@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:46:06 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 20:46:06 +0000 Subject: [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10 In-Reply-To: <1615324586.52.0.680787948676.issue43453@roundup.psfhosted.org> Message-ID: <1625517966.66.0.789251522572.issue43453@roundup.psfhosted.org> miss-islington added the comment: New changeset 846cc4d28025ac4319069ec3c6db9526c75efd40 by Miss Islington (bot) in branch '3.10': bpo-43453: Update and re-add example to typing runtime_checkable (GH-27013) https://github.com/python/cpython/commit/846cc4d28025ac4319069ec3c6db9526c75efd40 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:47:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 05 Jul 2021 20:47:15 +0000 Subject: [issue43453] docs: runtime_checkable example refers to changed behavior in 3.10 In-Reply-To: <1615324586.52.0.680787948676.issue43453@roundup.psfhosted.org> Message-ID: <1625518035.55.0.485634887634.issue43453@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 Mon Jul 5 16:48:22 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 20:48:22 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1625518102.97.0.388260713184.issue44566@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- components: +Library (Lib) title: StopIteration subclass raised in body of 'with' statement suppressed -> StopIteration subclass suppressed by contextlib.contextmanager type: -> behavior versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:51:01 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 20:51:01 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625518261.43.0.363914403482.issue44558@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 16:57:23 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 20:57:23 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625518643.22.0.998094401961.issue44547@roundup.psfhosted.org> Raymond Hettinger added the comment: > I am wondering whether one of __int__ or __trunc__ should be deprecated. I would not miss __trunc__. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:19:45 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 22:19:45 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625523585.34.0.674738531112.issue44563@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25600 pull_request: https://github.com/python/cpython/pull/27041 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:19:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 22:19:50 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625523590.23.0.853011647292.issue44563@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f64de53ff01e734d48d1d42195443d7d1646f220 by Serhiy Storchaka in branch 'main': bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) https://github.com/python/cpython/commit/f64de53ff01e734d48d1d42195443d7d1646f220 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:19:50 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 05 Jul 2021 22:19:50 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625523590.76.0.724904038054.issue44563@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25601 pull_request: https://github.com/python/cpython/pull/27042 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:29:38 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 05 Jul 2021 22:29:38 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases Message-ID: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> New submission from Ned Batchelder : (from https://github.com/nedbat/coveragepy/issues/1184) This code runs the return statement on line 17 twice. The second time, there is a "line" event and then a "return" event for that line. But the first time, there is only a "return" event: --- 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 foo(x): if x: try: 1/(x - 1) except ZeroDivisionError: pass return x def test_foo(): for i in range(2): foo(i) print(sys.version) sys.settrace(trace) test_foo() ----------------------------------------- I get this output with 3.10.0b3: 3.10.0b3 (default, Jun 18 2021, 06:43:38) [Clang 12.0.0 (clang-1200.0.32.29)] call 19: def test_foo(): line 20: for i in range(2): line 21: foo(i) call 10: def foo(x): line 11: if x: retu 17: return x line 20: for i in range(2): line 21: foo(i) call 10: def foo(x): line 11: if x: line 12: try: line 13: 1/(x - 1) exce 13: 1/(x - 1) line 14: except ZeroDivisionError: line 15: pass line 17: return x retu 17: return x line 20: for i in range(2): retu 20: for i in range(2): Shouldn't there be a "line" event for both invocations? ---------- components: Interpreter Core keywords: 3.10regression messages: 397024 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: 3.10.0b3 doesn't trace line events for return in some cases versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:33:28 2021 From: report at bugs.python.org (pavel-lexyr) Date: Mon, 05 Jul 2021 22:33:28 +0000 Subject: [issue44571] itertools: takedowhile() Message-ID: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> New submission from pavel-lexyr : As described in the documentation, itertools.takewhile() returns all the elements until the first one that does not match the provided criterion. In case of a destructive iterator, or one with side effects, not yielding an element downstream may render takewhile() unsuitable for use. Proposed is itertools.takedowhile() - an alternate function that yields the first false element as well, and returns after. The behaviour is identical otherwise. ---------- messages: 397025 nosy: pavel-lexyr, rhettinger priority: normal severity: normal status: open title: itertools: takedowhile() type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:34:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 22:34:16 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625524456.3.0.8191546655.issue44563@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 324b93295fd81133d2dd597c3e3a0333f6c9d95b by Miss Islington (bot) in branch '3.9': bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) (GH-27042) https://github.com/python/cpython/commit/324b93295fd81133d2dd597c3e3a0333f6c9d95b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:35:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 22:35:01 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625524501.81.0.95507744145.issue44563@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 645e527298b1f24625783338076330037d860162 by Miss Islington (bot) in branch '3.10': bpo-44563: Fix error handling in tee.fromiterable() (GH-27020) (GH-27041) https://github.com/python/cpython/commit/645e527298b1f24625783338076330037d860162 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:43:27 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 22:43:27 +0000 Subject: [issue44563] Failed tee.fromiterable() corrupts the linked list of all GC objects in debug build In-Reply-To: <1625422274.31.0.182880116213.issue44563@roundup.psfhosted.org> Message-ID: <1625525007.0.0.772624698954.issue44563@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 Jul 5 18:53:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 22:53:36 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625525616.05.0.00152319472964.issue26280@roundup.psfhosted.org> Change by Irit Katriel : ---------- pull_requests: +25602 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27043 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 18:56:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 05 Jul 2021 22:56:36 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625525796.33.0.121560875581.issue26280@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:25:59 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 23:25:59 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625527559.06.0.526238682294.issue44571@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion. I agree that the loss of the non-matching element is an irritant. The suggestion to return the first false element would solve that problem but is itself hard to work with. The result would be difficult to reason about because all the elements are except one are true, the last is false, and you can't know that you have gotten a false element until one more call to next() to determine that no more elements are forthcoming. Also, I'm reluctant to create any variants for takewhile() or dropwhile(). Those have been the least successful itertools. If I had it to do over again, they would not have been included. For the most part, generator based solutions are superior in terms of readability, flexibility, and performance. ---------- assignee: -> rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:26:08 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Mon, 05 Jul 2021 23:26:08 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625527568.43.0.708097687348.issue44571@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- components: +Library (Lib) versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:28:08 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Jul 2021 23:28:08 +0000 Subject: [issue36608] Replace bundled pip and setuptools with a downloader in the ensurepip module In-Reply-To: <1555020782.09.0.948988048159.issue36608@roundup.psfhosted.org> Message-ID: <1625527688.63.0.96179576532.issue36608@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:31:23 2021 From: report at bugs.python.org (Ned Deily) Date: Mon, 05 Jul 2021 23:31:23 +0000 Subject: [issue35277] Upgrade bundled pip/setuptools In-Reply-To: <1542630104.24.0.788709270274.issue35277@psf.upfronthosting.co.za> Message-ID: <1625527883.93.0.45423355411.issue35277@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the comment. While the original intent of the issue was resolved (by updating the bundled pip), Serhiy's point about the size of the repo increasing is still an issue but there is a more recent issue, Issue36608, with a proposed change that addresses that aspect. ---------- nosy: +ned.deily resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Replace bundled pip and setuptools with a downloader in the ensurepip module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:34:44 2021 From: report at bugs.python.org (pavel-lexyr) Date: Mon, 05 Jul 2021 23:34:44 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625528084.64.0.532449429926.issue44571@roundup.psfhosted.org> pavel-lexyr added the comment: I see. If the syntax allows for better ways to do it now, perhaps a move towards deprecation would be a better idea then? This would agree with the Zen. Also, please elaborate more on the generator-based solutions you have in mind. The suggestion stems from a very real use case - and the lambda function we ended up using looks like a poor hack. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 19:42:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 05 Jul 2021 23:42:20 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1625528540.46.0.955119372617.issue26280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Here is my previous attempt at this, for reference: https://github.com/python/cpython/pull/9853 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 22:57:20 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 06 Jul 2021 02:57:20 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625540240.98.0.133602555036.issue44570@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 5 23:57:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 06 Jul 2021 03:57:59 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1625543879.44.0.236155546506.issue43895@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith, twouters versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 04:26:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Jul 2021 08:26:02 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625559962.84.0.624303666986.issue44571@roundup.psfhosted.org> Serhiy Storchaka added the comment: What if set the last item as an attribute of the takewhile iterator? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 04:29:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 06 Jul 2021 08:29:47 +0000 Subject: [issue44547] fraction.Fraction does not implement __int__. In-Reply-To: <1625169148.48.0.541804995208.issue44547@roundup.psfhosted.org> Message-ID: <1625560187.67.0.843822921049.issue44547@roundup.psfhosted.org> Serhiy Storchaka added the comment: On other hand, there are classes which define __int__ but not __trunc__: UUID and IP4Address. So it makes sense to keep separate __int__ and __trunc__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 05:36:08 2021 From: report at bugs.python.org (STINNER Victor) Date: Tue, 06 Jul 2021 09:36:08 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625564168.86.0.616600436513.issue44558@roundup.psfhosted.org> STINNER Victor added the comment: This issue can be closed, no? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 05:47:07 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 06 Jul 2021 09:47:07 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625564827.37.0.0117320631103.issue44558@roundup.psfhosted.org> Dong-hee Na added the comment: @vstinner https://github.com/python/cpython/pull/27007 is not yet merged due to CLA issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 06:47:06 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Tue, 06 Jul 2021 10:47:06 +0000 Subject: [issue16321] Move eq.h out of stringlib In-Reply-To: <1351157379.02.0.714048258846.issue16321@psf.upfronthosting.co.za> Message-ID: <1625568426.85.0.814226136519.issue16321@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: To add irit's comment, It is *also* used in Objects/unicodeobject.c ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 09:36:21 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 06 Jul 2021 13:36:21 +0000 Subject: [issue31218] del expects __delitem__ if __setitem__ is defined In-Reply-To: <1502880498.02.0.663608848315.issue31218@psf.upfronthosting.co.za> Message-ID: <1625578581.87.0.845678133965.issue31218@roundup.psfhosted.org> Irit Katriel added the comment: It is still the same in 3.11: >>> class WithoutSetItem: ... def __getitem__(self, key): ... return "foo" ... >>> class WithSetItem: ... def __getitem__(self, key): ... return "foo" ... def __setitem__(self, key, val): ... return ... >>> wo = WithoutSetItem() >>> del wo[0] Traceback (most recent call last): File "", line 1, in TypeError: 'WithoutSetItem' object doesn't support item deletion >>> w = WithSetItem() >>> del w[0] Traceback (most recent call last): File "", line 1, in AttributeError: __delitem__ >>> ---------- components: +Interpreter Core nosy: +iritkatriel versions: +Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 09:42:50 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 06 Jul 2021 13:42:50 +0000 Subject: [issue34919] Crash caused by certain characters in a string In-Reply-To: <1538906666.64.0.545547206417.issue34919@psf.upfronthosting.co.za> Message-ID: <1625578970.99.0.3974443032.issue34919@roundup.psfhosted.org> Irit Katriel added the comment: As per message https://bugs.python.org/issue34919#msg327639, the issue was fixed in 3.7.1. ---------- nosy: +iritkatriel resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 10:02:15 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 14:02:15 +0000 Subject: [issue43098] tarfile list() method does not show file type In-Reply-To: <1612240547.16.0.611621491067.issue43098@roundup.psfhosted.org> Message-ID: <1625580135.29.0.0123873480903.issue43098@roundup.psfhosted.org> Andrei Kulakov added the comment: I've tested this patch on OS X with symbolic links, dirs, files and it works fine. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 10:13:25 2021 From: report at bugs.python.org (Mark Sapiro) Date: Tue, 06 Jul 2021 14:13:25 +0000 Subject: [issue44560] Unrecognized charset "eucgb2312_cn" in email header for many MUA In-Reply-To: <1625387531.16.0.849810673355.issue44560@roundup.psfhosted.org> Message-ID: <1625580805.17.0.714791146463.issue44560@roundup.psfhosted.org> Change by Mark Sapiro : ---------- versions: +Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 10:21:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 14:21:35 +0000 Subject: [issue37198] _parse_localename fail to parse 'en_IL' In-Reply-To: <1559925201.97.0.400746291459.issue37198@roundup.psfhosted.org> Message-ID: <1625581295.31.0.434279938847.issue37198@roundup.psfhosted.org> Andrei Kulakov added the comment: Note the traceback is from 2.7, which is not supported. Hodai: Can you verify it on a 3.6-3.11 release? ---------- nosy: +andrei.avk versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 10:22:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 14:22:38 +0000 Subject: [issue37198] _parse_localename fail to parse 'en_IL' In-Reply-To: <1559925201.97.0.400746291459.issue37198@roundup.psfhosted.org> Message-ID: <1625581358.14.0.187508863167.issue37198@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 10:37:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 14:37:03 +0000 Subject: [issue27875] Syslogs /usr/sbin/foo as /foo instead of as foo In-Reply-To: <1472291311.49.0.485322574022.issue27875@psf.upfronthosting.co.za> Message-ID: <1625582223.9.0.995798788078.issue27875@roundup.psfhosted.org> Andrei Kulakov added the comment: This was fixed in https://github.com/python/cpython/pull/16557 , so can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 11:01:20 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Jul 2021 15:01:20 +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: <1625583680.24.0.432762968707.issue38291@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 8b849ea0f3482ad834e7989ff474dd5db2f295c8 by Sebastian Rittau in branch 'main': bpo-38291: Fix a spurious warning when using help(object) (#27039) https://github.com/python/cpython/commit/8b849ea0f3482ad834e7989ff474dd5db2f295c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 11:03:04 2021 From: report at bugs.python.org (Paolo Lammens) Date: Tue, 06 Jul 2021 15:03:04 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1625583784.9.0.0581855407891.issue36643@roundup.psfhosted.org> Paolo Lammens added the comment: I was about to create the exact same ticket; I'm nudging this. ---------- nosy: +plammens _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 12:21:17 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Tue, 06 Jul 2021 16:21:17 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN Message-ID: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> New submission from ?????????? ?????? : Starting with version 3.9.5 platform.win32* functions have been re-written and consume STDIN. The bug comes down to running 'ver', 'command /c ver', 'cmd /c ver' in platform._syscmd_ver() via subprocess.check_output(). The following code demonstrate the problem: Python\396\python -c "import platform as p, sys;print(sys.stdin.tell());p.win32_ver();print(sys.stdin.tell())" < file 0 8000 All functions dependent on platform._syscmd_ver(), including platform.uname(), consume STDIN. This behavior breaks all the scripts on Windows platform that have the calls mentioned above and use the following invocation: python script.py < file ---------- components: IO, Library (Lib), Windows messages: 397044 nosy: glukhov.k, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Calls to platform._syscmd_ver() dependent functions consume STDIN type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 12:47:15 2021 From: report at bugs.python.org (R. David Murray) Date: Tue, 06 Jul 2021 16:47:15 +0000 Subject: [issue44560] Unrecognized charset "eucgb2312_cn" in email header for many MUA In-Reply-To: <1625387531.16.0.849810673355.issue44560@roundup.psfhosted.org> Message-ID: <1625590035.85.0.419505322783.issue44560@roundup.psfhosted.org> R. David Murray added the comment: I can't tell tell for sure if this behavior is intentional or not from a quick glance at the code (though like you I wouldn't think it would be). That's part of the legacy api, at this point. The new api will just use utf8: from email.message import EmailMessage m = EmailMessage() m['Subject'] = '??' print(bytes(m)) results in b'Subject: =?utf-8?b?5Lit5paH?=\n\n' The fix, assuming it is correct, would be to add the line: 'eucgb2312_cn': 'gb2312', to the CODEC_MAP in email/charset.py, and then specify the internal codec name in your Charset call. I'm not sure that's right, though...once upon I time I think I understood the logic behind the charset module, but I no longer remember the details. I'd recommend just using the new API and not the legacy API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 12:59:56 2021 From: report at bugs.python.org (R. David Murray) Date: Tue, 06 Jul 2021 16:59:56 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <1625590796.01.0.479491431973.issue39100@roundup.psfhosted.org> R. David Murray added the comment: How are you encountering this error? The following program runs without exception for me on master: from email import message_from_binary_file from email.policy import SMTP msg = message_from_binary_file(open('mail.eml', 'rb'), policy=SMTP) print(msg) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 13:10:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 17:10:28 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <1625591428.77.0.967698354721.issue39100@roundup.psfhosted.org> Andrei Kulakov added the comment: Running R.David's test script on python3.7, it also works, there's no exception. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 13:11:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 17:11:32 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1576783934.54.0.946649596481.issue39100@roundup.psfhosted.org> Message-ID: <1625591492.43.0.129397548573.issue39100@roundup.psfhosted.org> Andrei Kulakov added the comment: I should have been more exact - I've used python3.7.7 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 13:16:58 2021 From: report at bugs.python.org (R. David Murray) Date: Tue, 06 Jul 2021 17:16:58 +0000 Subject: [issue43493] EmailMessage mis-folding headers of a certain length In-Reply-To: <1615754789.09.0.690251462615.issue43493@roundup.psfhosted.org> Message-ID: <1625591818.72.0.493352381671.issue43493@roundup.psfhosted.org> R. David Murray added the comment: Ah, yes, the problem is more subtle than I thought. The design here is that we should be starting with the largest lexical unit, seeing if that fits on the current line, or a line by itself, and if so, using that, and if not, move down to the next smaller lexical unit and try again, until we are finally left with an unbreakable unit. For unstructured headers such as Subject the lexical units should be encoded words followed by blank delimited words. I'm guessing the code is treating the collection of words it has accumulated as a unit in the above algorithm, and since it fits on a line by itself, it goes with that. So yeah, it's sort of intentional. So the bug here is that in your step 2 we ideally want to be considering whether the last token on the current line is at the same lexical level as the token that precedes it...and if so, and if moving that token to the next line lets the remainder fit on the first line, we should do that. Exactly how to implement that correctly is a good question...it's been too long since I wrote that code, and I may not have time to investigate it more deeply. If you come up with something based on my description of the intent above, I should be able to review it (though you might need to ping me directly to get my attention). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 13:23:53 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Tue, 06 Jul 2021 17:23:53 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1625592233.59.0.336276686145.issue43298@roundup.psfhosted.org> Jason R. Coombs added the comment: I was able to export the configuration using these instructions: https://docs.microsoft.com/en-us/visualstudio/install/import-export-installation-configurations?view=vs-2019 That produced this config: { "version": "1.0", "components": [ "Microsoft.VisualStudio.Component.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Component.Roslyn.Compiler", "Microsoft.Component.MSBuild", "Microsoft.VisualStudio.Component.TextTemplating", "Microsoft.VisualStudio.Component.VC.CoreIde", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "Microsoft.VisualStudio.Component.Windows10SDK.19041", "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", "Microsoft.VisualStudio.Workload.NativeDesktop" ] } Using that, I tried to install those components using vs_buildtools: # Install Visual Studio RUN ./vs_buildtools.exe --quiet --wait --norestart --nocache \ --add Microsoft.VisualStudio.Component.CoreEditor \ --add Microsoft.VisualStudio.Workload.CoreEditor \ --add Microsoft.VisualStudio.Component.Roslyn.Compiler \ --add Microsoft.Component.MSBuild \ --add Microsoft.VisualStudio.Component.TextTemplating \ --add Microsoft.VisualStudio.Component.VC.CoreIde \ --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ --add Microsoft.VisualStudio.Component.Windows10SDK.19041 \ --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest \ --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core \ --add Microsoft.VisualStudio.Workload.NativeDesktop In order to avoid noise here, I'm going to continue the investigation in https://github.com/jaraco/jaraco.windows/issues/21. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 13:24:37 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Jul 2021 17:24: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: <1625592277.15.0.360917702834.issue38291@roundup.psfhosted.org> Change by Guido van Rossum : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 14:04:58 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 06 Jul 2021 18:04:58 +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: <1625594698.61.0.405826145949.issue44490@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset c45fa1a5d9b419cf13ad4b5a7cb453956495b83e by Yurii Karabas in branch 'main': bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980) https://github.com/python/cpython/commit/c45fa1a5d9b419cf13ad4b5a7cb453956495b83e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 15:11:22 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 06 Jul 2021 19:11:22 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625598682.83.0.240231214327.issue43950@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +25603 pull_request: https://github.com/python/cpython/pull/27047 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 15:14:30 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 19:14:30 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1625598870.78.0.614689070644.issue43299@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 15:14:59 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Tue, 06 Jul 2021 19:14:59 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625598899.82.0.198111207018.issue44572@roundup.psfhosted.org> ?????????? ?????? added the comment: The obvious fix is to add "stdin=subprocess.DEVNULL" argument to check_output() call. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 15:26:53 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 06 Jul 2021 19:26:53 +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: <1625599613.56.0.479109763665.issue44490@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25604 pull_request: https://github.com/python/cpython/pull/27048 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 15:52:42 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 06 Jul 2021 19:52:42 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625601162.13.0.461893558975.issue44572@roundup.psfhosted.org> Zachary Ware added the comment: Would you like to create a pull request to that effect? ---------- components: -IO stage: -> needs patch versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 16:08:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 20:08:44 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1625602124.16.0.257391877427.issue43299@roundup.psfhosted.org> Andrei Kulakov added the comment: Robert: I haven't worked with importlib or pyclbr before, so these may be naive questions, but: - can your usecase be resolved with a workaround, e.g. setting ModuleSpec manually in / on __main__ module, something like `from importlib._bootstrap import ModuleSpec; __spec__ = ModuleSpec('main',None) - You mention that this issue may apply to other modules, but the Python docs say __main__ is the only case that may have __spec__=None in some cases (in my testing it indeed have it set to None). Do you have any examples where other modules have __spec__=None? What's your usecase for examining __main__ with pyclbr? Not trying to sound doubtful, just really curious. - Re your PR I have a bit of a concern that catching a ValueError silently might mask other types of ValueError, but I haven't looked more closely into that, just want to note it here for the future. Btw thanks for the reply on PR to my question, it makes sense. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 16:10:23 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Tue, 06 Jul 2021 20:10:23 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625602223.32.0.345727127631.issue44572@roundup.psfhosted.org> ?????????? ?????? added the comment: I will try ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 17:23:51 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 06 Jul 2021 21:23:51 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory Message-ID: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> New submission from Leonardo Freua : I noticed that some data files (used to perform some specific tests) are not organized in specific directories of their categories. Some files that I found are audiotest.au, badcert.pem, badkey.pem, cfgparser.1, cfgparser.2, etc (some are even .py files). I'm working on an organization so they don't get mixed up with the test files, but how the rest of the data files are organized (audiodata, capath, cjkencodings, etc.). ---------- components: Tests messages: 397056 nosy: Leonardofreua priority: normal severity: normal status: open title: Organize some data files in the Lib/test directory versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 17:38:32 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Jul 2021 21:38:32 +0000 Subject: [issue42766] urllib.request.HTTPPasswordMgr uses commonprefix instead of commonpath In-Reply-To: <1609170153.96.0.504551551924.issue42766@roundup.psfhosted.org> Message-ID: <1625607512.66.0.448789615314.issue42766@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: +orsenthil _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 18:00:04 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Tue, 06 Jul 2021 22:00:04 +0000 Subject: [issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order In-Reply-To: <1610227417.16.0.538971054996.issue42878@roundup.psfhosted.org> Message-ID: <1625608804.9.0.36079218664.issue42878@roundup.psfhosted.org> Terry J. Reedy added the comment: Yair, is this really a separate bug from that reported in #42766? In other words, are there separate and distinct failing test cases? If not, this should be closed as a duplicate. ---------- nosy: +orsenthil, terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 19:58:55 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 06 Jul 2021 23:58:55 +0000 Subject: [issue43262] "_weakrefset.py", line 56: IndexError: pop from empty list In-Reply-To: <1613717279.64.0.759786918974.issue43262@roundup.psfhosted.org> Message-ID: <1625615935.47.0.346722988619.issue43262@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 22:29:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 02:29:32 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625624972.97.0.240008143427.issue43219@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25605 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27049 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 23:01:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 07 Jul 2021 03:01:23 +0000 Subject: [issue44574] IDLE: Implement or delete python-context-help. Message-ID: <1625626883.0.0.841982901959.issue44574@roundup.psfhosted.org> New submission from Terry J. Reedy : The config.IdleConf.GetCoreKeys keyBindings dict contains '<>': [''] The was included in the initial version by Steven Gava, 9930061c, on 2001 Dec 2. So it appears in the Keys page of the config dialog, as noticed by Mondher on SO ((https://stackoverflow.com/questions/68263769/idle-shell-context-documentation-broken) The string does not appear elsewhere in idlelib, nor is the feature mentioned in the IDLE doc. So it is unimplemented and undocumented. Based on experience with other IDEs (Mathematica) Mondher suggests that one should be able to select a word and have it looked up in the index of the document opened by python-doc F1. 'Very useful' he says. On Windows, F1 opens an offline Windows help window with the Python docs. Currently, modifier(s)-F1 is interpreted as F1 and the help window is opened. I presume a shift-F1 binding will override that. I also presume that an argument can be added to the Windows open-help command. I don't know about online docs on other systems and don't think we can access indexes on opened python webpages. Where shift-F1 does not work, a message should be displayed. If we decided to not implement index search anywhere, the line in config.py should be removed. ---------- assignee: terry.reedy components: IDLE messages: 397058 nosy: terry.reedy priority: normal severity: normal status: open title: IDLE: Implement or delete python-context-help. versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 23:06:01 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Wed, 07 Jul 2021 03:06:01 +0000 Subject: [issue44574] IDLE: Implement or delete python-context-help. In-Reply-To: <1625626883.0.0.841982901959.issue44574@roundup.psfhosted.org> Message-ID: <1625627161.3.0.704738326158.issue44574@roundup.psfhosted.org> Terry J. Reedy added the comment: I should check whether all other keybindings are implemented. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 23:23:12 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 03:23:12 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625628192.06.0.774163739209.issue43219@roundup.psfhosted.org> Andrei Kulakov added the comment: I've opened the PR here: https://github.com/python/cpython/pull/27049/files .. but can someone trigger builds for other OSes like Aix, FreeBSD, etc? I'm not sure what errors they would use for this case so the unit test may have to be updated to skip some of them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 23:26:04 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 03:26:04 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625628364.59.0.312489991701.issue43219@roundup.psfhosted.org> Andrei Kulakov added the comment: I'm not sure if shutil module docs should be updated or not, as this change applies to a narrow corner case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 6 23:38:31 2021 From: report at bugs.python.org (huantian) Date: Wed, 07 Jul 2021 03:38:31 +0000 Subject: [issue20907] behavioral differences between shutil.unpack_archive and ZipFile.extractall In-Reply-To: <1394703965.34.0.603199781912.issue20907@psf.upfronthosting.co.za> Message-ID: <1625629111.63.0.462209389509.issue20907@roundup.psfhosted.org> huantian added the comment: This issue is somewhat old, but I think either applying the patch attached earlier or noting this difference in behavior in the documentation would be ideal, as it can be quite difficult to debug shutil.unpack_archive silently skipping files. If the files you expect to unpack do contain '..' for non-malicious purposes this makes shutil.unpack_archive unsuitable for the situation. ---------- nosy: +huantian _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 00:36:02 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 04:36:02 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version Message-ID: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> New submission from ?????????? ?????? : Windows installer prohibits different patches for the same version. I do not see any reason why the installer cannot put two different versions, e.g. 3.9.4 and 3.9.6 into different folders. This makes it very difficult to debug issues introduced in higher versions. Please allow installation of different patches into separate folders. ---------- components: Installation, Windows messages: 397063 nosy: glukhov.k, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Windows installer prohibits different patches for the same version versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 01:55:04 2021 From: report at bugs.python.org (Yair Frid) Date: Wed, 07 Jul 2021 05:55:04 +0000 Subject: [issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order In-Reply-To: <1610227417.16.0.538971054996.issue42878@roundup.psfhosted.org> Message-ID: <1625637304.83.0.908263063091.issue42878@roundup.psfhosted.org> Yair Frid added the comment: This issue was discovered when i was writing unit tests for #42766, since #42766 was fixed when i discovered it, i realized i might want a new issue, i don't mind moving this to be a comment, but there *are* 2 distinct test cases that fail: a test case that would fail here: is_suburi('/foo/bar', '/bar/foo') == True which is different than; is_suburi('/foo/bar', '/foobar') == True ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 01:58:19 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 05:58:19 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625637499.61.0.318007304894.issue44572@roundup.psfhosted.org> Change by ?????????? ?????? : ---------- keywords: +patch pull_requests: +25606 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27050 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 04:11:59 2021 From: report at bugs.python.org (Anton Khirnov) Date: Wed, 07 Jul 2021 08:11:59 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1625590796.01.0.479491431973.issue39100@roundup.psfhosted.org> Message-ID: <162564551204.1481.9727507943773640709@lain.red.khirnov.net> Anton Khirnov added the comment: Quoting R. David Murray (2021-07-06 18:59:56) > How are you encountering this error? The following program runs without exception for me on master: > > from email import message_from_binary_file > from email.policy import SMTP > > msg = message_from_binary_file(open('mail.eml', 'rb'), policy=SMTP) > print(msg) The exception is thrown on accessing the 'to' header, so make that print(msg['to']) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 04:14:24 2021 From: report at bugs.python.org (Anton Khirnov) Date: Wed, 07 Jul 2021 08:14:24 +0000 Subject: [issue39100] email.policy.SMTP throws AttributeError on invalid header In-Reply-To: <1625321014.89.0.905910626733.issue39100@roundup.psfhosted.org> Message-ID: <162564565242.1481.173278755403901725@lain.red.khirnov.net> Anton Khirnov added the comment: Quoting Andrei Kulakov (2021-07-03 16:03:34) > Anton: thanks for the report! In the message you say you are not sure > of the solution, and because of that not sending a patch, but then you > created the PR; - please clarify. I didn't send a patch when originally submitting the bugreport in 2019. I did write a patch about a year later, since there was no response to the bugreport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 05:23:56 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 07 Jul 2021 09:23:56 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 Message-ID: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following program # example.py one = 1 two = "two" a = [one . two] Running this program with Python versions before 3.10, yields the following traceback: Traceback (most recent call last): File "C:\Users\andre\example.py", line 3, in a = [one AttributeError: 'int' object has no attribute 'two' The line shown correctly includes the 'int' object. I have verified that this is the case for Python 3.6 to 3.9 inclusively. However, with Python version 3.10.0b3, the following traceback is generated: Traceback (most recent call last): File "C:\Users\andre\example.py", line 5, in two] AttributeError: 'int' object has no attribute 'two' ---------- messages: 397067 nosy: aroberge priority: normal severity: normal status: open title: AttributeError: incorrect line identified in Python 3.10 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 05:29:26 2021 From: report at bugs.python.org (Steven Hsu) Date: Wed, 07 Jul 2021 09:29:26 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1625650166.49.0.479343205094.issue44561@roundup.psfhosted.org> Steven Hsu added the comment: I have make a new PR (#27032), and the CLA was signed. Thanks for review. ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 05:30:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 07 Jul 2021 09:30:15 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1625650215.11.0.0235727828819.issue44561@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 06:00:20 2021 From: report at bugs.python.org (Zachary Marshall) Date: Wed, 07 Jul 2021 10:00:20 +0000 Subject: [issue44205] shutil.copystat can fail when copying to a file system with a smaller limit In-Reply-To: <1621609836.65.0.951968711114.issue44205@roundup.psfhosted.org> Message-ID: <1625652020.06.0.622139715985.issue44205@roundup.psfhosted.org> Change by Zachary Marshall : ---------- nosy: +zlmarshall _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 06:06:03 2021 From: report at bugs.python.org (wiso) Date: Wed, 07 Jul 2021 10:06:03 +0000 Subject: [issue44205] shutil.copystat can fail when copying to a file system with a smaller limit In-Reply-To: <1621609836.65.0.951968711114.issue44205@roundup.psfhosted.org> Message-ID: <1625652363.73.0.562144156265.issue44205@roundup.psfhosted.org> Change by wiso : ---------- nosy: +wiso _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 06:15:20 2021 From: report at bugs.python.org (Vladislav Kozlenko) Date: Wed, 07 Jul 2021 10:15:20 +0000 Subject: [issue44577] Probably defect in Python 3.7.11 Message-ID: <1625652920.8.0.16553812104.issue44577@roundup.psfhosted.org> New submission from Vladislav Kozlenko : After upgrade to 3.7.11 from 3.7.10 WebSockets start failing. Django==2.1.2 djangorestframework==3.8.2 daphne==2.3.0 channels==2.3.1 >From the 3.7.11 changelog: Following the controlling specification for URLs defined by WHATWG urllib.parse() now removes ASCII newlines and tabs from URLs, preventing such attacks. Probably something is not good here now. 2021-07-07T10:11:23.439030174Z2021-07-07 10:11:23,438 ERROR [Failure instance: Traceback: : 'NoneType' object has no attribute 'replace' Error 2021-07-07T10:11:23.439074685Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/autobahn/websocket/protocol.py:2841:processHandshake Error 2021-07-07T10:11:23.439091149Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/txaio/tx.py:366:as_future Error 2021-07-07T10:11:23.439097914Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/twisted/internet/defer.py:167:maybeDeferred Error 2021-07-07T10:11:23.439118640Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/daphne/ws_protocol.py:82:onConnect Error 2021-07-07T10:11:23.439122445Z--- --- Error 2021-07-07T10:11:23.439125845Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/twisted/internet/defer.py:167:maybeDeferred Error 2021-07-07T10:11:23.439129088Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/daphne/server.py:200:create_application Error 2021-07-07T10:11:23.439132308Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/channels/routing.py:58:__call__ Error 2021-07-07T10:11:23.439135496Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/channels/security/websocket.py:35:__call__ Error 2021-07-07T10:11:23.439138809Z/root/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.7/site-packages/channels/security/websocket.py:53:valid_origin ---------- components: Library (Lib) messages: 397069 nosy: vladislavko priority: normal severity: normal status: open title: Probably defect in Python 3.7.11 type: crash versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 06:52:09 2021 From: report at bugs.python.org (neonene) Date: Wed, 07 Jul 2021 10:52:09 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625655129.77.0.205600312967.issue44575@roundup.psfhosted.org> neonene added the comment: To debug pure python, use embeddable pythons in different folders and copy Lib folder from source archive instead of using python3.9.zip. When using msvc (python3*.lib), I think it's enouth to install python as follows or build from source. 1.Copy Installed Python to any folder. 2.Uninstall Python. 3.Install Python with different minor version. ---------- nosy: +neonene _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:16:14 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Jul 2021 11:16:14 +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: <1625656574.33.0.351270150012.issue44530@roundup.psfhosted.org> Mark Shannon added the comment: I suspect that the 0.1% increase is noise. The size of importlib.h etc show a small decrease, suggesting that the information content of the code object has *decreased*. After all, the qualname has to stored somewhere and moving it from caller to callee should make no difference. Organizing the code object so it wastes less memory is a separate issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:21:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 11:21: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: <1625656915.02.0.0838419115386.issue44530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f by Gabriele N. Tornetta in branch 'main': bpo-44530: Add co_qualname field to PyCodeObject (GH-26941) https://github.com/python/cpython/commit/2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:22:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 11:22: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: <1625656944.94.0.623072200185.issue44530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:28:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 11:28: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: <1625657323.05.0.392720838629.issue44530@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25608 pull_request: https://github.com/python/cpython/pull/27052 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:37:54 2021 From: report at bugs.python.org (Michael) Date: Wed, 07 Jul 2021 11:37:54 +0000 Subject: [issue44578] dict with more than two type parameters doesn't raise a TypeError Message-ID: <1625657874.87.0.018743781602.issue44578@roundup.psfhosted.org> New submission from Michael : dict with three type parameters is legal (e.g., dict[str, str, str]), where I expected a TypeError. When using typing.Dict, it does raise a TypeError. Example in python 3.9: >>> from typing import Dict >>> Dict[str, str, str] # Raises a TypeError, as expected Traceback (most recent call last): File "", line 1, in File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 275, in inner return func(*args, **kwds) File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 828, in __getitem__ _check_generic(self, params, self._nparams) File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 212, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};" TypeError: Too many parameters for typing.Dict; actual 3, expected 2 >>> dict[str, str, str] # No TypeError here? dict[str, str, str] This also works in 3.7 and 3.8: Python 3.8.11 (default, Jul 6 2021, 12:13:09) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from __future__ import annotations >>> dict[str, str, str] Traceback (most recent call last): File "", line 1, in TypeError: 'type' object is not subscriptable >>> def foo(bar: dict[str, str, str]): pass ... >>> foo.__annotations__ {'bar': 'dict[str, str, str]'} ---------- messages: 397073 nosy: mthe priority: normal severity: normal status: open title: dict with more than two type parameters doesn't raise a TypeError type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:38:26 2021 From: report at bugs.python.org (Alex Hall) Date: Wed, 07 Jul 2021 11:38:26 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625657906.41.0.218315309532.issue44576@roundup.psfhosted.org> Alex Hall added the comment: I believe this is the outcome of https://bugs.python.org/issue39316 which I filed, so I'm pulling in . Naturally I think the new behaviour is not a bug but a feature. I think it's more important for the traceback to show the attribute access (`two`) than the value (`one`). That's what the frame was doing at the time which led to the error. The difference becomes even more important when calling a method with no arguments. Given this script: class A: def b(self): 1 / 0 x = ( A() .b() ) The 3.9 traceback points to the line with `A()` in the `` frame, while 3.10 correctly points to `.b()`, which makes the following line 'in b' make more sense. Where the old behaviour has really gotten to me is when I run the pycharm debugger and put a breakpoint on the .b() line and it never gets hit. Not being sure what lines 'count', I sometimes defensively put breakpoints on a cluster of lines, then spend more time removing them later. Having that fixed in 3.10 is great. ---------- components: +Interpreter Core nosy: +Mark.Shannon, alexmojaki type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 07:39:00 2021 From: report at bugs.python.org (Alex Hall) Date: Wed, 07 Jul 2021 11:39:00 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625657940.07.0.280024586729.issue44576@roundup.psfhosted.org> Alex Hall added the comment: (meant to say "so I'm pulling in @Mark.Shannon) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 08:11:29 2021 From: report at bugs.python.org (sfmc) Date: Wed, 07 Jul 2021 12:11:29 +0000 Subject: [issue44579] shutil.copy() inefficient implementation in Windows Message-ID: <1625659889.31.0.269732165644.issue44579@roundup.psfhosted.org> New submission from sfmc : In Windows shutil.copy() uses _copyfileobj_readinto which copies file in user mode. In Windows there is an fast API to copy file in kernel mode: CopyFile (see https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfile). ---------- components: Library (Lib) messages: 397076 nosy: sfmc priority: normal severity: normal status: open title: shutil.copy() inefficient implementation in Windows type: performance versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 08:31:11 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 07 Jul 2021 12:31:11 +0000 Subject: [issue44579] shutil.copy() inefficient implementation in Windows In-Reply-To: <1625659889.31.0.269732165644.issue44579@roundup.psfhosted.org> Message-ID: <1625661071.6.0.223851209332.issue44579@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 08:53:57 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Jul 2021 12:53:57 +0000 Subject: [issue44579] shutil.copy() inefficient implementation in Windows In-Reply-To: <1625659889.31.0.269732165644.issue44579@roundup.psfhosted.org> Message-ID: <1625662437.87.0.578670660254.issue44579@roundup.psfhosted.org> Eryk Sun added the comment: > In Windows there is an fast API to copy file in kernel mode: CopyFile The possibility of calling CopyFileEx() for shutil.copy2() is discussed in issue 30044. Note that CopyFileEx() is a high-level Windows API function, not a "kernel mode" copy. It opens the source and destination files and makes multiple system calls in order to copy file data and metadata (e.g. system calls such as NtOpenFile, NtCreateFile, NtReadFile, NtWriteFile, NtQueryInformationFile, NtSetInformationFile, NtQueryEaFile, NtSetEaFile, NtQuerySecurityObject, etc). This includes copying the primary data stream, alternate data streams, file attributes, extended file attributes, and security resource attributes. ---------- components: -Windows nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:00:39 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Jul 2021 13:00:39 +0000 Subject: [issue44577] Probably defect in Python 3.7.11 In-Reply-To: <1625652920.8.0.16553812104.issue44577@roundup.psfhosted.org> Message-ID: <1625662839.36.0.158392401511.issue44577@roundup.psfhosted.org> Eric V. Smith added the comment: Can you provide a short code example that reproduces this, preferably without using any third party libraries? ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:21:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 13:21:14 +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: <1625664074.26.0.836747487202.issue44530@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8363c53369a582ff9ae4e797a80cdce12624a278 by Pablo Galindo in branch 'main': bpo-44530: Document the new CodeObject.co_qualname attribute (GH-27052) https://github.com/python/cpython/commit/8363c53369a582ff9ae4e797a80cdce12624a278 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:26:23 2021 From: report at bugs.python.org (Michael) Date: Wed, 07 Jul 2021 13:26:23 +0000 Subject: [issue44578] dict with more than two type parameters doesn't raise a TypeError In-Reply-To: <1625657874.87.0.018743781602.issue44578@roundup.psfhosted.org> Message-ID: <1625664383.05.0.918193310726.issue44578@roundup.psfhosted.org> Michael added the comment: Same for list btw Python 3.9.6 (default, Jul 7 2021, 11:41:04) [Clang 12.0.5 (clang-1205.0.22.9)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> list[str, str, str] list[str, str, str] >>> from typing import List >>> List[str, str, str] Traceback (most recent call last): File "", line 1, in File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 275, in inner return func(*args, **kwds) File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 828, in __getitem__ _check_generic(self, params, self._nparams) File "/Users/michaelthe/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 212, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};" TypeError: Too many parameters for typing.List; actual 3, expected 1 >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:26:46 2021 From: report at bugs.python.org (Michael) Date: Wed, 07 Jul 2021 13:26:46 +0000 Subject: [issue44578] dict/list with more than two type parameters doesn't raise a TypeError In-Reply-To: <1625657874.87.0.018743781602.issue44578@roundup.psfhosted.org> Message-ID: <1625664406.7.0.703044888593.issue44578@roundup.psfhosted.org> Change by Michael : ---------- title: dict with more than two type parameters doesn't raise a TypeError -> dict/list with more than two type parameters doesn't raise a TypeError _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:28:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Jul 2021 13:28:27 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625664507.53.0.777695686194.issue44558@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 6bd3ecfc272b122b55a6adec50dd7a7c868f262f by Rupert Tombs in branch 'main': bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007) https://github.com/python/cpython/commit/6bd3ecfc272b122b55a6adec50dd7a7c868f262f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:28:25 2021 From: report at bugs.python.org (Hayden Clark) Date: Wed, 07 Jul 2021 13:28:25 +0000 Subject: [issue44580] pprint does not work for typing.Mapping Message-ID: <1625664505.94.0.691347848002.issue44580@roundup.psfhosted.org> Change by Hayden Clark : ---------- components: Library (Lib) nosy: hclark priority: normal severity: normal status: open title: pprint does not work for typing.Mapping type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:28:27 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Jul 2021 13:28:27 +0000 Subject: [issue44558] operator.countOf `is` / `==` inconsistency In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625664507.36.0.880777878257.issue44558@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25609 pull_request: https://github.com/python/cpython/pull/27053 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:29:11 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 13:29:11 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625664551.42.0.804344113391.issue44575@roundup.psfhosted.org> ?????????? ?????? added the comment: Why does it have to be so complicated? What is the rationale behind prohibiting different patches in separate folders? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:29:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Jul 2021 13:29:46 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625664586.75.0.320828213021.issue44558@roundup.psfhosted.org> Change by Dong-hee Na : ---------- assignee: docs at python -> corona10 components: -Documentation title: operator.countOf `is` / `==` inconsistency -> Make the implementation consistency of operator.countOf/indexOf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:32:09 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 13:32:09 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625664729.59.0.328323676939.issue44572@roundup.psfhosted.org> ?????????? ?????? added the comment: Well, I opened pull request, but it was closed. You guys have a very good team work going on out there :) Good luck! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:33:00 2021 From: report at bugs.python.org (Hayden Clark) Date: Wed, 07 Jul 2021 13:33:00 +0000 Subject: [issue44580] pprint does not work for typing.Mapping Message-ID: <1625664780.74.0.537123380047.issue44580@roundup.psfhosted.org> New submission from Hayden Clark : If you make a user-defined type that inherits from typing.Mapping (which is an alias for collections.abc.Mapping), pprint does not dump the contents, it just treats it as an unknown class. Examining the code, it is explicitly checking for "dict" type, even though it is only reading the data. Here is a reproduction: from typing import Mapping from pprint import pprint class MyMap(Mapping): def __init__(self, **kwargs) -> None: self.data = { k:v for k, v in kwargs.items() } def __getitem__(self, k): return self.data.get(k) def __len__(self): return self.data.__len__() def __iter__(self): return self.data.__iter__() info = MyMap( foo="bar", baz=MyMap(bar="foo") ) pprint(info) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:45:03 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 07 Jul 2021 13:45:03 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625665503.84.0.37956644035.issue44572@roundup.psfhosted.org> Zachary Ware added the comment: The pull request you opened was invalid, because it was just trying to merge the `main` branch of the python/cpython repository into the `3.9` branch. What we need instead is a pull request between a branch from `main` in your own fork of python/cpython with the change you want to see in a new commit. You can find a more detailed walkthrough in the devguide, or if you prefer to leave it for someone else to do that is also a valid option :) ---------- keywords: +3.9regression -patch stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:50:55 2021 From: report at bugs.python.org (Rupert Tombs) Date: Wed, 07 Jul 2021 13:50:55 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625665855.94.0.440876638561.issue44558@roundup.psfhosted.org> Change by Rupert Tombs : ---------- pull_requests: +25610 pull_request: https://github.com/python/cpython/pull/27054 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:50:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 07 Jul 2021 13:50:50 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625665850.87.0.465654824608.issue44558@roundup.psfhosted.org> miss-islington added the comment: New changeset 9f431dd0a59c9ac2de46772a4dbd7db2199ef26a by Miss Islington (bot) in branch '3.10': bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007) https://github.com/python/cpython/commit/9f431dd0a59c9ac2de46772a4dbd7db2199ef26a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 09:51:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Jul 2021 13:51:27 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625665887.78.0.421569973419.issue44558@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25611 pull_request: https://github.com/python/cpython/pull/27055 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:02:17 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Jul 2021 14:02:17 +0000 Subject: [issue42878] urllib.request.HTTPPasswordMgr.is_suburi does not care about order In-Reply-To: <1610227417.16.0.538971054996.issue42878@roundup.psfhosted.org> Message-ID: <1625666537.6.0.752071145687.issue42878@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: -gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:23:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 14:23:54 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625667834.4.0.28658076485.issue44570@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:24:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 14:24:09 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625667849.62.0.679467734513.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Mark, please take a look as beta4 is this week ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:24:45 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 07 Jul 2021 14:24:45 +0000 Subject: [issue44578] dict/list with more than two type parameters doesn't raise a TypeError In-Reply-To: <1625657874.87.0.018743781602.issue44578@roundup.psfhosted.org> Message-ID: <1625667885.74.0.643087607567.issue44578@roundup.psfhosted.org> Ken Jin added the comment: Sorry, I don't think this will be fixed as it is intentional. types.GenericAlias (the type of list[int] or dict[str, str]) does almost 0 checking for two reasons IIUC: - Types with wrong number of parameters will usually be caught by your IDE/type checker. - Checking would add complexity and slow down runtime performance. The current implementation of GenericAlias in C is intentionally simple. We can add a note in the docs noting that too many type parameters won't raise a TypeError. It would probably be here https://docs.python.org/3/library/stdtypes.html#generic-alias-type BTW, I adjusted the issue's affected versions because this was introduced only in 3.9. ---------- nosy: +gvanrossum, kj versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:30:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 14:30:28 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625668228.5.0.447913126433.issue44576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Mark, take a look as soon as possible as beta4 is this week ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:31:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Jul 2021 14:31:57 +0000 Subject: [issue44581] Interpreter can execute quickened opcodes in tracing mode Message-ID: <1625668317.03.0.495409770321.issue44581@roundup.psfhosted.org> New submission from Mark Shannon : This breaks a key invariant of PEP 659. Inserting `assert(cframe.use_tracing == 0);` at the top of all quickened instructions results in several failures when running the test suite. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 397090 nosy: Mark.Shannon, kj priority: normal severity: normal stage: needs patch status: open title: Interpreter can execute quickened opcodes in tracing mode type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:32:41 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 14:32:41 +0000 Subject: [issue44579] shutil.copy() inefficient implementation in Windows In-Reply-To: <1625659889.31.0.269732165644.issue44579@roundup.psfhosted.org> Message-ID: <1625668361.27.0.282813795156.issue44579@roundup.psfhosted.org> Steve Dower added the comment: > Note that CopyFileEx() is a high-level Windows API function, not a "kernel mode" copy. This is true today, but could change whenever Windows feels like changing it. If we switch to the native API then we'll get any advantage there automatically. The only challenge is in managing changes to semantics (that is, anything extra we do to "match" Unix that isn't normally how copies work on Windows - personally, I'd rather be more native on Windows anyway). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:33:32 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 07 Jul 2021 14:33:32 +0000 Subject: [issue44578] dict/list with more than two type parameters doesn't raise a TypeError In-Reply-To: <1625657874.87.0.018743781602.issue44578@roundup.psfhosted.org> Message-ID: <1625668412.6.0.260880856533.issue44578@roundup.psfhosted.org> Guido van Rossum added the comment: Yes this is intentional. Use a static checker to find this type of bug. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:35:03 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 14:35:03 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625668503.15.0.0812361623912.issue44575@roundup.psfhosted.org> Steve Dower added the comment: > Why does it have to be so complicated? What is the rationale behind prohibiting different patches in separate folders? Most users don't want different patches in separate folders - they want to update to the latest and greatest and use it everywhere. Those users who *do* want different versions tend to be well-informed enough to figure out alternatives. You can also grab the packages from https://www.nuget.org/packages/python/ which can be extracted anywhere you like and are not stripped down like the embeddable package. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:38:46 2021 From: report at bugs.python.org (Vladislav Kozlenko) Date: Wed, 07 Jul 2021 14:38:46 +0000 Subject: [issue44577] Probably defect in Python 3.7.11 In-Reply-To: <1625652920.8.0.16553812104.issue44577@roundup.psfhosted.org> Message-ID: <1625668726.58.0.590156098931.issue44577@roundup.psfhosted.org> Vladislav Kozlenko added the comment: It will be not easy as I'll need to create some sandbox for you. The current code version is not available for sharing. But ok. For example here is a routing.py file: from django.conf.urls import url from channels.routing import ProtocolTypeRouter, URLRouter from channels.security.websocket import AllowedHostsOriginValidator from channels.auth import AuthMiddlewareStack from some_dir import MyConsumer application = ProtocolTypeRouter({ 'websocket': AllowedHostsOriginValidator( AuthMiddlewareStack( URLRouter([ url('api/socket/end-point-1', MyConsumer), ]) ) ) }) Let me know if you need more information ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:39:41 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 07 Jul 2021 14:39:41 +0000 Subject: [issue44579] shutil.copy() inefficient implementation in Windows In-Reply-To: <1625659889.31.0.269732165644.issue44579@roundup.psfhosted.org> Message-ID: <1625668781.53.0.472347285927.issue44579@roundup.psfhosted.org> Change by Eryk Sun : ---------- components: +Windows -Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:55:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Jul 2021 14:55:38 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625669738.34.0.796019704223.issue44558@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 9761abf30617946a374886184b0e36ec050dd8d7 by Dong-hee Na in branch '3.9': [3.9] bpo-44558: Match countOf `is`/`==` treatment to c (GH-27007). (GH-27055) https://github.com/python/cpython/commit/9761abf30617946a374886184b0e36ec050dd8d7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:56:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 07 Jul 2021 14:56:14 +0000 Subject: [issue44558] Make the implementation consistency of operator.countOf/indexOf In-Reply-To: <1625333115.02.0.937139406208.issue44558@roundup.psfhosted.org> Message-ID: <1625669774.16.0.886565339442.issue44558@roundup.psfhosted.org> Dong-hee Na added the comment: Thank you Rupert for reporting and contributing!! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 10:58:56 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 07 Jul 2021 14:58:56 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625669936.07.0.188002853118.issue44576@roundup.psfhosted.org> Mark Shannon added the comment: This is a tricky one. Which is the "correct" line appears to be subjective. I'm inclined to leave it as is, as the tracing sequence seems better in the case of method chaining. See https://github.com/python/cpython/blob/main/Lib/test/test_compile.py#L890 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:03:03 2021 From: report at bugs.python.org (Andre Roberge) Date: Wed, 07 Jul 2021 15:03:03 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625670183.51.0.166958496171.issue44576@roundup.psfhosted.org> Andre Roberge added the comment: While I filed the original report, I am in agreement that accurate information for debugging tools is definitely more important than the quick summary shown in the traceback, and that the change likely represents an improvement in situations more realistic than the contrived example I gave. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:13:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 15:13:35 +0000 Subject: [issue43191] Shared Memory for array of object In-Reply-To: <1612952024.75.0.333597228356.issue43191@roundup.psfhosted.org> Message-ID: <1625670815.91.0.708270287866.issue43191@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:20:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 15:20:01 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625671201.97.0.332811241088.issue44576@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I'm inclined to leave it as is I am fine with that, if you think this is not a bug, close the issue and remove the release blocker :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:27:18 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 15:27:18 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625671638.24.0.0639110016719.issue44575@roundup.psfhosted.org> ?????????? ?????? added the comment: Unfortunately I am not so enlightened to figure out how to do it on my own, and python.org obviously wants to keep it secret. I am also not on a friendly basis with kami-sama and don't know what other users want, but the common sense tells me that having an option to do do something should not hurt anyone. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:32:56 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 15:32:56 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625671976.47.0.297716295163.issue44572@roundup.psfhosted.org> ?????????? ?????? added the comment: I do not understand why a one line change in the code requires full blown git clone. Shouldn't you guys have a system that allows to change code over the web interface and your bots will do the rest: checks, tests, regressions, etc.? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:43:06 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 07 Jul 2021 15:43:06 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625672586.87.0.0871927983208.issue44479@roundup.psfhosted.org> Ken Jin added the comment: @Steve, after this change, the Azure Pipelines commit CI's appx tests started failing on main and 3.10. https://dev.azure.com/Python/cpython/_build/results?buildId=83619&view=results ====================================================================== FAIL: test_printer_buttons (idlelib.idle_test.test_help_about.LiveDialogTest) (name='license') Test buttons whose commands use printer function. ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\b\layout-appx-win32\lib\idlelib\idle_test\test_help_about.py", line 65, in test_printer_buttons self.fail(name + ' full text was not found') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: license full text was not found It seems that idlelib's license isn't included in that specific build. FWIW, I can't repro this on my own machine. Though I recall you explaining that appx has some differences in another issue. Please take a look if you have the time. Thanks in advance! ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:47:42 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 07 Jul 2021 15:47:42 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1625672862.5.0.802028657442.issue44572@roundup.psfhosted.org> Zachary Ware added the comment: You can make a PR entirely through the Github web interface, though we do generally encourage running the tests locally, especially since it would be good to add a new test for this case. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 11:47:58 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 07 Jul 2021 15:47:58 +0000 Subject: [issue44145] hmac.update is not releasing the GIL when openssl's hmac is used In-Reply-To: <1621148044.4.0.215662666673.issue44145@roundup.psfhosted.org> Message-ID: <1625672878.63.0.489535786839.issue44145@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 Wed Jul 7 12:45:14 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 16:45:14 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625676314.95.0.661886657121.issue44479@roundup.psfhosted.org> Steve Dower added the comment: Didn't even realise we had a test for it. Maybe it only runs in install-like layouts? I'll simplify the regeneration by just doing it every time. Nothing else depends on the license file, so it won't matter if we touch it unnecessarily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 12:45:36 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 16:45:36 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625676336.38.0.202758220547.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25612 pull_request: https://github.com/python/cpython/pull/27056 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 13:22:01 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 17:22:01 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625678521.9.0.286820310771.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3d3027c5fcc683c14ee55ad231d79971ba12b24d by Steve Dower in branch 'main': bpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056) https://github.com/python/cpython/commit/3d3027c5fcc683c14ee55ad231d79971ba12b24d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 13:26:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 17:26:42 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625678802.93.0.933210275936.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25613 pull_request: https://github.com/python/cpython/pull/27058 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 14:28:48 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 18:28:48 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625682528.74.0.491564295367.issue44575@roundup.psfhosted.org> Steve Dower added the comment: You found your way to the issue tracker where we can help, which is more enlightened than most of our other ~20 million users :) Nuget allows you to download the packages directly. Go to the page I linked and choose your version, then find the download link. They have a bit more structure in the ZIP file than just a Python runtime, to enable them to interoperate properly with a Nuget-based build system (relatively common on Windows these days), but you can move the contents around however you like. And unfortunately, any "options" are not free. Someone has to develop, document, test, maintain and support it, and everyone who's been willing to do it has chosen to do it independently from the core team (which is great! CPython is free open-source software for exactly that reason). Perhaps Anaconda would suit your needs better? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 14:35:59 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 18:35:59 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1625682959.9.0.646727834746.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset f2491c647937fc0871a473c19e3d5cb5392cfca0 by Steve Dower in branch '3.10': bpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056) https://github.com/python/cpython/commit/f2491c647937fc0871a473c19e3d5cb5392cfca0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 14:59:14 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Wed, 07 Jul 2021 18:59:14 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625682528.74.0.491564295367.issue44575@roundup.psfhosted.org> Message-ID: ?????????? ?????? added the comment: Hi Steve, Thank you for taking time to reply. I do appreciate it. I did try nuget installs but they a little bit weird for my taste. Anaconda is too bloated. I also tried python-webinstall.exe /layout and install from .msi, these work OK for the command line use, but do not work with Vim plugins for some reason, so I cannot rely on them as I can on a normal Windows install. As a side note, I think making the install restrictive is more work than just let it install where user wants to install. The restrictions need to be coded - don't they? :) Konstantin ??, 8 ???. 2021 ?. ? 03:28, Steve Dower : > > Steve Dower added the comment: > > You found your way to the issue tracker where we can help, which is more > enlightened than most of our other ~20 million users :) > > Nuget allows you to download the packages directly. Go to the page I > linked and choose your version, then find the download link. They have a > bit more structure in the ZIP file than just a Python runtime, to enable > them to interoperate properly with a Nuget-based build system (relatively > common on Windows these days), but you can move the contents around however > you like. > > And unfortunately, any "options" are not free. Someone has to develop, > document, test, maintain and support it, and everyone who's been willing to > do it has chosen to do it independently from the core team (which is great! > CPython is free open-source software for exactly that reason). Perhaps > Anaconda would suit your needs better? > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 15:07:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 19:07:20 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1625684840.87.0.764990556068.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7 by Ammar Askar in branch 'main': bpo-43950: Add option to opt-out of PEP-657 (GH-27023) https://github.com/python/cpython/commit/4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:06:39 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 20:06:39 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows Message-ID: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> New submission from Steve Dower : mimetypes.init is slow on Windows because of the big registry search, which involves touching thousands of entries in order to add a few hundred into the initial table. Things get even worse when audit hooks are enabled, because the winreg methods need to be hooked. However, we know that this particular operation is coming from core, and so we could skip these hooks. Both issues can be trivially solved (helped) with a native accelerator function. ---------- assignee: steve.dower messages: 397110 nosy: steve.dower priority: normal severity: normal status: open title: Accelerate mimetypes.init on Windows type: performance versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:12:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 20:12:21 +0000 Subject: [issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile() In-Reply-To: <1609228261.66.0.888283704166.issue42778@roundup.psfhosted.org> Message-ID: <1625688741.51.0.253606874677.issue42778@roundup.psfhosted.org> Andrei Kulakov added the comment: Looks like this issue can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:20:21 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 20:20:21 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625689221.61.0.65920695461.issue44582@roundup.psfhosted.org> Change by Steve Dower : ---------- keywords: +patch pull_requests: +25614 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27059 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:20:45 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 20:20:45 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625689245.28.0.260970996174.issue44582@roundup.psfhosted.org> Change by Steve Dower : ---------- components: +Windows nosy: +paul.moore, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:25:40 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 07 Jul 2021 20:25:40 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625689540.06.0.36082186794.issue44575@roundup.psfhosted.org> Eric V. Smith added the comment: > As a side note, I think making the install restrictive is more work than just let it install where user wants to install. The restrictions need to be coded - don't they? :) Well at this point, the restrictions already exist! So change it now is the expensive part. And having two ways to do something will always be more complicated than one way. We can't abandon the existing installation methods. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:40:12 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 20:40:12 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625690412.22.0.865002550362.issue44582@roundup.psfhosted.org> Steve Dower added the comment: It's only a rough benchmark, but my timings for `python -c "import mimetypes; mimetypes.init()` were ~200ms without the accelerator and ~100ms with the accelerator. Since that includes all of startup, it's actually a better than 50% reduction for mimetypes.init(). I'm happy to take that without questioning precisely how much better it is ;) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:43:16 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 20:43:16 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625690596.44.0.00118782136569.issue44582@roundup.psfhosted.org> Steve Dower added the comment: mimetypes doesn't _really_ support clearing, but `python.exe -m timeit "import mimetypes as M; M.types_map.clear(); M.init()"` is pretty close. Without the accelerator: 133ms With the accelerator: 27.8ms ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 16:45:59 2021 From: report at bugs.python.org (Skip Montanaro) Date: Wed, 07 Jul 2021 20:45:59 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1625690759.2.0.835484054459.issue43941@roundup.psfhosted.org> Skip Montanaro added the comment: I routinely build with -O0 and have been getting test_gdb failures building the 3.10 branch. I tried adding -g3 to my configure flags: nice ./configure OPT="-O0 -g3 -Wall" --with-pydebug --with-trace-refs but test_gdb still fails. Output attached. Note that I have been getting CRC mismatches between a couple files. They are copious in the test output, so I won't elaborate here. ---------- nosy: +skip.montanaro Added file: https://bugs.python.org/file50140/test_gdb.out _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 17:09:23 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 21:09:23 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625692163.72.0.255997087419.issue44575@roundup.psfhosted.org> Steve Dower added the comment: Some quotes from my reply to an off-list email that may be useful for other people who encounter this issue: --- Apps that use Python-based plugins we can't make Just Work - it's up to the host application to work with Python installs (or to bundle its own, which is easier on Windows). We're happy to help the people who can fix it on their side if you know who to work with. Rather than developing our own installer, it's actually less effort to use the standard Windows Installer service to manage installs, and that's the system with the restrictions. Coding something from scratch that supports the equivalent upgrade/repair/uninstall mechanisms would be considerably more work, and we'd end up basically reimplementing it or end up regularly recommending people try and delete everything by hand. We also support the newer Windows MSIX format via the Store, because that's even less work and is a better experience for most users. Unfortunately, it's even further away from what you want. If your preferences are so strong, you may need to do your own builds and manually put them where you need. The Nuget packages will let you skip the compile step, and the regular ones will let you also skip the "put them where you need" step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 17:10:32 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 07 Jul 2021 21:10:32 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625692232.15.0.486352351201.issue44575@roundup.psfhosted.org> Steve Dower added the comment: Huh, interesting that the email reply is identical to the one above from ??????????, but the email I received had no reference to bpo in it... Okay, consider my reply above identical to the one I sent off list :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 17:17:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 21:17:40 +0000 Subject: [issue43153] tempfile seems to treat a file as a directory when processing an exception in the onerror() In-Reply-To: <1612691564.38.0.627288937354.issue43153@roundup.psfhosted.org> Message-ID: <1625692660.6.0.181885947679.issue43153@roundup.psfhosted.org> Andrei Kulakov added the comment: This is a duplicate of https://bugs.python.org/issue43219 . ---------- nosy: +andrei.avk versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 17:18:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 07 Jul 2021 21:18:58 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625692738.27.0.269996407132.issue43219@roundup.psfhosted.org> Andrei Kulakov added the comment: Note that someone else ran into this confusion here: https://bugs.python.org/issue43153 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 18:31:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 07 Jul 2021 22:31:32 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1625697092.76.0.868995453503.issue43941@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Skip: I am still unable to reproduce in my machine unfortunately. Could you maybe bisect the failures if you can reliably reproduce the problem so we can at least narrow it down to one commit? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 19:03:14 2021 From: report at bugs.python.org (Skip Montanaro) Date: Wed, 07 Jul 2021 23:03:14 +0000 Subject: [issue43941] Unit test failure in test_gdb only with -O0 In-Reply-To: <1619413336.26.0.680975027921.issue43941@roundup.psfhosted.org> Message-ID: <1625698994.79.0.376215401768.issue43941@roundup.psfhosted.org> Skip Montanaro added the comment: Unfortunately, I'm currently not able to build Python 3.8, 3.9 or 3.10 and get a non-failing test_gdb. I'll mess around a bit more, but I'm skeptical I'll find something simple. (I wonder if something changed in GDB which is causing the failure.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 19:26:14 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 07 Jul 2021 23:26:14 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1625700374.61.0.519120333197.issue43895@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset fed2fc4443235fa9669b73817827fd6da88e3417 by Ian Henriksen in branch 'main': bpo-43895: Remove an unnecessary cache of shared object handles (GH-25487) https://github.com/python/cpython/commit/fed2fc4443235fa9669b73817827fd6da88e3417 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 19:26:50 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 07 Jul 2021 23:26:50 +0000 Subject: [issue43895] Unnecessary Cache of Shared Object Handles In-Reply-To: <1618938051.55.0.304648722652.issue43895@roundup.psfhosted.org> Message-ID: <1625700410.35.0.925986564826.issue43895@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks Ian! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 22:08:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 02:08:03 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1625710083.5.0.666515920355.issue43126@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25615 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27061 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 22:11:17 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 02:11:17 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1625710277.17.0.0439030781904.issue43126@roundup.psfhosted.org> Andrei Kulakov added the comment: Thanks for the report! I agree docs could be improved. Note this method lives in `IOBase` so this behavior also applies to the file pointer returned from `open()` builtin. I've put up the PR here: https://github.com/python/cpython/pull/27061/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 7 23:41:02 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Thu, 08 Jul 2021 03:41:02 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625715662.26.0.914510612252.issue11343@roundup.psfhosted.org> Terry J. Reedy added the comment: I retract my original comment as I now agree with SyntaxError + distinct message. Given Irit's report, I think the remaining question is whether A. The implication that 'too many nested parentheses' is compiler specific is strong enough, and any thing further should be left to 3rd parties to explain, and this issue should be closed as 'out of date'. B. We should be explicit and add something like 'for this compiler'. Since Pablo has been working on improving error messages, I would give his opinion high weight. To find the actual limit, I did the following with Win 10, 3.10.0b3, IDLE: >>> def f(n): ... print(eval('('*n + ')'*n")) ... And after some trials, found >>> f(200) () >>> f(201) Traceback (most recent call last): File "", line 1, in f(201) File "", line 2, in f print(eval('('*n + ')'*n)) File "", line 1 ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ^ SyntaxError: too many nested parentheses The error is detected in 'string' line 1, 1-based offset 201, at the final '('. There are 200 spaces before the caret but they are not obvious in this box, which does not wrap spaces properly. The end_lineno and end_offset are None, None rather than the 1,202 I expected. ---------- nosy: +aroberge, pablogsal stage: patch review -> needs patch versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 02:37:21 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Thu, 08 Jul 2021 06:37:21 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625726241.32.0.289914859288.issue44575@roundup.psfhosted.org> ?????????? ?????? added the comment: After reviewing all the suggested options of the "versioned" Windows install I came to the conclusion that the "NuGet" path is the easiest. Assuming x - version, y - patch number, the following steps work 1. Unzip 'Tools' folder of the NuGet archive into Python\3xy 2. Re-install pip to add pip.exe to Python\3xy\Scripts 3xy\python.exe -m pip install -U pip --force-reinstall It works like a regular install after that. Switching between versions can be done via a symbolic link: cmd /c mklink /d 3x 3xy Optional: Add Python\3x\Scripts;Python\3x to the PATH env variable. ---------- resolution: -> works for me _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 02:46:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 08 Jul 2021 06:46:34 +0000 Subject: [issue42778] Add follow_symlinks=True parameter to both os.path.samefile() and Path.samefile() In-Reply-To: <1609228261.66.0.888283704166.issue42778@roundup.psfhosted.org> Message-ID: <1625726794.88.0.45648391076.issue42778@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 03:16:30 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Jul 2021 07:16:30 +0000 Subject: [issue41137] pdb uses the locale encoding for .pdbrc In-Reply-To: <1593242595.67.0.594029276449.issue41137@roundup.psfhosted.org> Message-ID: <1625728590.8.0.284499138258.issue41137@roundup.psfhosted.org> Inada Naoki added the comment: New changeset 58248d94379b202ccce3e45b1d1830ca47683273 by Srinivas Reddy Thatiparthy (?????????? ?????? ?????????) in branch 'main': bpo-41137: Use utf-8 encoding while reading .pdbrc files (GH-21263) https://github.com/python/cpython/commit/58248d94379b202ccce3e45b1d1830ca47683273 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 03:16:25 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 08 Jul 2021 07:16:25 +0000 Subject: [issue41137] pdb uses the locale encoding for .pdbrc In-Reply-To: <1593242595.67.0.594029276449.issue41137@roundup.psfhosted.org> Message-ID: <1625728585.04.0.482966194569.issue41137@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 04:04:32 2021 From: report at bugs.python.org (Jay Krell) Date: Thu, 08 Jul 2021 08:04:32 +0000 Subject: [issue44583] Failure to build on OSF1. Message-ID: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> New submission from Jay Krell : Python fails to compile on OSF1. I have it about working. (I have Python2 already working.) I'm opening an issue to meet the PR guidelines. ---------- components: Interpreter Core messages: 397128 nosy: jaykrell priority: normal severity: normal status: open title: Failure to build on OSF1. type: compile error versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 04:05:45 2021 From: report at bugs.python.org (Jay Krell) Date: Thu, 08 Jul 2021 08:05:45 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1625731545.79.0.681331235511.issue44583@roundup.psfhosted.org> Change by Jay Krell : ---------- keywords: +patch pull_requests: +25616 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27063 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 04:10:27 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 08:10:27 +0000 Subject: [issue44576] AttributeError: incorrect line identified in Python 3.10 In-Reply-To: <1625649836.78.0.756397616199.issue44576@roundup.psfhosted.org> Message-ID: <1625731827.42.0.301764473225.issue44576@roundup.psfhosted.org> Change by Mark Shannon : ---------- priority: release blocker -> resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 04:39:39 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 08:39:39 +0000 Subject: [issue44581] Interpreter can execute quickened opcodes in tracing mode In-Reply-To: <1625668317.03.0.495409770321.issue44581@roundup.psfhosted.org> Message-ID: <1625733579.55.0.367968530627.issue44581@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25617 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27064 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 05:20:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 09:20:09 +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: <1625736009.32.0.398074587465.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: I started "Does anyone use threading debug PYTHONTHREADDEBUG=1 env var? Can I remove it?" thread on python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/NMLGCDRUKLZSTK4UICJTKR54WRXU2ZGJ/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 05:23:09 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 09:23:09 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 Message-ID: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> New submission from STINNER Victor : Copy of my email to python-dev: https://mail.python.org/archives/list/python-dev at python.org/thread/NMLGCDRUKLZSTK4UICJTKR54WRXU2ZGJ/ Hi, Does anyone use threading debug PYTHONTHREADDEBUG=1 env var on a Python debug build? If not, can I just remove it? -- To fix a race condition at thread exit on Linux using the glibc, I removed calls to pthread_exit() (PyThread_exit_thread()) in the _thread module: https://bugs.python.org/issue44434 A side effect of this change is the removal of the "PyThread_exit_thread called" threading debug log when using PYTHONTHREADDEBUG=1 environment variable. I never used PYTHONTHREADDEBUG. I just tried it and it produces tons of output in stdout about locks. It looks basically useless because it produces way too many logs, and it pollutes stdout (ex: most Python tests fail when it's enabled). This debug mode requires to build Python in debug mode (./configure --with-pydebug): https://docs.python.org/dev/using/configure.html#python-debug-build IMO there are enough external debugging tools to debug threading issues. Python no longer has to come with its built-in logs. I propose to deprecate the feature in Python 3.11 and remove it in 2 releases (Python 3.13). Victor ---------- components: Interpreter Core messages: 397130 nosy: vstinner priority: normal severity: normal status: open title: Deprecate thread debugging PYTHONTHREADDEBUG=1 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 05:24:31 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 09:24:31 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1625736271.31.0.528975617093.issue44584@roundup.psfhosted.org> STINNER Victor added the comment: I never ever used PYTHONTHREADDEBUG=1. I just tried: --- $ PYTHONTHREADDEBUG=1 ./python -m test -v test_sys PyThread_init_thread called PyThread_allocate_lock() -> 0x1f212c0 PyThread_allocate_lock called PyThread_allocate_lock() -> 0x1f21300 PyThread_allocate_lock called PyThread_allocate_lock() -> 0x1f21340 PyThread_allocate_lock called PyThread_allocate_lock() -> 0x1f3ea70 PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1 PyThread_release_lock(0x1f212c0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1 PyThread_release_lock(0x1f212c0) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1 PyThread_release_lock(0x1f21340) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1 PyThread_release_lock(0x1f21340) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1 PyThread_release_lock(0x1f21340) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) called PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1 PyThread_release_lock(0x1f21340) called (...) ====================================================================== FAIL: test_changing_sys_stderr_and_removing_reference (test.test_sys.SizeofTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/vstinner/python/main/Lib/test/test_sys.py", line 1525, in test_changing_sys_stderr_and_removing_reference self.assertEqual(out, b"") ^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b'PyThread_init_thread called\nPyThread_all[59813 chars]ed\n' != b'' (...) PyThread_release_lock(0x2113660) called PyThread_free_lock(0x2113660) called PyThread_free_lock(0x7fc6e8001300) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1 PyThread_release_lock(0x1f212c0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1 PyThread_release_lock(0x1f212c0) called PyThread_free_lock(0x1f3ea70) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1 PyThread_release_lock(0x1f212c0) called PyThread_free_lock(0x1f212c0) called PyThread_free_lock(0x1f21300) called PyThread_free_lock(0x1f21340) called --- This debug mode produces so many logs that it looks basically useless :-( See also discussion at: https://github.com/python/cpython/pull/24241 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 05:25:04 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 09:25: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: <1625736304.5.0.191423734588.issue44434@roundup.psfhosted.org> STINNER Victor added the comment: I created bpo-44584: "Deprecate thread debugging PYTHONTHREADDEBUG=1". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 05:45:22 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 08 Jul 2021 09:45:22 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625737522.02.0.470129393791.issue11343@roundup.psfhosted.org> Andre Roberge added the comment: For information: I created an actual .py file from the last example with 200 parens and got the following error message: > python example.py s_push: parser stack overflow MemoryError For consistency and greater clarity, I think that having messages such as - SyntaxError: parser stack overflow (too many nested parenthesis) - SyntaxError: parser stack overflow (too many statistically nested blocks) and possibly others (too many arguments?), would be preferable, with the possibility of simply having - SyntaxError: parser stack overflow if the exact cause cannot be identified at the parsing stage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 06:28:01 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 10:28:01 +0000 Subject: [issue44584] Deprecate thread debugging PYTHONTHREADDEBUG=1 In-Reply-To: <1625736189.01.0.129279218782.issue44584@roundup.psfhosted.org> Message-ID: <1625740081.91.0.373059094578.issue44584@roundup.psfhosted.org> Change by STINNER Victor : ---------- keywords: +patch pull_requests: +25618 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27065 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 06:48:32 2021 From: report at bugs.python.org (STINNER Victor) Date: Thu, 08 Jul 2021 10:48: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: <1625741312.29.0.587053168864.issue43908@roundup.psfhosted.org> STINNER Victor added the comment: New changeset a3739b207adb5d17e3b53347df05b54b1a8b87f0 by Erlend Egeberg Aasland in branch 'main': bpo-43908: Immutable types inherit vectorcall (GH-27001) https://github.com/python/cpython/commit/a3739b207adb5d17e3b53347df05b54b1a8b87f0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 06:56:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 10:56:53 +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: <1625741813.14.0.433996376635.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Beta 4 is in a few days. Can someone confirm of this is fixed or if it still needs a patch? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 06:57:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 10:57:13 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625741833.42.0.12792521748.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Gentle ping as beta 4 is in 2 days ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 08:33:25 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 12:33:25 +0000 Subject: [issue44581] Interpreter can execute quickened opcodes in tracing mode In-Reply-To: <1625668317.03.0.495409770321.issue44581@roundup.psfhosted.org> Message-ID: <1625747605.89.0.437841298373.issue44581@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 514f76bbac386c320a9f3a70797241c612544391 by Mark Shannon in branch 'main': bpo-44581: Don't execute quickened instructions if tracing is on (GH-27064) https://github.com/python/cpython/commit/514f76bbac386c320a9f3a70797241c612544391 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 08:56:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 12:56:43 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625749003.14.0.266612955305.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- assignee: -> Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:13:28 2021 From: report at bugs.python.org (Marco E.) Date: Thu, 08 Jul 2021 13:13:28 +0000 Subject: [issue44585] csv library does not correctly interpret some files Message-ID: <1625750008.87.0.451821188518.issue44585@roundup.psfhosted.org> New submission from Marco E. : The CSV library does not correctly interpret files in the following format (test.csv): "A" ,"B" ,"C" "aaaaaa","bbbbbbb","cccc" "aaaaa" ,"bbbbbb" ,"ccc" "aaaa" ,"bbbbb" ,"cc" This program: import csv from pathlib import Path def main(): with Path('test.csv').open('rt') as csv_file: csv.register_dialect('my_dialect', quotechar='"', delimiter=',', quoting=csv.QUOTE_ALL, skipinitialspace=True) reader = csv.DictReader(csv_file, dialect='my_dialect') for row in reader: print(row) if __name__ == '__main__': main() produces the following output: {'A ': 'aaaaaa', 'B ': 'bbbbbbb', 'C': 'cccc'} {'A ': 'aaaaa ', 'B ': 'bbbbbb ', 'C': 'ccc'} {'A ': 'aaaa ', 'B ': 'bbbbb ', 'C': 'cc'} this instead is the expected result: {'A': 'aaaaaa', 'B': 'bbbbbbb', 'C': 'cccc'} {'A': 'aaaaa', 'B': 'bbbbbb', 'C': 'ccc'} {'A': 'aaaa', 'B': 'bbbbb', 'C': 'cc'} why? Thank you, Marco ---------- components: Library (Lib) messages: 397139 nosy: voidloop priority: normal severity: normal status: open title: csv library does not correctly interpret some files versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:12:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 13:12:56 +0000 Subject: [issue42464] Pathlib resolve() resolves non-existent ".." components with strict=False In-Reply-To: <1606320449.29.0.994355220822.issue42464@roundup.psfhosted.org> Message-ID: <1625749976.45.0.917715938051.issue42464@roundup.psfhosted.org> Andrei Kulakov added the comment: Adding a patch that fixes this issue, for future reference. I'm not too sure this would be the right way to solve this. The patch also causes 5 failures in test_posixpath.py that would have to be fixed (most likely all can be fixed by creating respective dirs). ---------- keywords: +patch nosy: +andrei.avk Added file: https://bugs.python.org/file50141/do_not_resolve_dotdot_nonexistent.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:21:36 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 13:21:36 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625750496.62.0.874804537905.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25619 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27066 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:24:32 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Thu, 08 Jul 2021 13:24:32 +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: <1625750672.9.0.669861712281.issue44446@roundup.psfhosted.org> Filipe La?ns added the comment: The issue that made the line number be missing is fixed, but GH-26781 is needed to account for 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, even though it is no longer triggered in this situation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:25:22 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Thu, 08 Jul 2021 13:25:22 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625750722.11.0.133964222955.issue44570@roundup.psfhosted.org> Sergey B Kirpichev added the comment: Pablo, it seems: the 3.10 branch as for https://github.com/nedbat/coveragepy/issues/1184#issuecomment-873506523 still has this issue - I can reproduce one. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 09:51:33 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 13:51:33 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625752293.12.0.481442406985.issue35815@roundup.psfhosted.org> Andrei Kulakov added the comment: Ethan: as far as I understand, there's no actual problem here. The report adds a print statement in __init_subclass__ that says that instance was created, while in fact instance is not created. I can confirm what Batuhan said, in my testing, that it fails with TypeError as expected: python3 ~/temp/a.py ----VICMD---- Created instance of easily: <__main__.Derived object at 0x106fbb9d0> Traceback (most recent call last): File "/Users/ak/temp/a.py", line 54, in Derived() TypeError: Can't instantiate abstract class Derived with abstract method do_something I think this can be closed as not a bug. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 10:13:52 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 14:13:52 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625753632.12.0.802617940614.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25620 pull_request: https://github.com/python/cpython/pull/27067 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 10:19:59 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 08 Jul 2021 14:19:59 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625753999.01.0.0601120387791.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25621 pull_request: https://github.com/python/cpython/pull/27068 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 10:30:01 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 14:30:01 +0000 Subject: [issue42464] Pathlib resolve() resolves non-existent ".." components with strict=False In-Reply-To: <1606320449.29.0.994355220822.issue42464@roundup.psfhosted.org> Message-ID: <1625754601.69.0.717355437691.issue42464@roundup.psfhosted.org> Andrei Kulakov added the comment: Another solution would be to base it on `strict` parameter: - strict=True, subpath exists => resolve `..` - strict=True, subpath doesn't exist => throw OSError - strict=False => never resolve `..` This would avoid extra `lstat()` calls but would be a much bigger change in terms of behavior. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 10:41:43 2021 From: report at bugs.python.org (Zachary Ware) Date: Thu, 08 Jul 2021 14:41:43 +0000 Subject: [issue44575] Windows installer prohibits different patches for the same version In-Reply-To: <1625632562.86.0.44439048835.issue44575@roundup.psfhosted.org> Message-ID: <1625755303.73.0.788288238601.issue44575@roundup.psfhosted.org> Change by Zachary Ware : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 11:03:09 2021 From: report at bugs.python.org (ma19) Date: Thu, 08 Jul 2021 15:03:09 +0000 Subject: [issue44586] unittest requires __init__.py for test discovery Message-ID: <1625756589.94.0.0608514933284.issue44586@roundup.psfhosted.org> New submission from ma19 : This is how my project is currently set up: src: - main.py - src1.py - src2.py test: - __init__.py - test_src1.py - test_src2.py If I remove __init__.py from the "test" directory, the unittest discovery fails. I thought that __init__.py was no longer required since Python 3.3. Will the test discovery be able to work without __init__.py in the future? ---------- components: Library (Lib) messages: 397144 nosy: ma19 priority: normal severity: normal status: open title: unittest requires __init__.py for test discovery type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 11:18:21 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Thu, 08 Jul 2021 15:18:21 +0000 Subject: [issue44586] unittest requires __init__.py for test discovery In-Reply-To: <1625756589.94.0.0608514933284.issue44586@roundup.psfhosted.org> Message-ID: <1625757501.38.0.607576593248.issue44586@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue23882 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 11:48:51 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 08 Jul 2021 15:48:51 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625759331.39.0.114393418306.issue44582@roundup.psfhosted.org> Steve Dower added the comment: New changeset bbf2fb6c7ae78f40483606f467739a58cd747270 by Steve Dower in branch 'main': bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059) https://github.com/python/cpython/commit/bbf2fb6c7ae78f40483606f467739a58cd747270 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 11:48:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Jul 2021 15:48:53 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625759333.19.0.342076424607.issue44582@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25622 pull_request: https://github.com/python/cpython/pull/27071 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:13:14 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 08 Jul 2021 16:13:14 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625760794.6.0.277590264889.issue44582@roundup.psfhosted.org> miss-islington added the comment: New changeset 08697ac5d1543fca3629c719ab43e50d73021631 by Miss Islington (bot) in branch '3.10': bpo-44582: Accelerate mimetypes.init on Windows with a native accelerator (GH-27059) https://github.com/python/cpython/commit/08697ac5d1543fca3629c719ab43e50d73021631 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:23:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:23:05 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625761385.25.0.0734519379683.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ned, I am reviewing today PR 27068 and PR 27067 but it would be a great help if you can confirm that **both** work for your cases and don't break anything else ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:28:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:28:10 +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: <1625761690.41.0.550301523611.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 91a8f8c16ca9a7e2466a8241d9b41769ef97d094 by Filipe La?ns in branch 'main': bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781) https://github.com/python/cpython/commit/91a8f8c16ca9a7e2466a8241d9b41769ef97d094 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:31:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:31:34 +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: <1625761894.96.0.0333806925081.issue44446@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25623 pull_request: https://github.com/python/cpython/pull/27072 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:36:37 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 08 Jul 2021 16:36:37 +0000 Subject: [issue23882] unittest discovery doesn't detect namespace packages when given no parameters In-Reply-To: <1428406596.02.0.0629964312505.issue23882@psf.upfronthosting.co.za> Message-ID: <1625762197.93.0.604112272047.issue23882@roundup.psfhosted.org> Eric V. Smith added the comment: As the author of PEP 420, I think having test discovery support namespace packages is a mistake, at least in the sense of pretending every directory is a namespace package. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:38:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:38:49 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625762329.21.0.890921997421.issue11343@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > > python example.py > s_push: parser stack overflow > MemoryError That error can only happen with the old parser, so you must be using Python3.8 or 3.9 with the old parser. Can you confirm? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:43:04 2021 From: report at bugs.python.org (Andre Roberge) Date: Thu, 08 Jul 2021 16:43:04 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625762584.03.0.672444230298.issue11343@roundup.psfhosted.org> Andre Roberge added the comment: @pablo: Sincere apologies ... I tested this with the wrong virtual environment active locally. With 3.10, it is indeed SyntaxError: too many nested parentheses ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:43:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:43:38 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625762618.69.0.00788725721585.issue11343@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: As a piece of extra information, this limit has been there for a while: https://github.com/python/cpython/blob/91a8f8c16ca9a7e2466a8241d9b41769ef97d094/Parser/tokenizer.h#L14 the problem is that the old parser died before reaching it in many situations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:46:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:46:57 +0000 Subject: [issue11343] Make errors due to full parser stack identifiable In-Reply-To: <1298759991.59.0.16834388397.issue11343@psf.upfronthosting.co.za> Message-ID: <1625762817.72.0.671493021815.issue11343@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Regarding what to do, what I would love to optimize is that the message is clear. One of the challenges people may have with too specific messages is that they may not know what "a compiler" or "a parser" means (the first may be especially confusing since many people think Python is not "compiled". On the other hand, is more informative to say "too many nested parentheses" than "parser stack overflow" since many people don't know what that means, especially in Python. I ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:47:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:47:21 +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: <1625762841.57.0.546678874384.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 61eb9b5dfd919ba5d1ec9f7df0137f2e6d196972 by Pablo Galindo in branch '3.10': [3.10] bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781) (GH-27072) https://github.com/python/cpython/commit/61eb9b5dfd919ba5d1ec9f7df0137f2e6d196972 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:47:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:47:55 +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: <1625762875.43.0.556643209771.issue44446@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 Jul 8 12:48:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:48:09 +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: <1625762889.29.0.692197451443.issue44446@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 12:48:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 16:48:18 +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: <1625762898.91.0.212737394989.issue44446@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Feel free to reopen if we are missing anything ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 13:03:31 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 08 Jul 2021 17:03:31 +0000 Subject: [issue44582] Accelerate mimetypes.init on Windows In-Reply-To: <1625688399.61.0.349492251781.issue44582@roundup.psfhosted.org> Message-ID: <1625763811.72.0.668438561525.issue44582@roundup.psfhosted.org> Steve Dower added the comment: Dropping the 3.9 backport. Pretty sure it only needs a clinic regen, but it's also not worth the risk of changed behaviour. We could consider it again after 3.10 has shipped if people really want it (and can help validate it). ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 13:59:37 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 08 Jul 2021 17:59:37 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625767177.19.0.721332914749.issue44570@roundup.psfhosted.org> Ned Batchelder added the comment: I can confirm that those two pull requests fix the problem reported here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:00:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 18:00:58 +0000 Subject: [issue31212] datetime: min date (0001-01-01 00:00:00) can't be converted to local timestamp In-Reply-To: <1502817992.35.0.826006067807.issue31212@psf.upfronthosting.co.za> Message-ID: <1625767258.32.0.477785982958.issue31212@roundup.psfhosted.org> Andrei Kulakov added the comment: Perhaps min and max should be moved 24 hours up and down respectively? This would make their names more accurately reflect valid range of the class and also allow them to be used as effective -inf +inf. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:21:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:21:26 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625768486.64.0.0182800733063.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9f2c63b258846a95393b556fee5e1090173ea717 by Mark Shannon in branch '3.10': bpo-44570: Fix line tracing for forward jumps to duplicated tails (GH-27067) https://github.com/python/cpython/commit/9f2c63b258846a95393b556fee5e1090173ea717 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:21:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:21:16 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625768476.73.0.132440824203.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset da6414f0acf5ec9ea3b07e4b3907bc49c2a61e2f by Mark Shannon in branch 'main': bpo-44570: Fix line tracing for forwards jumps to duplicated tails (GH-27068) https://github.com/python/cpython/commit/da6414f0acf5ec9ea3b07e4b3907bc49c2a61e2f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:21:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:21:46 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625768506.55.0.233117493624.issue44570@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Awesome, thanks a lot for the quick resolution, Mark! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:21:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:21:35 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1625768495.71.0.176795025973.issue44570@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:22:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:22:25 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1625768545.86.0.369157987032.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is anything left here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:22:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 18:22:13 +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: <1625768533.14.0.0561014503958.issue43908@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: release blocker -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:35:20 2021 From: report at bugs.python.org (bugale bugale) Date: Thu, 08 Jul 2021 18:35:20 +0000 Subject: [issue22107] tempfile module misinterprets access denied error on Windows In-Reply-To: <1406724041.52.0.0365391579019.issue22107@psf.upfronthosting.co.za> Message-ID: <1625769320.1.0.479993854305.issue22107@roundup.psfhosted.org> Change by bugale bugale : ---------- nosy: +bugale bugale _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 14:56:48 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 08 Jul 2021 18:56:48 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1625770608.93.0.373300308454.issue43908@roundup.psfhosted.org> Erlend E. Aasland added the comment: > Is anything left here? Should the immutable flag also be applied to the heap types converted in and before Python 3.9 before closing this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 15:31:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Jul 2021 19:31:27 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625772687.07.0.448691754989.issue44571@roundup.psfhosted.org> Raymond Hettinger added the comment: > What if set the last item as an attribute of the takewhile iterator? Perhaps raise an attribute error unless the falsifying element is set? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 15:35:43 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Jul 2021 19:35:43 +0000 Subject: [issue16321] Move eq.h out of stringlib In-Reply-To: <1351157379.02.0.714048258846.issue16321@psf.upfronthosting.co.za> Message-ID: <1625772943.6.0.440890579098.issue16321@roundup.psfhosted.org> Raymond Hettinger added the comment: The remaining unicode_eq can be left as-is. While it is only in dictobject.c, the requisite knowledge of string internals makes it reasonable to keep it in stringlib. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 15:38:45 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 08 Jul 2021 19:38:45 +0000 Subject: [issue31218] del expects __delitem__ if __setitem__ is defined In-Reply-To: <1502880498.02.0.663608848315.issue31218@psf.upfronthosting.co.za> Message-ID: <1625773125.04.0.775556979371.issue31218@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm closing this as not being worth changing. It is only a minor irritant and arguably not a bug. "Fixing it" would be disruptive and likely not help anyone. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 15:50:49 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 08 Jul 2021 19:50:49 +0000 Subject: [issue43034] Python tutorial misleads users about floor division behavior In-Reply-To: <1611710102.87.0.478016588876.issue43034@roundup.psfhosted.org> Message-ID: <1625773849.7.0.138480844322.issue43034@roundup.psfhosted.org> Andrei Kulakov added the comment: Possibly: 5//2 # 2 -5//2 # -3 Would be easier to understand. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 16:34:58 2021 From: report at bugs.python.org (Toshio Kuratomi) Date: Thu, 08 Jul 2021 20:34:58 +0000 Subject: [issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter In-Reply-To: <1623348467.33.0.718434111549.issue44383@roundup.psfhosted.org> Message-ID: <1625776498.91.0.767009846057.issue44383@roundup.psfhosted.org> Toshio Kuratomi added the comment: I believe this is a duplicate of https://bugs.python.org/issue38956 and could be closed in favor of that issue. 38956 also has a Pull Request to fix the issue which is awaiting a re-review. ---------- nosy: +a.badger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 16:59:51 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Thu, 08 Jul 2021 20:59:51 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1625777991.15.0.626405126274.issue43897@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25624 pull_request: https://github.com/python/cpython/pull/27074 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 18:29:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 08 Jul 2021 22:29:09 +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: <1625783349.65.0.381058673878.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I would say yes. Do you have a compiled list of what's left? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 18:49:34 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 08 Jul 2021 22:49:34 +0000 Subject: [issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag In-Reply-To: <1619031139.87.0.55032170532.issue43908@roundup.psfhosted.org> Message-ID: <1625784574.86.0.381122147274.issue43908@roundup.psfhosted.org> Erlend E. Aasland added the comment: These types now lack the Py_TPFLAGS_IMMUTABLETYPE flag: ## Types converted in Python 3.9 - _abc._abc_data - _json.Encoder - _json.Scanner - _random.Random - _struct.Struct - _struct.unpack_iterator - ast.AST - posix.DirEntry - posix.ScandirIterator - select.devpoll - select.epoll - select.kevent - select.kqueue - select.poll - zlib.Compress - zlib.Decompress ## Types converted before Python 3.9 - _curses_panel.panel - _tkinter.Tcl_Obj - _tkinter.tkapp - _tkinter.tktimertoken ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 19:29:43 2021 From: report at bugs.python.org (Mardoxx) Date: Thu, 08 Jul 2021 23:29:43 +0000 Subject: [issue43371] Mock.assert_has_calls works strange In-Reply-To: <1614695494.31.0.773020245058.issue43371@roundup.psfhosted.org> Message-ID: <1625786983.66.0.840527196182.issue43371@roundup.psfhosted.org> Mardoxx added the comment: This is surprising behaviour, Python 3.8.9: factory = unittest.mock.Mock() ### test example foo_obj = factory.create("foo"),do_thing() # !! MUST BE CALLED AFTER .create("foo") !! bar_obj = factory.create("bar").do_thing() ### # I set any_order to false because these should be called in order. factory.create.assert_has_calls([ unittest.mock.call("foo"), unittest.mock.call("bar") ], any_order = False) # OOPS!! this fails # mock_calls == [call('foo'), call().do_thing(), call('bar'), call().do_thing()] # I can however check this with... # assert factory.create.call_args_list == [ # unittest.mock.call("foo"), # unittest.mock.call("bar") # ] Am I fundamentally misunderstanding something here? This appears to be different behaviour from assert_has_awaits, which adds to the confusion. assert_has_calls checks mock_calls, I'd have thought it should check call_args_list. Another method assert_mock_calls should check mock_calls for consistency? Or have I missed something here? Perhaps an additional flag of in_sequence would be nice, defaulted to False to keep the existing unusual behaviour. When False, calls must be in exactly the order they are described. When True, calls must be in sequence (with anything in-between each call). any_order=True overrides this and allows them to be in any order anywhere in the mock_calls list. ---------- nosy: +mardoxx versions: +Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 20:24:49 2021 From: report at bugs.python.org (Ethan Furman) Date: Fri, 09 Jul 2021 00:24:49 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625790289.01.0.919381844577.issue35815@roundup.psfhosted.org> Ethan Furman added the comment: Andrei, which code did you try? I'm still seeing the failure (i.e. the class being created) in 3.8 and forward. ---------- versions: +Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 20:30:11 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 00:30:11 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625790611.49.0.391270950285.issue35815@roundup.psfhosted.org> Andrei Kulakov added the comment: Ethan, here is the code I tried with 3.9, and the failure: import abc class Base(abc.ABC): def __init_subclass__(cls, **kwargs): instance = cls() print(f"Created instance of {cls} easily: {instance}") @abc.abstractmethod def do_something(self): pass class Derived(Base): pass Derived() Output: python3 ~/temp/a.py ----VICMD---- Traceback (most recent call last): File "/Users/ak/temp/a.py", line 53, in Derived() TypeError: Can't instantiate abstract class Derived with abstract method do_something ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 20:47:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 00:47:44 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625791664.71.0.848151491158.issue35815@roundup.psfhosted.org> Andrei Kulakov added the comment: I missed the fact that instance was being indeed created, I can see it now. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 20:53:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 00:53:38 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625792018.21.0.0391254575463.issue35815@roundup.psfhosted.org> Andrei Kulakov added the comment: Oops, I see the issue now. I was playing around with the code sample and had the print line commented out inadvertently when I made the output I pasted above. Sorry for the noise! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 21:18:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Jul 2021 01:18:00 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625793480.46.0.237147737154.issue35815@roundup.psfhosted.org> Raymond Hettinger added the comment: At worst, this seems like only a minor nuisance. The ABC metaclass is limited in its powers and seems to reasonably cover the common use cases. I recommend leaving it as is. Guido, what do you think? ---------- assignee: -> gvanrossum nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 21:21:27 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Jul 2021 01:21:27 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory In-Reply-To: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> Message-ID: <1625793687.98.0.950991322488.issue44573@roundup.psfhosted.org> Raymond Hettinger added the comment: In practice, this hasn't been an issue. I recommend leaving it alone. Adding more directories is also a nuisance and doesn't really make anyone's life better. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 21:31:03 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Jul 2021 01:31:03 +0000 Subject: [issue44586] unittest requires __init__.py for test discovery In-Reply-To: <1625756589.94.0.0608514933284.issue44586@roundup.psfhosted.org> Message-ID: <1625794263.05.0.610020971217.issue44586@roundup.psfhosted.org> Inada Naoki added the comment: And https://dev.to/methane/don-t-omit-init-py-3hga too. ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 22:02:18 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 02:02:18 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625796138.3.0.59051718347.issue42830@roundup.psfhosted.org> Andrei Kulakov added the comment: It seems reasonable to add a paragraph like: If a large number of file descriptors are created, your program may run into a per-process limit. You can avoid this issue by closing file descriptors with :func:`os.close`. I also noticed that `mkstemp` doc refers to file handles, but links to `os.open` which uses 'file descriptors'. It may be good if along with this change, existing text was updated to refer to 'file descriptors'. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 22:37:23 2021 From: report at bugs.python.org (Daniel Fleischman) Date: Fri, 09 Jul 2021 02:37:23 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625517517.89.0.211165025671.issue44555@roundup.psfhosted.org> Message-ID: Daniel Fleischman added the comment: Hey Raymond, > "Changing the dict implementation to a linked list would make your case perform better but would make most users worse off." Is there any standard benchmark? I would like to implement my idea, as I think that it is very unlikely that "most users would be made worse off" by a measurable amount if I implement what I have in mind. If there aren't standard benchmarks, I can always make artificial ones (insert a lot of entries, remove them, access, iterate, etc). Thank you, Daniel ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 22:42:08 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Jul 2021 02:42:08 +0000 Subject: [issue35815] Able to instantiate a subclass with abstract methods from __init_subclass__ of the ABC In-Reply-To: <1548316625.2.0.852101004839.issue35815@roundup.psfhosted.org> Message-ID: <1625798528.97.0.272187689584.issue35815@roundup.psfhosted.org> Guido van Rossum added the comment: > At worst, this seems like only a minor nuisance. The ABC metaclass is limited in its powers and seems to reasonably cover the common use cases. > I recommend leaving it as is. Guido, what do you think? Agreed. The abstractness checks are limited and not intended to prevent all ways of creating abstract instances -- just to catch typical mistakes early. (I vaguely recall another bug report about a weakness in this check that I resolved in the same way.) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 8 22:42:59 2021 From: report at bugs.python.org (Inada Naoki) Date: Fri, 09 Jul 2021 02:42:59 +0000 Subject: [issue44555] Dictionary operations are LINEAR for any dictionary (for a particular code). In-Reply-To: <1625260805.66.0.276677787227.issue44555@roundup.psfhosted.org> Message-ID: <1625798579.83.0.975012555167.issue44555@roundup.psfhosted.org> Inada Naoki added the comment: There is a macro benchmark we regularly used. https://pyperformance.readthedocs.io/ You can try micro benchmark for most common use cases with pyperf like this: ``` $ pyperf timeit -s "def f(**kwargs): pass" -- "f(a=1,b=2,c=3)" Mean +- std dev: 119 ns +- 3 ns ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:04:39 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Fri, 09 Jul 2021 05:04:39 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625807079.27.0.622897358522.issue43219@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- assignee: -> gregory.p.smith nosy: +gregory.p.smith versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:07:37 2021 From: report at bugs.python.org (Toshio Kuratomi) Date: Fri, 09 Jul 2021 05:07:37 +0000 Subject: [issue44587] BooleanOptionalAction displays default=SUPPRESS unlike other action types Message-ID: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> New submission from Toshio Kuratomi : This is related to https://bugs.python.org/issue38956 but a different symptom (and the current proposed fix for 38956 will not fix this. My proposed fixes for this would also fix 38956). I have the following code which uses BooleanOptionalAction along with a default of SUPPRESS (I use SUPPRESS because I merge these with settings from config and environment variables and then validate and add default values using a schema. SUPPRESS allows me to tell when a value was not specified at the command line by the user): whole_site_parser.add_argument('--indexes', dest='indexes', action=BooleanOptionalAction, default=argparse.SUPPRESS, help='Test') That code outputs: --indexes, --no-indexes Test (default: ==SUPPRESS==) Similar code that does not use BooleanOptionalAction does not show default: ==SUPPRESS == even when formatter_class=ArgumentDefaultsHelpFormatter is used. Looking at the code, this is occurring because BooleanOptionalArgument has its own code to add default: on its own (instead of leaving formatting as the responsibility of the formatter_class). The code in BooleanOptionalArgument handles less cases where the default should be skipped than the ArgumentDefaultsHelpFormatter code; SUPPRESS is one of the missing cases. I can see two ways of fixing this: (1) Remove the code from BooleanOptionalArgument that adds the default values. It seems to violate the architecture of argparse which delegates modifications to the help message to the formatter_class so this is a special case which could cause issues for future modifications as well. (2) If the usefulness of outputting the default values without changing the formatter_class is deemed too important to relinquish, then moving the code that ArgumentDefaultsHelpFormatter uses to determine when to skip adding default to the help message can be extracted from ArgumentDefaultsHelpFormatter and called by both ArgumentDefaultsHelpFormatter and BooleanOptionalArgument . In a review of a fix for https://github.com/python/cpython/pull/17447/files#r429630944 raymond hettinger thought that outputting of the default values was important to keep although I'm not clear on whether he considered that the usefulness comes at the price of possibly violating argparse's architecture. If he hasn't changed his mind, then #2 is probably the way to resolve this. I can submit a PR for either of these once I know which direction to take (the first is just removing a few lines of code and I've already written the second one since it seemed like the direction that raymond had last asked for). Please let me know how you'd like me to proceed. ---------- messages: 397184 nosy: a.badger priority: normal severity: normal status: open title: BooleanOptionalAction displays default=SUPPRESS unlike other action types versions: Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:12:52 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Jul 2021 05:12:52 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625807572.92.0.177501606073.issue42830@roundup.psfhosted.org> Change by Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : ---------- keywords: +patch nosy: +thatiparthy nosy_count: 3.0 -> 4.0 pull_requests: +25625 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27075 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:13:47 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Jul 2021 05:13:47 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625807627.94.0.355972794383.issue42830@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: I have raised a docs PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:19:21 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Fri, 09 Jul 2021 05:19:21 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory In-Reply-To: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> Message-ID: <1625807961.68.0.0650071909572.issue44573@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: +1 for Raymond's comment. ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:46:49 2021 From: report at bugs.python.org (Julian Gilbey) Date: Fri, 09 Jul 2021 05:46:49 +0000 Subject: [issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter In-Reply-To: <1623348467.33.0.718434111549.issue44383@roundup.psfhosted.org> Message-ID: <1625809609.62.0.121484789409.issue44383@roundup.psfhosted.org> Julian Gilbey added the comment: Yes, this is a duplicate. Marking this report as a duplicate. It's a shame that the other one has a conflict and has been sitting waiting for an update for over a year :-( I'd be happy to help if it is of use. ---------- resolution: -> duplicate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 01:47:33 2021 From: report at bugs.python.org (Julian Gilbey) Date: Fri, 09 Jul 2021 05:47:33 +0000 Subject: [issue44383] argparse.BooleanOptionalAction interacts poorly with ArgumentDefaultsHelpFormatter In-Reply-To: <1623348467.33.0.718434111549.issue44383@roundup.psfhosted.org> Message-ID: <1625809653.28.0.912168719549.issue44383@roundup.psfhosted.org> Change by Julian Gilbey : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 03:42:56 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Fri, 09 Jul 2021 07:42:56 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c Message-ID: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> New submission from Ziyue Jiang : The type_mro_modified() function in Object/typeobject.c may produce double Py_XDECREF on mro_meth and type_mro_meth when enter the code: if (!_PyType_HasFeature(cls, Py_TPFLAGS_HAVE_VERSION_TAG) || !PyType_IsSubtype(type, cls)) { goto clear; } I think mro_meth = NULL; type_mro_meth = NULL; should be added after the first time Py_XDECREF them. ---------- components: C API messages: 397188 nosy: Wesley-Jzy priority: normal severity: normal status: open title: Possible double Py_XDECREF in cpython typeobject.c type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 03:50:11 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Fri, 09 Jul 2021 07:50:11 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1625817011.42.0.56771606711.issue44588@roundup.psfhosted.org> Ziyue Jiang added the comment: Maybe a little complicared but you can still construct a case to trigger the double free action, thus causing a SIGABRT. Program received signal SIGABRT, Aborted. 0x00007ffff7c3718b in raise () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) bt #0 0x00007ffff7c3718b in raise () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff7c16859 in abort () from /lib/x86_64-linux-gnu/libc.so.6 #2 0x000000000051e94e in fatal_error (prefix=prefix at entry=0x0, msg=msg at entry=0x6a38e4 "_PyObject_AssertFailed", status=status at entry=-1) at ../Python/pylifecycle.c:2183 #3 0x00000000005213b0 in Py_FatalError (msg=msg at entry=0x6a38e4 "_PyObject_AssertFailed") at ../Python/pylifecycle.c:2193 #4 0x0000000000470dd9 in _PyObject_AssertFailed (obj=obj at entry=0x7ffff789c350, expr=expr at entry=0x0, msg=msg at entry=0x6a392d "object has negative ref count", file=file at entry=0x691111 "../Include/object.h", line=line at entry=541, function=function at entry=0x6a4a20 <__func__.15840> "_Py_NegativeRefcount") at ../Objects/object.c:2200 #5 0x0000000000470ee1 in _Py_NegativeRefcount (filename=filename at entry=0x691111 "../Include/object.h", lineno=lineno at entry=541, op=op at entry=0x7ffff789c350) at ../Objects/object.c:235 #6 0x0000000000490ad8 in _Py_DECREF (op=0x7ffff789c350, lineno=541, filename=0x691111 "../Include/object.h") at ../Include/object.h:473 #7 _Py_XDECREF (op=0x7ffff789c350) at ../Include/object.h:541 #8 type_mro_modified (type=type at entry=0xb17400, bases=bases at entry=0x7ffff5917890) at ../Objects/typeobject.c:343 #9 0x00000000004940ca in mro_internal (type=type at entry=0xb17400, p_old_mro=p_old_mro at entry=0x0) at ../Objects/typeobject.c:1961 #10 0x000000000048c816 in PyType_Ready (type=type at entry=0xb17400) at ../Objects/typeobject.c:5345 #11 0x0000000000493974 in type_new (metatype=, args=, kwds=0x0) at ../Objects/typeobject.c:2806 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 03:53:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 09 Jul 2021 07:53:02 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1625817181.99.0.213549435307.issue44588@roundup.psfhosted.org> Irit Katriel added the comment: Do you have a small piece of code reproducing it that you can upload? ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 04:26:38 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Fri, 09 Jul 2021 08:26:38 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1625819198.69.0.395423243294.issue44588@roundup.psfhosted.org> Ziyue Jiang added the comment: I have no detailed code. The way to I produce it is that using PyType_FromSpec() to generate a type A without the flag Py_TPFLAGS_DEFAULT(which sets the flag Py_TPFLAGS_HAVE_VERSION_TAG). Then compile and run in Python. from my_pkg import A class Time1(Time): def __init__(self): pass import multiprocessing (This import is a method to 100% reproduce it. Another way is to use python3-dbg running the code.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 04:28:43 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Fri, 09 Jul 2021 08:28:43 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1625819323.67.0.716134672164.issue44588@roundup.psfhosted.org> Ziyue Jiang added the comment: Sorry, not inherited from Time, Time is the class I use in a real project. Time -> A ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 04:38:16 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Fri, 09 Jul 2021 08:38:16 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1625819896.89.0.474328718399.issue44588@roundup.psfhosted.org> Ziyue Jiang added the comment: I just take over a Python3.6 project from a friend, migrating it to the newest Python version. Then this problem happened. After debugging, I think it's a possible double Py_XDECREF if using C-API like this. But I'm not familiar with Python C-API before so I'm not sure whether it's a problem or just a misuse about tp_flags. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 05:06:08 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 09 Jul 2021 09:06:08 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1625821568.53.0.0541311806454.issue44583@roundup.psfhosted.org> Ronald Oussoren added the comment: As mentioned on the PR: Support for OSF1 was removed in Python 3.3 (see https://www.python.org/dev/peps/pep-0011/#unsupporting-platforms). I expect that there will be little interest amongst the core developers for reintroducing support because OSF1 is an ancient operating system that is long out of support. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 06:16:54 2021 From: report at bugs.python.org (Pierre Quentel) Date: Fri, 09 Jul 2021 10:16:54 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns Message-ID: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> New submission from Pierre Quentel : PEP 634 specifies that "A mapping pattern may not contain duplicate key values. (If all key patterns are literal patterns this is considered a syntax error; otherwise this is a runtime error and will raise ValueError.)" but this is not what happens with the latest release: Python 3.10.0b3 (tags/v3.10.0b3:865714a, Jun 17 2021, 20:39:25) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x = {'a': 1} >>> match x: ... case {'a': 1, 'a': 2}: # (A) ... print('ok') ... >>> x = {'a': 3} >>> match x: ... case {'a': 1, 'a': 2}: # (B) ... print('ok') ... >>> x = {'a': 1, 'b': 2} >>> match x: ... case {'a': 1, 'a': 2}: # (C) ... print('ok') ... Traceback (most recent call last): File "", line 2, in ValueError: mapping pattern checks duplicate key ('a') >>> If I understand the PEP correctly, all these examples should raise a SyntaxError for the line case {'a': 1, 'a': 2}: since all key patterns are literal patterns, and the key 'a' is duplicated. Cases (A) where the subject matches one of the key-value patterns, and (B) when it doesn't, fail without raising SyntaxError. Case (C) where one of the keys in the subject is not present in the mapping pattern raises a ValueError at runtime instead of SyntaxError. This behaviour is tested in test_patma.py: def test_patma_251(self): x = {"a": 0, "b": 1} w = y = z = None with self.assertRaises(ValueError): match x: case {"a": y, "a": z}: w = 0 self.assertIs(w, None) self.assertIs(y, None) self.assertIs(z, None) but this doesn't seem compliant with the specification. BTW, it's not clear to me why the SyntaxError should be limited to the case when all keys are literal patterns; it could be raised whenever a literal pattern is repeated, even when there are value patterns or a double-star pattern, like in case {'a': 1, 'a': 2, c.imag, **rest}: ---------- components: Interpreter Core messages: 397195 nosy: quentel priority: normal severity: normal status: open title: Pattern Matching - duplicate keys in mapping patterns versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 06:53:40 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Jul 2021 10:53:40 +0000 Subject: [issue44590] Create frame objects lazily when needed Message-ID: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> New submission from Mark Shannon : In https://bugs.python.org/issue44032 we moved most of the data in the frame stack, that is the locals, stack, and "specials" (globals, builtins, code etc), from the heap allocated stack to a (mostly) contiguous array in memory. That offered some speed up due to better cache locality, and faster allocation of frame objects (they are now fixed size so can use a simple freelist). However, data is still split between the stack allocated frame and the heap allocated frame. We should move the remaining data to the stack and only allocate heap objects lazily when needed for tracebacks and the like. This should improve performance further by removing the vast majority of heap frame allocations and further improving locality of reference. Not only does this have immediate performance benefits, it also paves the way for even better Python-to-Python calls by allowing stack frames to overlap and pass arguments with the minimal amount of copying and INCREF/DECREF pairs. ---------- assignee: Mark.Shannon components: Interpreter Core messages: 397196 nosy: Mark.Shannon, gvanrossum, pablogsal priority: normal severity: normal status: open title: Create frame objects lazily when needed type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 07:24:36 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Fri, 09 Jul 2021 11:24:36 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1625829876.27.0.546626634877.issue44589@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 07:29:13 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Jul 2021 11:29:13 +0000 Subject: [issue44590] Create frame objects lazily when needed In-Reply-To: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> Message-ID: <1625830153.46.0.457321457692.issue44590@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25626 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27077 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 08:56:18 2021 From: report at bugs.python.org (Ritav Das) Date: Fri, 09 Jul 2021 12:56:18 +0000 Subject: [issue44591] Added man heap push Message-ID: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> New submission from Ritav Das : Added a heap push method for the max heap invariant and added try except block at the end so the user can import that function from the library. ---------- components: Windows messages: 397197 nosy: paul.moore, ritavdas, steve.dower, tim.golden, zach.ware priority: normal pull_requests: 25627 severity: normal status: open title: Added man heap push type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 08:56:42 2021 From: report at bugs.python.org (Ritav Das) Date: Fri, 09 Jul 2021 12:56:42 +0000 Subject: [issue44591] Added max heap push In-Reply-To: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> Message-ID: <1625835402.04.0.83992314053.issue44591@roundup.psfhosted.org> Change by Ritav Das : ---------- title: Added man heap push -> Added max heap push _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 09:24:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 09 Jul 2021 13:24:15 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1625837055.85.0.670396497763.issue44207@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25628 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27078 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 10:51:32 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 09 Jul 2021 14:51:32 +0000 Subject: [issue44591] Added max heap push In-Reply-To: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> Message-ID: <1625842292.03.0.255446940341.issue44591@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: +Library (Lib) -Windows nosy: +rhettinger -zach.ware stage: -> patch review versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:10:56 2021 From: report at bugs.python.org (Leonardo Freua) Date: Fri, 09 Jul 2021 15:10:56 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory In-Reply-To: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> Message-ID: <1625843456.3.0.883987482259.issue44573@roundup.psfhosted.org> Change by Leonardo Freua : ---------- stage: -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:13:40 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Jul 2021 15:13:40 +0000 Subject: [issue44591] Added max heap push In-Reply-To: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> Message-ID: <1625843620.94.0.976580837737.issue44591@roundup.psfhosted.org> Raymond Hettinger added the comment: Thanks for the suggestion, but only the minheap functions are public. The maxheap functions are private, for internal use only. Currently, there is no internal need for a maxheap push. ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:14:18 2021 From: report at bugs.python.org (Akuli) Date: Fri, 09 Jul 2021 15:14:18 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget Message-ID: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> New submission from Akuli : The purpose of focus_get() is to return the widget that currently has the focus. It tries to convert its result to a tkinter widget, which can fail, because not all Tk widgets are known to tkinter. Consider this, for example: import tkinter def print_focused_widget(): print(repr(root.focus_get())) root.after(1000, print_focused_widget) root = tkinter.Tk() menu = root["menu"] = tkinter.Menu() menu.add_cascade(label="Click here", menu=tkinter.Menu()) print_focused_widget() tkinter.mainloop() Output, with menu clicked after a couple seconds (on Linux): None Exception in Tkinter callback Traceback (most recent call last): File "/home/akuli/.local/lib/python3.10/tkinter/__init__.py", line 1916, in __call__ return self.func(*args) File "/home/akuli/.local/lib/python3.10/tkinter/__init__.py", line 838, in callit func(*args) File "/home/akuli/porcu/foo.py", line 4, in print_focused_widget print(repr(root.focus_get())) File "/home/akuli/.local/lib/python3.10/tkinter/__init__.py", line 782, in focus_get return self._nametowidget(name) File "/home/akuli/.local/lib/python3.10/tkinter/__init__.py", line 1531, in nametowidget w = w.children[n] KeyError: '#!menu' Some nametowidget() calls in tkinter/__init__.py already handle this correctly. Consider winfo_children(), for example: try: # Tcl sometimes returns extra windows, e.g. for # menus; those need to be skipped result.append(self._nametowidget(child)) except KeyError: pass ---------- components: Tkinter messages: 397199 nosy: Akuli priority: normal severity: normal status: open title: tkinter focus_get() with non-tkinter Tk widget type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:16:04 2021 From: report at bugs.python.org (Akuli) Date: Fri, 09 Jul 2021 15:16:04 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625843764.85.0.435701295676.issue44592@roundup.psfhosted.org> Akuli added the comment: Forgot to mention: The correct fix IMO would be to return None when a KeyError occurs. This way code like `focus_get() == some_tkinter_widget` would always do the right thing, for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:19:34 2021 From: report at bugs.python.org (Ritav Das) Date: Fri, 09 Jul 2021 15:19:34 +0000 Subject: [issue44591] Added max heap push In-Reply-To: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> Message-ID: <1625843974.88.0.970479595923.issue44591@roundup.psfhosted.org> Ritav Das added the comment: But why not? It's plays a very pivotal role when in competitive coding and solving python coding questions in general. Making them public would help thousands of fellow coders like me by making this process more convenient. ---------- resolution: rejected -> later status: closed -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 11:19:56 2021 From: report at bugs.python.org (Ritav Das) Date: Fri, 09 Jul 2021 15:19:56 +0000 Subject: [issue44591] Added max heap push In-Reply-To: <1625835378.78.0.790490157019.issue44591@roundup.psfhosted.org> Message-ID: <1625843996.01.0.898297141047.issue44591@roundup.psfhosted.org> Change by Ritav Das : ---------- resolution: later -> rejected status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 12:42:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Jul 2021 16:42:44 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625848964.7.0.402974088317.issue44571@roundup.psfhosted.org> Raymond Hettinger added the comment: I've done some API experiments using a data munging example. See attached file. The proposed API for takewhile() to save the last attribute is somewhat awkward to use: it = iter(report) tw_it = takewhile(is_header, it) for line in takewhile(is_header, tw_it): print('Header:', repr(line)) if hasattr(tw_it, 'odd_element'): it = chain([tw_it.odd_element], it) print(mean(map(int, it))) What is needed is a new itertool recipe to cover this use case: headers, data = before_and_after(is_header, report) for line in headers: print('Header:', repr(line)) print(mean(map(int, data))) ---------- Added file: https://bugs.python.org/file50142/tmp_takewhile.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 13:04:13 2021 From: report at bugs.python.org (Jacob Walls) Date: Fri, 09 Jul 2021 17:04:13 +0000 Subject: [issue44587] BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1625850253.69.0.716377293665.issue44587@roundup.psfhosted.org> Change by Jacob Walls : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 13:06:33 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 09 Jul 2021 17:06:33 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1625850393.69.0.304520730933.issue44589@roundup.psfhosted.org> Brandt Bucher added the comment: Nice find! In my opinion, we should do two things here: - Update PEP 638 to specify that a SyntaxError is raised "if *any duplicate* key patterns are literal patterns". This was absolutely our original intention... I think the nuances were just lost in the final phrasing. I can take care of that PR. - Update the compiler to raise SyntaxErrors for duplicate literal keys. It should be as simple as updating the first loop in compiler_pattern_mapping to build a set containing the values of any literal keys and raise on duplicates (and adding/updating tests, of course). We'll want to make sure we have test coverage of edge cases like {0: _, False: _}, {0: _, 0.0: _}, {0: _, -0: _}, {0: _, 0j: _}, etc. Since you found this, you get first dibs on a PR. Otherwise, I have a few first-time contributors who would probably be interested. ---------- nosy: +gvanrossum type: -> behavior versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 13:07:04 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 09 Jul 2021 17:07:04 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1625850424.71.0.290004415139.issue44589@roundup.psfhosted.org> Brandt Bucher added the comment: Sorry, that should be PEP 634, not 638. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 13:19:51 2021 From: report at bugs.python.org (Leonardo Freua) Date: Fri, 09 Jul 2021 17:19:51 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory In-Reply-To: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> Message-ID: <1625851191.48.0.021794852437.issue44573@roundup.psfhosted.org> Change by Leonardo Freua : ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 13:44:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Jul 2021 17:44:59 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625852699.19.0.861893927209.issue44571@roundup.psfhosted.org> Serhiy Storchaka added the comment: For convenience, the takewhile iterator can also have additional attributes: a boolean attribute which indicates that the falsifying element is set, and dynamic attribute which is equal to orig_iterator or chain([odd_element], orig_iterator). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 14:36:50 2021 From: report at bugs.python.org (Jacob Walls) Date: Fri, 09 Jul 2021 18:36:50 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 Message-ID: <1625855810.66.0.11534600644.issue44516@roundup.psfhosted.org> New submission from Jacob Walls : Greetings, all. I take it this is fully resolved? ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 14:47:50 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Jul 2021 18:47:50 +0000 Subject: [issue44577] Probably defect in Python 3.7.11 In-Reply-To: <1625652920.8.0.16553812104.issue44577@roundup.psfhosted.org> Message-ID: <1625856470.67.0.677222062872.issue44577@roundup.psfhosted.org> Ned Deily added the comment: That excerpt is not executable by itself. Without a reproducible test case and better traceback info, there is not enough information here to investigate further. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 14:48:00 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 09 Jul 2021 18:48:00 +0000 Subject: [issue44533] Where are the log file(s) In-Reply-To: <1624950906.15.0.177262141584.issue44533@roundup.psfhosted.org> Message-ID: <1625856480.09.0.536215034213.issue44533@roundup.psfhosted.org> Change by ?ric Araujo : ---------- resolution: third party -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 14:50:26 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 09 Jul 2021 18:50:26 +0000 Subject: [issue44539] Imghdr JPG Quantized In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1625856626.17.0.970611614552.issue44539@roundup.psfhosted.org> Change by ?ric Araujo : ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 14:54:59 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 09 Jul 2021 18:54:59 +0000 Subject: [issue27875] Syslogs /usr/sbin/foo as /foo instead of as foo In-Reply-To: <1472291311.49.0.485322574022.issue27875@psf.upfronthosting.co.za> Message-ID: <1625856899.5.0.0608307995166.issue27875@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> syslog: Default "ident" in syslog.openlog() shouldn't contain slash versions: +Python 3.9 -Python 3.5, Python 3.6, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:06:06 2021 From: report at bugs.python.org (Jacob Walls) Date: Fri, 09 Jul 2021 19:06:06 +0000 Subject: [issue20116] urlparse.parse_qs should take argument for query separator In-Reply-To: <1388777959.1.0.144368039339.issue20116@psf.upfronthosting.co.za> Message-ID: <1625857566.19.0.782703258575.issue20116@roundup.psfhosted.org> Jacob Walls added the comment: Greetings. I believe this is mooted by #42967 as well as changes even prior to that. https://bugs.python.org/issue42967 ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:13:09 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 19:13:09 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625857989.36.0.485146502639.issue42830@roundup.psfhosted.org> Andrei Kulakov added the comment: Can someone w/access to a Linux system confirm if running out of FDs raises an OSError? Something like this: N = `ulimit -n` + 5 for x in range(N): tempfile.mkstemp() ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:27:55 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 19:27:55 +0000 Subject: [issue44550] Spam Message-ID: <1625858875.3.0.212296811121.issue44550@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: -skoolbeep _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:33:45 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 19:33:45 +0000 Subject: [issue44560] Many MUA don't recognize charset "eucgb2312_cn" in email header In-Reply-To: <1625387531.16.0.849810673355.issue44560@roundup.psfhosted.org> Message-ID: <1625859225.69.0.889520778099.issue44560@roundup.psfhosted.org> Terry J. Reedy added the comment: Anything before 3.9 only gets security patches. ---------- nosy: +terry.reedy title: Unrecognized charset "eucgb2312_cn" in email header for many MUA -> Many MUA don't recognize charset "eucgb2312_cn" in email header versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:44:29 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 09 Jul 2021 19:44:29 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625859869.24.0.454015609102.issue44592@roundup.psfhosted.org> E. Paine added the comment: I agree with Akuli that raising a KeyError is not expected behaviour (combined with the fact this is caught elsewhere), and therefore is probably a regression. While we could use `winfo class` to determine the type of Tk widget, this would probably require a reasonably sized refactor of tkinter (and we would still need to support cases when it's a type we don't know). Therefore, I think returning `None` is the best solution. Akuli, would you like to create a pull request for this? ---------- nosy: +epaine, serhiy.storchaka versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:45:52 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 19:45:52 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1625859952.78.0.765727614425.issue44583@roundup.psfhosted.org> Terry J. Reedy added the comment: Jay, this issue and PR should either be closed, or you should post on pydev list saying why support should be re-enabled, along with a credible offer to maintain platform support for several years. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 15:50:59 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 09 Jul 2021 19:50:59 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625860259.28.0.461608115818.issue44592@roundup.psfhosted.org> E. Paine added the comment: Sorry, I should specify that we would use `winfo class` in order to then return a new tkinter object for the existing Tk widget (which currently cannot be done) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:04:30 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 09 Jul 2021 20:04:30 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 In-Reply-To: <1625855810.66.0.11534600644.issue44516@roundup.psfhosted.org> Message-ID: <1625861070.01.0.217976246231.issue44516@roundup.psfhosted.org> Change by St?phane Bidoul : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:05:04 2021 From: report at bugs.python.org (=?utf-8?q?St=C3=A9phane_Bidoul?=) Date: Fri, 09 Jul 2021 20:05:04 +0000 Subject: [issue44516] Update bundled pip to 21.1.3 In-Reply-To: <1625855810.66.0.11534600644.issue44516@roundup.psfhosted.org> Message-ID: <1625861104.66.0.0153763661898.issue44516@roundup.psfhosted.org> St?phane Bidoul added the comment: Yes, I close the issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:10:56 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 09 Jul 2021 20:10:56 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625850424.71.0.290004415139.issue44589@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Agreed with everything that Brandt said. These wording issues are subtle! Note in particular that the original wording implies that {?x?: 1, ?x?: 1, z: 1} would be a runtime error, but it clearly should be a compile time error.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:27:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Jul 2021 20:27:25 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625862445.83.0.623235851707.issue44592@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a duplicate of issue734176. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make Tkinter.py's nametowidget work with cloned menu widgets _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:28:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 09 Jul 2021 20:28:46 +0000 Subject: [issue34550] UnicodeDecodeError when invoke method configure() of Menu instance In-Reply-To: <1535644548.51.0.56676864532.issue34550@psf.upfronthosting.co.za> Message-ID: <1625862526.93.0.50671713789.issue34550@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> out of date stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:33:16 2021 From: report at bugs.python.org (Akuli) Date: Fri, 09 Jul 2021 20:33:16 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625862796.54.0.631887381425.issue44592@roundup.psfhosted.org> Akuli added the comment: I found issue734176 before I created this. It is NOT a duplicate. While issue734176 is about menus, this one is about focus_get(), and not necessarily related to menus. In fact, I initially noticed this with an "open file" dialog, not with a menu. I'm not putting my address into your CLA, thank you very much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:42:14 2021 From: report at bugs.python.org (=?utf-8?b?TWllY3p5c8WCYXcgVG9yY2hhxYJh?=) Date: Fri, 09 Jul 2021 20:42:14 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625863334.5.0.809663752522.issue42830@roundup.psfhosted.org> Mieczys?aw Torcha?a added the comment: Hi Andrei! In my case it was: OSError: [Errno 24] Too many open files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:46:32 2021 From: report at bugs.python.org (lormuc) Date: Fri, 09 Jul 2021 20:46:32 +0000 Subject: [issue44593] _randbelow_with_getrandbits may request an unnecessary random bit Message-ID: <1625863592.21.0.811014081503.issue44593@roundup.psfhosted.org> New submission from lormuc : For example, Lib/random.py/Random._randbelow_with_getrandbits(1) should always return 0, as per docstring, but it asks for 1 random bit from getrandbits(). ---------- components: Library (Lib) messages: 397219 nosy: lormuc priority: normal severity: normal status: open title: _randbelow_with_getrandbits may request an unnecessary random bit type: resource usage versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:46:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 20:46:54 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625863614.4.0.610681151146.issue44592@roundup.psfhosted.org> Terry J. Reedy added the comment: Akuli, what tk widgets do you think are not known to tkinter? In any case, tk menu is known to tkinter. I cannot reproduce when running on Windows with 3.10.0b3: Add "print(root.children)" (after add_cascade) results in {'!menu': , '!menu2': }. The names are created in tkinter.py lines 2564-2573. I then see 'None' once and then '' indefinitely even while hovering over and clicking 'click me' and the dropdown. If I click outside the tk box, the print returns to 'None'. Maybe there is an OS difference in what is considered to have 'focus'. Key '#!menu' looks like '!menu' with '#' prepended. Someone could try changing the tkinter code referenced above and see if the change appears in the bad key. Also check the contents of root.children. ---------- nosy: +terry.reedy resolution: duplicate -> stage: resolved -> status: closed -> open superseder: Make Tkinter.py's nametowidget work with cloned menu widgets -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 16:49:19 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 20:49:19 +0000 Subject: [issue42830] tempfile mkstemp() leaks file descriptors if os.close() is not called In-Reply-To: <1609846127.44.0.860192251042.issue42830@roundup.psfhosted.org> Message-ID: <1625863759.37.0.384639747713.issue42830@roundup.psfhosted.org> Andrei Kulakov added the comment: Mieczys?aw: perfect, thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:02:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 21:02:12 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625864532.41.0.972118519508.issue44592@roundup.psfhosted.org> Terry J. Reedy added the comment: I am not quite convinced that this is a duplicate of #734176. The latter is about tearoff clones and nothing is cloned here. But I do notice that number 'names were also prefixed with '#'. What happens if 'tearoff=0' is added to the cascade so that it is not even clonable. The tkinter naming of instances after the class was added less than 10 years ago. ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Make Tkinter.py's nametowidget work with cloned menu widgets _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:02:53 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 21:02:53 +0000 Subject: [issue734176] Make Tkinter.py's nametowidget work with cloned menu widgets Message-ID: <1625864573.29.0.384938071541.issue734176@roundup.psfhosted.org> Terry J. Reedy added the comment: See #44592, closed as duplicate of this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:03:13 2021 From: report at bugs.python.org (Akuli) Date: Fri, 09 Jul 2021 21:03:13 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1625864593.98.0.0132672677616.issue44592@roundup.psfhosted.org> Akuli added the comment: Unfortunately I don't know any real-world examples of this on Windows. The open file dialog works very differently on Windows: it uses the native Windows dialog, whereas on Linux, it's implemented in Tcl. Meanwhile, here's a platform-independent toy example: import tkinter root = tkinter.Tk() root.tk.eval(""" entry .e pack .e focus .e """) root.after(500, root.focus_get) root.mainloop() Also, thanks for reopening! ---------- resolution: duplicate -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:09:07 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 09 Jul 2021 21:09:07 +0000 Subject: [issue44593] _randbelow_with_getrandbits may request an unnecessary random bit In-Reply-To: <1625863592.21.0.811014081503.issue44593@roundup.psfhosted.org> Message-ID: <1625864947.68.0.690380584676.issue44593@roundup.psfhosted.org> Mark Dickinson added the comment: See #37000 for previous discussion. ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:29:12 2021 From: report at bugs.python.org (Jay Krell) Date: Fri, 09 Jul 2021 21:29:12 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1625866152.05.0.667722604711.issue44583@roundup.psfhosted.org> Jay Krell added the comment: > "credible offer to maintain platform support for several years." Probably. What does "support" mean? Fix user-reported bugs? I expect very few/zero. Run a buildbot? Maybe. Not sure it is worthwhile, depending on frequency. Provide little autoconf/ifdef patches to keep it working? Sure. Hopefully there is some route for "degraded" or "missing" functionality on a platform by platform basis; the lack of monotonic time is kinda a problem in my PR. Anyway I'll reread the PEP and email the group, which I tried to join, not sure it is working yet. I will try to use it and keep my copy updated. I have some python2 scripts I can try to update. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:37:33 2021 From: report at bugs.python.org (lormuc) Date: Fri, 09 Jul 2021 21:37:33 +0000 Subject: [issue44593] _randbelow_with_getrandbits may request an unnecessary random bit In-Reply-To: <1625863592.21.0.811014081503.issue44593@roundup.psfhosted.org> Message-ID: <1625866653.99.0.414068769521.issue44593@roundup.psfhosted.org> Change by lormuc : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 17:56:09 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 09 Jul 2021 21:56:09 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625866152.05.0.667722604711.issue44583@roundup.psfhosted.org> Message-ID: <853f566b-92f4-e2d9-3484-6aae4e0df15e@udel.edu> Terry J. Reedy added the comment: On 7/9/2021 5:29 PM, Jay Krell wrote: > Probably. What does "support" mean? This is not my ballpark. One can also access pydev as newsgroup gmane.comp.python.devel at news.gmane.io ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 18:18:24 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 09 Jul 2021 22:18:24 +0000 Subject: [issue42909] Email header with ; ; ; ; stuffing takes very long to parse In-Reply-To: <1610457190.97.0.487967910026.issue42909@roundup.psfhosted.org> Message-ID: <1625869104.97.0.854552767298.issue42909@roundup.psfhosted.org> Andrei Kulakov added the comment: According to this: https://stackoverflow.com/questions/19852/maximum-length-of-a-mime-content-type-header-field (with links to RFCs 4288 and 6838), this header should not be longer than 255 chars. To fix this issue while maximizing backwards compatibility, I propose to do: - if content-type > 255 AND count of ';' is > 127 => raise HeaderParseError('Appears to be a spam header: length > 255 and large number of `;`' Choosing 127 to be conservatively high, can be adjusted to 20-30 to make processing even faster. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 18:31:53 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 09 Jul 2021 22:31:53 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625869913.02.0.443237317222.issue44571@roundup.psfhosted.org> Raymond Hettinger added the comment: > For convenience, the takewhile iterator can also have > additional attributes: a boolean attribute which indicates > that the falsifying element is set, and dynamic attribute > which is equal to orig_iterator > or chain([odd_element], orig_iterator). Rather than graft a funky and atypical API onto takewhile(), it would be better to have a new tool that returns two iterators, the true steam, and a stream for the remaining values. Either stream may be empty. There is no need for a boolean flag attribute or a remaining stream attribute. This design fits in better with the other itertools. FWIW, we can already do this using groupby(), but it is only easy if we assume the first part of the stream is all true and the remainder of the stream is all false. That isn't good enough for general application. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 19:59:53 2021 From: report at bugs.python.org (John Belmonte) Date: Fri, 09 Jul 2021 23:59:53 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ Message-ID: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> New submission from John Belmonte : Over at the Trio project, we have evidence that `AsyncExitStack.enter_async_context(foo())` is not actually equivalent to `async with foo()` regarding raised exception context. The symptom is a very long, unhelpful tracebacks because the __context__ of raised exceptions is not set to the expected object. https://github.com/python-trio/trio/issues/2001 I can't speak to this solution myself, but njsmith suggests this amendment to contextlib: saved_context = exc_details[1].__context__ try: raise exc_details[1] finally: exc_details[1].__context__ = saved_context ---------- components: Library (Lib) messages: 397230 nosy: John Belmonte, njs priority: normal severity: normal status: open title: AsyncExitStack.enter_async_context() is mishandling exception __context__ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:16:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Jul 2021 00:16:35 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1625876195.03.0.904275030918.issue43897@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2f7636887e9f978352aa47b18d5f376263663ba1 by Batuhan Taskaya in branch '3.10': [3.10] bpo-43897: ast validation for pattern matching nodes (GH-27074) https://github.com/python/cpython/commit/2f7636887e9f978352aa47b18d5f376263663ba1 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:17:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Jul 2021 00:17:59 +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: <1625876279.31.0.502610051468.issue43908@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Yeah, I think these should be changed, but lest give a bit of time for other core devs to mention what they think ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:29:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Jul 2021 00:29:45 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1625876985.24.0.737345599006.issue44317@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f24777c2b329974b69d2a3bf5cfc37e0fcace36c by Pablo Galindo Salgado in branch 'main': bpo-44317: Improve tokenizer errors with more informative locations (GH-26555) https://github.com/python/cpython/commit/f24777c2b329974b69d2a3bf5cfc37e0fcace36c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:29:58 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Jul 2021 00:29:58 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1625876998.97.0.660704126502.issue44317@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25629 pull_request: https://github.com/python/cpython/pull/27079 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:36:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 10 Jul 2021 00:36:38 +0000 Subject: [issue44573] Organize some data files in the Lib/test directory In-Reply-To: <1625606631.33.0.288717184507.issue44573@roundup.psfhosted.org> Message-ID: <1625877398.25.0.554680336686.issue44573@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> not a bug status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:47:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Jul 2021 00:47:41 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1625878061.65.0.0390761245787.issue44317@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2a722d4fab6a9656f3c03cfdaf6d1684277b8af5 by Miss Islington (bot) in branch '3.10': bpo-44317: Improve tokenizer errors with more informative locations (GH-26555) (GH-27079) https://github.com/python/cpython/commit/2a722d4fab6a9656f3c03cfdaf6d1684277b8af5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 20:47:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 10 Jul 2021 00:47:54 +0000 Subject: [issue44317] Suggestion for better syntax errors in tokenizer errors In-Reply-To: <1622890870.25.0.904012906945.issue44317@roundup.psfhosted.org> Message-ID: <1625878074.51.0.536535233997.issue44317@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 Jul 9 21:41:27 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 10 Jul 2021 01:41:27 +0000 Subject: [issue44587] argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types In-Reply-To: <1625807257.47.0.987336531003.issue44587@roundup.psfhosted.org> Message-ID: <1625881287.97.0.545298246979.issue44587@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +rhettinger title: BooleanOptionalAction displays default=SUPPRESS unlike other action types -> argparse BooleanOptionalAction displays default=SUPPRESS unlike other action types _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 23:48:03 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Jul 2021 03:48:03 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625888883.9.0.0281497407491.issue43219@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25631 pull_request: https://github.com/python/cpython/pull/27082 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 23:47:58 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Jul 2021 03:47:58 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625888878.1.0.109375943867.issue43219@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25630 pull_request: https://github.com/python/cpython/pull/27081 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 9 23:47:59 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Jul 2021 03:47:59 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625888879.21.0.615357819846.issue43219@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 248173cc0483a9ad9261353302f1234cf9eb2ebe by andrei kulakov in branch 'main': bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) https://github.com/python/cpython/commit/248173cc0483a9ad9261353302f1234cf9eb2ebe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 00:07:41 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Jul 2021 04:07:41 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625890061.7.0.385954148893.issue43219@roundup.psfhosted.org> miss-islington added the comment: New changeset 1577259cc51d0d46ad676798ce0a130039acf956 by Miss Islington (bot) in branch '3.10': bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) https://github.com/python/cpython/commit/1577259cc51d0d46ad676798ce0a130039acf956 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 00:14:07 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 10 Jul 2021 04:14:07 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625890447.68.0.0696624870457.issue43219@roundup.psfhosted.org> miss-islington added the comment: New changeset c89f0b2587eb0b16175a0bbb12d0b86314ff9320 by Miss Islington (bot) in branch '3.9': [3.9] bpo-43219: shutil.copyfile, raise a less confusing exception instead of IsADirectoryError (GH-27049) (GH-27082) https://github.com/python/cpython/commit/c89f0b2587eb0b16175a0bbb12d0b86314ff9320 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 01:27:56 2021 From: report at bugs.python.org (Jos Dechamps) Date: Sat, 10 Jul 2021 05:27:56 +0000 Subject: [issue44595] round() gives wrong result Message-ID: <1625894876.44.0.790089861054.issue44595@roundup.psfhosted.org> New submission from Jos Dechamps : round(0.3368655,6) returns 0.336865 instead of 0.336866 ---------- messages: 397238 nosy: dechamps priority: normal severity: normal status: open title: round() gives wrong result type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 01:30:38 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 10 Jul 2021 05:30:38 +0000 Subject: [issue44595] round() gives wrong result In-Reply-To: <1625894876.44.0.790089861054.issue44595@roundup.psfhosted.org> Message-ID: <1625895038.2.0.489438257274.issue44595@roundup.psfhosted.org> Vedran ?a?i? added the comment: Have you seen the Note at https://docs.python.org/3/library/functions.html?highlight=Note#round? ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 01:41:41 2021 From: report at bugs.python.org (Pierre Quentel) Date: Sat, 10 Jul 2021 05:41:41 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1625895701.07.0.0893339949829.issue44589@roundup.psfhosted.org> Pierre Quentel added the comment: Sorry, I don't know C so I can't write a PR for this change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 02:36:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 10 Jul 2021 06:36:58 +0000 Subject: [issue44595] round() gives wrong result In-Reply-To: <1625894876.44.0.790089861054.issue44595@roundup.psfhosted.org> Message-ID: <1625899018.01.0.13265273423.issue44595@roundup.psfhosted.org> Steven D'Aprano added the comment: Not a bug, the result is correct. Python floats are binary floating point values, not decimal. 0.3368655's actual value is exactly: 0.336865499999999984392928809029399417340755462646484375 so when rounding to six decimal places, the seventh decimal place is a four, not five, and it rounds down to 0.336865. To be precise, it rounds down to: 0.336865000000000025526247782181599177420139312744140625 ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 02:55:40 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 10 Jul 2021 06:55:40 +0000 Subject: [issue44596] Operand coercion breaks MappingProxyType encapsulation Message-ID: <1625900140.09.0.950032205736.issue44596@roundup.psfhosted.org> New submission from Nick Coghlan : The fast locals proxy implementation for PEP 558 used the existing MappingProxyType implementation as a starting point. This meant I noticed the following code in the mapping proxy comparison implementation: ====== static PyObject * mappingproxy_richcompare(mappingproxyobject *v, PyObject *w, int op) { return PyObject_RichCompare(v->mapping, w, op); } ====== Seeing that code lead to trying the following experiment: ========== >>> from types import MappingProxyType >>> d = {} >>> proxy = MappingProxyType(d) >>> class Sneaky: ... def __eq__(self, other): ... if other is d: ... raise RuntimeError("Broke encapsulation") ... >>> proxy == Sneaky() Traceback (most recent call last): File "", line 1, in File "", line 4, in __eq__ RuntimeError: Broke encapsulation ========== The new `__or__` implementation has a corresponding loophole: ======== >>> class SneakyOr: ... def __or__(self, other): ... if other is d: ... raise RuntimeError("Broke encapsulation") ... def __ror__(self, other): ... return self.__or__(other) ... >>> proxy | SneakyOr() Traceback (most recent call last): File "", line 1, in File "", line 6, in __ror__ File "", line 4, in __or__ RuntimeError: Broke encapsulation ======== Delegating these operations to the underlying mapping via the abstract operation layer means that the underlying mapping gets exposed to the operand coercion machinery and can hence be accessed by the other operand. ---------- messages: 397242 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Operand coercion breaks MappingProxyType encapsulation type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 06:00:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Jul 2021 10:00:37 +0000 Subject: [issue44596] Operand coercion breaks MappingProxyType encapsulation In-Reply-To: <1625900140.09.0.950032205736.issue44596@roundup.psfhosted.org> Message-ID: <1625911237.74.0.313146683165.issue44596@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a duplicate of issue43838. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> There is a way to access an underlying mapping in MappingProxyType _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 06:07:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 10 Jul 2021 10:07:00 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1625911620.03.0.357876719646.issue43838@roundup.psfhosted.org> Serhiy Storchaka added the comment: Example of modifying a builtin type: >>> class Sneaky: ... def __eq__(self, other): ... other['real'] = 42 ... >>> int.__dict__ == Sneaky() >>> (1).real 42 But it can also lead to crash (due to outdated type cache): >>> class Sneaky: ... def __eq__(self, other): ... other['bit_length'] = 42 ... >>> int.__dict__ == Sneaky() >>> (1).bit_length Segmentation fault (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 06:27:23 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sat, 10 Jul 2021 10:27:23 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1625912843.83.0.51279172293.issue43838@roundup.psfhosted.org> Nick Coghlan added the comment: I stumbled across this independently in bpo-44596, but missed this existing report due to the specific word I was looking for (encapsulation). In addition to the comparison operand coercion, there's now another access option through the `__ror__` method. The bug in both cases arises from delegating a method/function implementation to the underlying mapping type in a way that invokes the full operand coercion dance. (PyObject_RichCompare in one case, PyNumber_Or in the other) Delegating these operations to the underlying mapping does make sense, but it needs to be a lower level delegation that bypasses the operand coercion dance, so the other operand only ever sees the proxy object, not the underlying mapping. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 07:02:27 2021 From: report at bugs.python.org (Sam Harding) Date: Sat, 10 Jul 2021 11:02:27 +0000 Subject: [issue44597] Poll returns POLLOUT on Pipe read endpoint on MacOS 10.14 Message-ID: <1625914947.01.0.465830160545.issue44597@roundup.psfhosted.org> New submission from Sam Harding : The behaviour of select.poll() is inconsistent across MacOS versions, on MacOS Mojave (10.14.6) registering and polling the receiving channel of mp.Pipe(duplex=False) returns the event POLLOUT (ready to write to). This is verified by a colleagues setup. Whereas on MacOS 11 the same scenario will not have poll() return that the receiving channel is ready for writing to (POLLOUT). Example: ### import select import multiprocessing as mp recv_end, send_end = mp.Pipe(duplex=False) poll = select.poll() poll.register(recv_end) print(poll.poll(1000)) ### MacOS 10.14.6 Result: > [(3,4)] MacOS 11.0.1 Result: > [] I am assuming that the MacOS 11 behaviour is should be the expected behaviour, and that the recv connection from a Pipe should never return that it is writable. This was tested with Python 3.9.4, and 3.7.6. ---------- components: Extension Modules, macOS messages: 397246 nosy: ned.deily, ronaldoussoren, samh42 priority: normal severity: normal status: open title: Poll returns POLLOUT on Pipe read endpoint on MacOS 10.14 type: behavior versions: Python 3.7, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 07:40:50 2021 From: report at bugs.python.org (Robert) Date: Sat, 10 Jul 2021 11:40:50 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1625917250.52.0.28038757568.issue43299@roundup.psfhosted.org> Robert added the comment: You see the usecase from the stack trace: PythonWin (the IDE from pywin32 package) uses pyclbr - to inspect arbitrary user code. (Neither code is from me) I'm not inspecting __main__ explicitely. The problem seems to arise in newer Python versions (3.10+?) because the class browser now seems to parse imports somehow recursively (_readmodule() several times in the stack trace) and when user code somewhere contains e.g. "import __main__" ... pyclbr should perhaps handle (not fail in) all legal cases w/o breaking: when some strange builtin/extension/artificial has .__spec__ as None or not set or no python code. (We cannot force any user code to monkey patch __main__.__spec__ or potential other modules.) >>> mod = types.ModuleType('mymod') >>> mod.__spec__ # (None) >>> importlib.util._find_spec_from_path() has choosen to raise ValueError instead of an extra custom Error (or a special return value) for those cases and to return None for the similar case of 'not found') . Though those 3 cases are similiar in consequence here. pyclbr also "cheaply abuses" ImportError / ModuleNotFound to translate one of those cases (None return value) for internal signaling. (There is never a real ImportError just remote linguistic similarity ;-) ) Hence the simple pragmatic fix by kind of reunification of signaling the "end of the game" here - as the way of signaling here is anyway rather pragmatic and evolution style. ValueError is often (ab)used to signal application level errors "cheaply" (to not define and distribute an extra Exception type) - and its a limited internal case here where mix-up with errors from something like "math.sqrt(-1)" is not possible w/o coding bugs (which are to be detected by tests) But you may establish a more meticulous error / return value signaling system - which though will require changes / refactoring in several places and consideration for compatibility ... (Think its hardly worth it) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 07:46:20 2021 From: report at bugs.python.org (Alireza Pourali) Date: Sat, 10 Jul 2021 11:46:20 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1625917580.49.0.889331383646.issue43124@roundup.psfhosted.org> Change by Alireza Pourali : ---------- components: -email type: security -> performance 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 Jul 10 08:45:29 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Sat, 10 Jul 2021 12:45:29 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1625921129.3.0.809934040551.issue40897@roundup.psfhosted.org> Mauricio Villegas added the comment: I think this is affecting me or it is a new similar issue. And it is not only for python 3.9, but also from 3.6 up. I am working on making code configurable based on signatures (see https://jsonargparse.readthedocs.io/en/stable/#classes-methods-and-functions). Now we need this to work for datetime.timedelta which defines parameters in __new__ instead of __init__. The following happens: >>> from datetime import timedelta >>> import inspect >>> inspect.signature(timedelta.__new__) >>> inspect.signature(timedelta.__init__) >>> inspect.signature(timedelta) ... ValueError: no signature found for builtin type I am expecting to get parameters for days, seconds, microseconds, milliseconds, minutes, hours and weeks, see https://github.com/python/cpython/blob/bfe544d2f2c2e7a7c03a764bed3276a1e27a0f5c/Lib/datetime.py#L461-L462. Hopefully this gives some insight into what should be done. Independent from the fix, I would like to know if currently there is any way I can get the signature for __new__ that I could use until there is a proper fix for it. ---------- nosy: +mauvilsa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 10:51:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 10 Jul 2021 14:51:15 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1625928675.27.0.214908462967.issue43838@roundup.psfhosted.org> Change by Guido van Rossum : ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 11:03:04 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Sat, 10 Jul 2021 15:03:04 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1625929384.32.0.211620956002.issue43219@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 11:06:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 10 Jul 2021 15:06:52 +0000 Subject: [issue25457] json dump fails for mixed-type keys when sort_keys is specified In-Reply-To: <1445500861.68.0.856599723102.issue25457@psf.upfronthosting.co.za> Message-ID: <1625929612.18.0.915573838228.issue25457@roundup.psfhosted.org> Andrei Kulakov added the comment: Some observations: - sort_keys arg does a deep sorting of nested dictionaries. It's a bit too much to ask users to do this type of preprocessing manually before dumping to json. - the error doesn't seem too onerous to me. 'unorderable types: str() < int()' If uncertain, a user can go to interactive shell and try `1 < "2"`, and then the issue is obvious. - to me, current behaviour seems preferable to silently guessing that users wants stringified sorting, especially since it can surface as a problem way down the line. - what makes this issue interesting is that in roughly half of cases (I'm guessing) the user will want object sorted and then cast to string and would be surprised if the reverse happened, and in the other half cases the user would want them stringified, then sorted, and would be surprised if that didn't happen. It depends on the perspective: you may think of the json as a representation of a dict of objects, that just happen to be in json format; or you can think of it as a json document with string keys (of course) that just happen to come from a dict of objects. Both can be valid depending on the use case. Given all of this, I propose keeping current behavior for the existing arg, and adding another arg for 'stringify then sort' behavior. Then we'll have no silent guessing and the "unorderable" type error message can point the user directly to the new argument. If the user reads the docs before using this method, they will see two clear options with respective tradeoffs and decide which one to use. So either by reading the docs or running into the error, the user will have a clear explanation and a clear and convenient solution. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 13:34:02 2021 From: report at bugs.python.org (Christian Tanzer) Date: Sat, 10 Jul 2021 17:34:02 +0000 Subject: [issue25457] json dump fails for mixed-type keys when sort_keys is specified In-Reply-To: <1445500861.68.0.856599723102.issue25457@psf.upfronthosting.co.za> Message-ID: <78F24CF3-5269-442A-A253-A4E902E9BE5E@swing.co.at> Christian Tanzer added the comment: ?Json keys *are strings*. That?s why json.dump stringifies all keys. If you want to argue that this behavior is wrong I wouldn?t protest except for that it breaks extant code. But arguing that sorting the stringified keys would violate user?s expectations or lead to problems down the line makes no sense. The user is asking for an object with string keys and they want the keys sorted. That is unambiguous and well defined. Neither does adding a second argument make any sense, it would just increase the confusion. My problem was that Python 3.x threw an exception about this for a complex json object in a context where it was not at all obvious what was going on. And the code in question had worked for years in Python 2. This bug report is many, many years old and I don?t much care one way or another but I am very sad that Practicality beats purity got utterly lost in and after the transition to Python 3. Christian Tanzer > On 10.07.2021, at 16:12, Andrei Kulakov wrote: > ? > Andrei Kulakov added the comment: > > Some observations: > > - sort_keys arg does a deep sorting of nested dictionaries. It's a bit too much to ask users to do this type of preprocessing manually before dumping to json. > > - the error doesn't seem too onerous to me. 'unorderable types: str() < int()' If uncertain, a user can go to interactive shell and try `1 < "2"`, and then the issue is obvious. > > - to me, current behaviour seems preferable to silently guessing that users wants stringified sorting, especially since it can surface as a problem way down the line. > > - what makes this issue interesting is that in roughly half of cases (I'm guessing) the user will want object sorted and then cast to string and would be surprised if the reverse happened, and in the other half cases the user would want them stringified, then sorted, and would be surprised if that didn't happen. > > It depends on the perspective: you may think of the json as a representation of a dict of objects, that just happen to be in json format; or you can think of it as a json document with string keys (of course) that just happen to come from a dict of objects. Both can be valid depending on the use case. > > Given all of this, I propose keeping current behavior for the existing arg, and adding another arg for 'stringify then sort' behavior. Then we'll have no silent guessing and the "unorderable" type error message can point the user directly to the new argument. > > If the user reads the docs before using this method, they will see two clear options with respective tradeoffs and decide which one to use. > > So either by reading the docs or running into the error, the user will have a clear explanation and a clear and convenient solution. > > ---------- > nosy: +andrei.avk > > _______________________________________ > Python tracker > > _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 15:33:14 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 10 Jul 2021 19:33:14 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1625945594.3.0.0309876691404.issue44589@roundup.psfhosted.org> Change by Brandt Bucher : ---------- assignee: -> brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 18:31:24 2021 From: report at bugs.python.org (David Hoyes) Date: Sat, 10 Jul 2021 22:31:24 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1625956284.47.0.705899944859.issue44594@roundup.psfhosted.org> Change by David Hoyes : ---------- nosy: +David Hoyes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 18:35:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 10 Jul 2021 22:35:23 +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: <1625956523.44.0.534423092645.issue44517@roundup.psfhosted.org> Erlend E. Aasland added the comment: FYI, this buildbot has been green after Victor's git clean?adjustment in the buildbot repo. I've been trying to reproduce the test_still_running failure on the buildbot, but have not been able to do so deterministically. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 18:35:36 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Sat, 10 Jul 2021 22:35:36 +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: <1625956536.42.0.136487725194.issue44517@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 20:00:25 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 11 Jul 2021 00:00:25 +0000 Subject: [issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives In-Reply-To: <1609452860.68.0.697253388073.issue42799@roundup.psfhosted.org> Message-ID: <1625961625.93.0.174609598626.issue42799@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 2.0 -> 3.0 pull_requests: +25632 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27084 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 20:01:43 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 11 Jul 2021 00:01:43 +0000 Subject: [issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives In-Reply-To: <1609452860.68.0.697253388073.issue42799@roundup.psfhosted.org> Message-ID: <1625961703.26.0.681670871536.issue42799@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up the PR here: https://github.com/python/cpython/pull/27084/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 10 21:17:33 2021 From: report at bugs.python.org (Tim Peters) Date: Sun, 11 Jul 2021 01:17:33 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1625966253.04.0.588458504263.issue44571@roundup.psfhosted.org> Tim Peters added the comment: I agree Raymond's `before_and_after()` looks like an elegant, efficient, and usable approach to this. One minor nit: there's no need for the `iter()` call in: yield from iter(transition) Indeed, it confused me at first, because `yield from x` does its own `iter(x)` call under the covers, and since everyone knows that ;-) , I wondered what deep trickery calling it again was intended to pull off. But I persuaded myself there was no such subtle intent - it's just redundant. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 10:54:32 2021 From: report at bugs.python.org (tongxiaoge) Date: Sun, 11 Jul 2021 14:54:32 +0000 Subject: [issue44568] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault In-Reply-To: <1625503086.3.0.822137637944.issue44568@roundup.psfhosted.org> Message-ID: <1626015272.35.0.714285351454.issue44568@roundup.psfhosted.org> Change by tongxiaoge : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:15:39 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 11 Jul 2021 16:15:39 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626020139.84.0.578633012564.issue29753@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +25633 pull_request: https://github.com/python/cpython/pull/27085 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:15:52 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 11 Jul 2021 16:15:52 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1626020152.95.0.578487039886.issue43838@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:19:41 2021 From: report at bugs.python.org (tongxiaoge) Date: Sun, 11 Jul 2021 16:19:41 +0000 Subject: [issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault Message-ID: <1626020381.6.0.201295772935.issue44598@roundup.psfhosted.org> New submission from tongxiaoge : I have reproduced this problem in the latest versions of Python 3.8.11 and 3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. The failure log is as follows? [ 613s] 0:02:27 load avg: 4.66 Re-running failed tests in verbose mode [ 613s] 0:02:27 load avg: 4.66 Re-running test_ssl in verbose mode [ 613s] test_ssl: testing with 'OpenSSL 1.1.1f 31 Mar 2020' (1, 1, 1, 6, 15) [ 613s] under 'Linux-5.4.6-x86_64-with-glibc2.2.5' [ 613s] HAS_SNI = True [ 613s] OP_ALL = 0x80000054 [ 613s] OP_NO_TLSv1_1 = 0x10000000 [ 613s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok [ 613s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok [ 613s] test_check_hostname (test.test_ssl.ContextTests) ... ok [ 613s] test_ciphers (test.test_ssl.ContextTests) ... ok [ 613s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault [ 613s] [ 613s] Current thread 0x00007ff433b90740 (most recent call first): [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 483 in __new__ [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in test_constructor [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in _callTestMethod [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in run [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in __call__ [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__ [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in run [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in __call__ [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in run [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2030 in _run_suite [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 2152 in run_unittest [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in test_main [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 234 in _runtest_inner2 [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 270 in _runtest_inner [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 153 in _runtest [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", line 193 in runtest [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 318 in rerun_failed_tests [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 694 in _main [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 637 in main [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 715 in main [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in _main [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 87 in _run_code [ 613s] File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 194 in _run_module_as_main [ 613s] /var/tmp/rpm-tmp.lFeeM8: line 50: 15891 Segmentation fault WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug $(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils -x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio [ 613s] error: Bad exit status from /var/tmp/rpm-tmp.lFeeM8 (%check) What is the reason for this? and is there a plan to fix it? ---------- assignee: christian.heimes components: SSL, Tests messages: 397254 nosy: Guido.van.Rossum, christian.heimes, sxt1001, vstinner priority: normal severity: normal status: open title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault type: crash versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:23:20 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 11 Jul 2021 16:23:20 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626020600.26.0.109406940666.issue29753@roundup.psfhosted.org> Filipe La?ns added the comment: Unfortunately, the fix has some unforeseen side-effects, so we'll have to revert it :/ ---------- resolution: fixed -> status: closed -> open versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:37:45 2021 From: report at bugs.python.org (Christian Heimes) Date: Sun, 11 Jul 2021 16:37:45 +0000 Subject: [issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault In-Reply-To: <1626020381.6.0.201295772935.issue44598@roundup.psfhosted.org> Message-ID: <1626021465.88.0.79929721227.issue44598@roundup.psfhosted.org> Christian Heimes added the comment: Python 3.9.5 and OpenSSL 1.1.1f are both outdated. Can you reproduce the problem with 3.9.6 and 1.1.1k? Can you tel us more about your system (distribution, CPU arch, compiler) and provide a C stacktrace with debug symbols? ---------- nosy: -Guido.van.Rossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:44:08 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Jul 2021 16:44:08 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626021848.52.0.445393404431.issue29753@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25634 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27086 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 12:44:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 11 Jul 2021 16:44:09 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626021849.97.0.43665326137.issue29753@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset e14d5ae5447ae28fc4828a9cee8e9007f9c30700 by Filipe La?ns in branch 'main': bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085) https://github.com/python/cpython/commit/e14d5ae5447ae28fc4828a9cee8e9007f9c30700 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 13:12:20 2021 From: report at bugs.python.org (Amanieu) Date: Sun, 11 Jul 2021 17:12:20 +0000 Subject: [issue44599] Changing logging format for one handler changes it for all Message-ID: <1626023540.4.0.759613436664.issue44599@roundup.psfhosted.org> New submission from Amanieu : I want to stream a logger to several streams. Changing the standard format works, but changing the formatException function changes it for all! As I am not entirely sure if it is a feature and I am misunderstanding something, I have posted on SO on this topic: https://stackoverflow.com/questions/68244691/changing-logging-format-for-one-handler-changes-it-for-all It looks like an unexpected behavior to me when reading the doc. ---------- components: Library (Lib) messages: 397258 nosy: hyamanieu priority: normal severity: normal status: open title: Changing logging format for one handler changes it for all type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 13:47:14 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 11 Jul 2021 17:47:14 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626025634.79.0.478241999832.issue29753@roundup.psfhosted.org> miss-islington added the comment: New changeset 42da46ed522157b057d73e6b623615ef6427999e by Miss Islington (bot) in branch '3.10': bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085) https://github.com/python/cpython/commit/42da46ed522157b057d73e6b623615ef6427999e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 14:52:32 2021 From: report at bugs.python.org (Charles Machalow) Date: Sun, 11 Jul 2021 18:52:32 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1626025634.79.0.478241999832.issue29753@roundup.psfhosted.org> Message-ID: Charles Machalow added the comment: Maybe we need to add a __packing__ option to specify how packing should work and default to legacy behavior. Then allow users to specify if they want similar behavior cross-os. Otherwise changing this does change packing for existing users and can lead to breakages. What exactly was the hit regression here? On Sun, Jul 11, 2021, 10:47 AM miss-islington wrote: > > miss-islington added the > comment: > > > New changeset 42da46ed522157b057d73e6b623615ef6427999e by Miss Islington > (bot) in branch '3.10': > bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085) > > https://github.com/python/cpython/commit/42da46ed522157b057d73e6b623615ef6427999e > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 14:57:16 2021 From: report at bugs.python.org (Sam Price) Date: Sun, 11 Jul 2021 18:57:16 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: Message-ID: Sam Price added the comment: I?ve been looking forward to this fix. The old implementation did not match what my LLVM compiler generated. On Sun, Jul 11, 2021 at 2:52 PM Charles Machalow wrote: > > Charles Machalow added the comment: > > Maybe we need to add a __packing__ option to specify how packing should > work and default to legacy behavior. Then allow users to specify if they > want similar behavior cross-os. > > Otherwise changing this does change packing for existing users and can lead > to breakages. > > What exactly was the hit regression here? > > On Sun, Jul 11, 2021, 10:47 AM miss-islington > wrote: > > > > > miss-islington added the > > comment: > > > > > > New changeset 42da46ed522157b057d73e6b623615ef6427999e by Miss Islington > > (bot) in branch '3.10': > > bpo-29753: revert 0d7ad9f (GH-19850) (GH-27085) > > > > > https://github.com/python/cpython/commit/42da46ed522157b057d73e6b623615ef6427999e > > > > > > ---------- > > > > _______________________________________ > > Python tracker > > > > _______________________________________ > > > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > -- Thank you, Sam Price (707) 742-3726 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 14:58:48 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 11 Jul 2021 18:58:48 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626029928.68.0.663234500528.issue29753@roundup.psfhosted.org> Filipe La?ns added the comment: Sorry for not posting a link here, see https://github.com/python/cpython/pull/19850#issuecomment-869410686. The issue is not legacy behavior, it's that the fix messed up the functionality and that was not caught by tests. I don't have much time to look into why that happened right now, but I will when I get a chance. Sorry! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 16:45:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 11 Jul 2021 20:45:38 +0000 Subject: [issue8595] Explain the default timeout in http-client-related libraries In-Reply-To: <1272768884.43.0.28527344604.issue8595@psf.upfronthosting.co.za> Message-ID: <1626036338.67.0.228566852099.issue8595@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 6.0 -> 7.0 pull_requests: +25635 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27087 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 16:48:51 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 11 Jul 2021 20:48:51 +0000 Subject: [issue8595] Explain the default timeout in http-client-related libraries In-Reply-To: <1272768884.43.0.28527344604.issue8595@psf.upfronthosting.co.za> Message-ID: <1626036531.42.0.325562586055.issue8595@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up the doc update PR: https://github.com/python/cpython/pull/27087 I did not add a module level default timeouts to these modules because it seems to me most of the issue is users being unaware of the current global default, which is fixed by docs update; then it's easy to set the timeout when calling respective functions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 17:02:55 2021 From: report at bugs.python.org (Ned Batchelder) Date: Sun, 11 Jul 2021 21:02:55 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 Message-ID: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> New submission from Ned Batchelder : Some simple match/case statements show incorrect tracing. Below is the code to run, as well as the output. Output lines with initial stars are incorrect: they incorrectly indicate that case bodies are executing when they are not. Sorry for the bulk here, I wanted to give you all the cases I had. -- 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 match_with_default(): for command in ["huh", "go home", "go n"]: print(command) match command.split(): case ["go", direction] if direction in "nesw": match = f"go: {direction}" case ["go", _]: match = "no go" case _: match = "default" print(match) def match_with_wildcard(): for command in ["huh", "go home", "go n"]: print(command) match command.split(): case ["go", direction] if direction in "nesw": match = f"go: {direction}" case ["go", _]: match = "no go" case x: match = f"default: {x}" print(match) def match_without_wildcard(): match = None for command in ["huh", "go home", "go n"]: print(command) match command.split(): case ["go", direction] if direction in "nesw": match = f"go: {direction}" case ["go", _]: match = "no go" print(match) print(sys.version) sys.settrace(trace) match_with_default() match_with_wildcard() match_without_wildcard() -- 8< ------------------------------------- Output: 3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def match_with_default(): line 11: for command in ["huh", "go home", "go n"]: line 12: print(command) huh line 13: match command.split(): line 14: case ["go", direction] if direction in "nesw": line 15: match = f"go: {direction}" line 16: case ["go", _]: * line 17: match = "no go" line 19: match = "default" line 20: print(match) default line 11: for command in ["huh", "go home", "go n"]: line 12: print(command) go home line 13: match command.split(): line 14: case ["go", direction] if direction in "nesw": line 16: case ["go", _]: line 17: match = "no go" line 20: print(match) no go line 11: for command in ["huh", "go home", "go n"]: line 12: print(command) go n line 13: match command.split(): line 14: case ["go", direction] if direction in "nesw": line 15: match = f"go: {direction}" line 20: print(match) go: n line 11: for command in ["huh", "go home", "go n"]: retu 11: for command in ["huh", "go home", "go n"]: call 22: def match_with_wildcard(): line 23: for command in ["huh", "go home", "go n"]: line 24: print(command) huh line 25: match command.split(): line 26: case ["go", direction] if direction in "nesw": * line 27: match = f"go: {direction}" line 28: case ["go", _]: * line 29: match = "no go" line 30: case x: line 31: match = f"default: {x}" line 32: print(match) default: ['huh'] line 23: for command in ["huh", "go home", "go n"]: line 24: print(command) go home line 25: match command.split(): line 26: case ["go", direction] if direction in "nesw": line 28: case ["go", _]: line 29: match = "no go" line 32: print(match) no go line 23: for command in ["huh", "go home", "go n"]: line 24: print(command) go n line 25: match command.split(): line 26: case ["go", direction] if direction in "nesw": line 27: match = f"go: {direction}" line 32: print(match) go: n line 23: for command in ["huh", "go home", "go n"]: retu 23: for command in ["huh", "go home", "go n"]: call 34: def match_without_wildcard(): line 35: match = None line 36: for command in ["huh", "go home", "go n"]: line 37: print(command) huh line 38: match command.split(): line 39: case ["go", direction] if direction in "nesw": * line 40: match = f"go: {direction}" line 41: case ["go", _]: * line 42: match = "no go" line 43: print(match) None line 36: for command in ["huh", "go home", "go n"]: line 37: print(command) go home line 38: match command.split(): line 39: case ["go", direction] if direction in "nesw": line 41: case ["go", _]: line 42: match = "no go" line 43: print(match) no go line 36: for command in ["huh", "go home", "go n"]: line 37: print(command) go n line 38: match command.split(): line 39: case ["go", direction] if direction in "nesw": line 40: match = f"go: {direction}" line 43: print(match) go: n line 36: for command in ["huh", "go home", "go n"]: retu 36: for command in ["huh", "go home", "go n"]: ---------- components: Interpreter Core messages: 397264 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: match/case statements trace incorrectly in 3.10.0b4 versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 18:00:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Sun, 11 Jul 2021 22:00:10 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626040810.79.0.204744223881.issue44600@roundup.psfhosted.org> Change by Mark Shannon : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 18:09:13 2021 From: report at bugs.python.org (Zac Gross) Date: Sun, 11 Jul 2021 22:09:13 +0000 Subject: [issue10716] Modernize pydoc to use better HTML and separate CSS In-Reply-To: <1292491539.55.0.135732310832.issue10716@psf.upfronthosting.co.za> Message-ID: <1626041353.07.0.887917119075.issue10716@roundup.psfhosted.org> Zac Gross added the comment: Hey all, I'd like to note my interest in this issue getting addressed. I have a use case where I'd like to generate documentation for a module and using non-core modules to do that requires some approval that I would like to avoid. I understand there are other more important issues but this issue has had a patch waiting for review for ten years. Can we move this forward somehow? ---------- nosy: +brickman1444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 18:10:08 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 11 Jul 2021 22:10:08 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626041408.47.0.114842231628.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks, I'll take a closer look at this soon (most likely this coming week). Out of curiosity, do we have a standard way of writing regression tests for correct line numbers like this? Of the top of my head, it seems like we could either statically compare the dis output (fragile) or actually execute some code with a trace function enabled and check the line hits (tricky). Neither really seems ideal, so I'm wondering if there's be a better way? ---------- assignee: -> brandtbucher type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 18:18:49 2021 From: report at bugs.python.org (Tyler Crompton) Date: Sun, 11 Jul 2021 22:18:49 +0000 Subject: [issue38825] shutil.disk_usage - Lacking documentation In-Reply-To: <1573942798.11.0.196925055555.issue38825@roundup.psfhosted.org> Message-ID: <1626041929.22.0.834566645359.issue38825@roundup.psfhosted.org> Tyler Crompton added the comment: Not even the kernel knows how much space is available on a nonmounted partition. It doesn't know much beyond the fact that it exists and where it exists. There exist tools that can analyze nonmounted partitions, but these will vary by filesystem and operating system. If someone wants to implement solutions for the most common filesystem-OS combinations, then that might be helpful. But considering that no one has done that or even asked for it yet, I'm not sure that doing so is worth the effort. So I agree that documenting it is the best approach. It should be documented such that the limitations are mentioned, not necessarily how it's implemented. If explaining which system calls are used helps explain the limitations, then so be it. Additionally, as far as I'm concerned, there's no reason to restrict other Python implementations from implementing functionality for nonmounted disks. So the limitations should be described as being CPython-specific, akin to what is done for `readline.set_auto_history`. ---------- nosy: +tylercrompton _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 19:21:14 2021 From: report at bugs.python.org (Xiang Zhong) Date: Sun, 11 Jul 2021 23:21:14 +0000 Subject: [issue44601] argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options Message-ID: <1626045674.23.0.119206602345.issue44601@roundup.psfhosted.org> New submission from Xiang Zhong : Additional argument like "allow_abbrev_short" should be added to avoid those potential bugs due to abbreviations on short options cannot be handled by "allow_abbrev". To reproduce and be well explanation, please check on my attached testing file. The following is the excerpt: 1) contents in link: https://docs.python.org/3/library/argparse.html#prefix-matching should be updated to long options (two dashes) 2) bugs may happen due to `allow_abbrev' cannot handle short options when recycling top-level arguments by using `add_subparsers' ---------- components: Library (Lib) files: myargparse.py messages: 397268 nosy: zhongxiang117 priority: normal severity: normal status: open title: argparse: potential bugs on add_subparser due to allow_abbrev cannot deal with short options type: behavior versions: Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50143/myargparse.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 19:25:02 2021 From: report at bugs.python.org (Rajesh) Date: Sun, 11 Jul 2021 23:25:02 +0000 Subject: [issue44602] Issue with get_build_version in msvc9compiler.py in distutils Message-ID: <1626045902.73.0.895322421093.issue44602@roundup.psfhosted.org> New submission from Rajesh : get_build_version method in msvc9compiler.py file in distutils folder is returning MSVC version as "14.2" for Python 3.9. 14.2 is the build version for Visual Studio 2015, but Visual studio 2015 wont work on Windows 10 as per the below link https://visualstudio.microsoft.com/vs/support/vs2015/visual-studio-2015-system-requirements/ So, Python 3.9 wont work on Windows 10? I am trying to install wxPython 4.0.7 using "pip install wxPython==4.0.7" but facing error to find the visual studio in Windows 10 using Python 3 ---------- messages: 397269 nosy: kalyan priority: normal severity: normal status: open title: Issue with get_build_version in msvc9compiler.py in distutils type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 20:10:05 2021 From: report at bugs.python.org (Brandon Schabell) Date: Mon, 12 Jul 2021 00:10:05 +0000 Subject: [issue44159] mimetypes - "strict" on Windows In-Reply-To: <1621281298.07.0.0030957833024.issue44159@roundup.psfhosted.org> Message-ID: <1626048605.76.0.258758117424.issue44159@roundup.psfhosted.org> Change by Brandon Schabell : ---------- keywords: +patch nosy: +brandonschabell nosy_count: 5.0 -> 6.0 pull_requests: +25636 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27088 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 20:11:29 2021 From: report at bugs.python.org (Rajesh) Date: Mon, 12 Jul 2021 00:11:29 +0000 Subject: [issue44602] Issue with get_build_version in msvc9compiler.py in distutils In-Reply-To: <1626045902.73.0.895322421093.issue44602@roundup.psfhosted.org> Message-ID: <1626048689.51.0.545602190808.issue44602@roundup.psfhosted.org> Rajesh added the comment: Recently Microsoft also removed support to install Visual Studio 2015 installation using installer, so users who need visual studio 2015 must download and then install. This will cause issues to Python packages that depend on distutils which again depends on visual studio 2015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 20:22:47 2021 From: report at bugs.python.org (John Belmonte) Date: Mon, 12 Jul 2021 00:22:47 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1626049367.61.0.72716857275.issue44594@roundup.psfhosted.org> Change by John Belmonte : ---------- keywords: +patch nosy: +jbelmonte nosy_count: 3.0 -> 4.0 pull_requests: +25637 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27089 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 20:48:58 2021 From: report at bugs.python.org (Brandon Schabell) Date: Mon, 12 Jul 2021 00:48:58 +0000 Subject: [issue44564] DeprecationWarning in test_enum over formatting In-Reply-To: <1625459046.43.0.477755678755.issue44564@roundup.psfhosted.org> Message-ID: <1626050938.79.0.11228259398.issue44564@roundup.psfhosted.org> Change by Brandon Schabell : ---------- keywords: +patch nosy: +brandonschabell nosy_count: 2.0 -> 3.0 pull_requests: +25638 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27090 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 20:56:20 2021 From: report at bugs.python.org (John Belmonte) Date: Mon, 12 Jul 2021 00:56:20 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1626051380.12.0.506442792275.issue44594@roundup.psfhosted.org> John Belmonte added the comment: demonstrating the difference for async case: import contextlib import trio async def background(): assert False async def main1(): async with trio.open_nursery() as nursery: nursery.start_soon(background) await trio.sleep_forever() async def main2(): async with contextlib.AsyncExitStack() as stack: nursery = await stack.enter_async_context(trio.open_nursery()) nursery.start_soon(background) await trio.sleep_forever() try: trio.run(main1) except BaseException as e: print('main1, context:', e.__context__) try: trio.run(main2) except BaseException as e: print('main2, context:', e.__context__) ---- main1, context: None main2, context: Cancelled ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 21:31:37 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 01:31:37 +0000 Subject: [issue41354] filecmp.cmp documentation does not match actual code In-Reply-To: <1595316543.83.0.558279011146.issue41354@roundup.psfhosted.org> Message-ID: <1626053497.91.0.025899679738.issue41354@roundup.psfhosted.org> Andrei Kulakov added the comment: Christof: I've left one comment on the PR. Generally your reasoning (on why unexpected deep cmp is not ideal), makes sense to me. However, this is a backwards incompatible change that will probably affect a large number of a lot of scripts that quietly run in the background and might silently break (i.e. just by affecting different sets of files, with no reported errors or warnings) with this change. Can you find other instances where people complained about this behavior e.g. here on BPO or SO? What do you think about making this change while preserving backwards compatibility e.g. via a new arg? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:09:54 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Mon, 12 Jul 2021 03:09:54 +0000 Subject: [issue44599] Changing logging format for one handler changes it for all In-Reply-To: <1626023540.4.0.759613436664.issue44599@roundup.psfhosted.org> Message-ID: <1626059394.58.0.203124480255.issue44599@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:15:45 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 12 Jul 2021 03:15:45 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() Message-ID: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> New submission from Stargirl Flowers : Presently, when using REPL if a user types simply "exit", they are greeted with a message instructing them to do it "correctly": >>> exit Use exit() or Ctrl-Z plus Return to exit It comes across as a little surprising that (1) the program knows what I meant and (2) the program told me it wouldn't do it unless I request it in a very specific way. This isn't very user-friendly behavior. Further surprising is the inconsistent behavior of the other built-ins described on interpreter start-up. "copyright" and "credits" work fine without being invoked as a function, whereas "help" and "license" rebuff the user. I know there are compelling technical reasons for the current behavior, however, this behavior is a bit off-putting for newcomers. Knowing the technical reasons behind this behavior made me *more* frustrated than less frustrated. Python is a lovely language and I think we should do what we can to be friendlier to users. I propose a few changes to fix this specific issue: (1) Include "exit" in the interpreter startup message, making it: Type "help", "copyright", "credits" or "license" for more information, and type "exit" to quit Python. (2) Make the interactive interpreter exit when the user types simply "exit" or "quit. To address some possible edge cases an objections: - if (2) proves too controversial, we should at least do (1) with the slight modification of "exit" to "exit()". - if there is a concern about accidentally exiting the interpreter, there are several strategies we can use. First, we can only activate this behavior if, and only if, Python is being used as an interactive interpreter. From what I can tell, main() is already distinguishing this case. Second, if absolutely necessary we could ask the user to confirm that they want to exit. For example: >>> exit Are you sure you want to exit Python? (yes/no): For what it's worth, I am willing to do this work, however, I might need a little guidance to find the right bits. ---------- components: Demos and Tools messages: 397273 nosy: theacodes priority: normal severity: normal status: open title: REPL: exit when the user types exit instead of asking them to explicitly type exit() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:15:54 2021 From: report at bugs.python.org (Aritn Sarraf) Date: Mon, 12 Jul 2021 03:15:54 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide functionality similar to dask's delayed interface Message-ID: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> New submission from Aritn Sarraf : For those not familiar, the dask delayed interface allows a user to define a DAG through a functional invocation interface. Dask docs here: https://docs.dask.org/en/latest/delayed.html Another example of this kind of interface is airflow's new TaskFlow api: https://airflow.apache.org/docs/apache-airflow/stable/concepts/taskflow.html The proposed solution would look something like this. Essentially all we're doing is defining a decorator that will allow you to pass in coroutines to another coroutine, and will resolve the dependent coroutines before passing the results to your dependent coroutine. # Note0: can be removed, see Note2 below async def task_wrapper(val): return val def task(afunc): # open to other names for the decorator since it might be a bit ambiguous async def inner(*args): # Note1: real solution would be expanded to args/kwargs # Note2: `task_wrapper` kind of unneccesary, we can just conditionally not gather in those cases args = [arg if inspect.isawaitable(arg) else task_wrapper(arg) for arg in args] args = await asyncio.gather(*args) return await afunc(*args) return inner The advantage this gives us in asyncio is that we can easily build processing pipelines where each piece is completely independent and does not know anything about any other piece of the pipeline. Obviously this is already possible currently, but this simple wrapper will provide a very clean way to connect it all together. Take the following example, where we want to fetch data for various ids and post process/upload them. @task async def fetch(x): # Note3: timings here defined to demo obvious expected async behavior in completion order of print statements sleep_time = {'a1': 1, 'a2': 2, 'b1': 4, 'b2': 0.5, 'c1': 6, 'c2': 3.5}[x] await asyncio.sleep(sleep_time) ret_val = f'f({x})' print(f'Done {ret_val}') return ret_val async def process(x1, x2): await asyncio.sleep(1) ret_val = f'p({x1}, {x2})' print(f'Done {ret_val}') return ret_val Notice we didn't decorate `process`, this is to allow us to demonstrate how you can still use the interface on functions that you can't or don't want to decorate. Now to define/execute our pipeline we can simply do this. : async def main(): fa1 = fetch('a1') fa2 = fetch('a2') fb1 = fetch('b1') fb2 = fetch('b2') fc1 = fetch('c1') fc2 = fetch('c2') pa = task(process)(fa1, fa2) pb = task(process)(fb1, fb2) pc = task(process)(fc1, fc2) return await asyncio.gather(pa, pb, pc) loop = asyncio.new_event_loop() loop.run_until_complete(main()) This will be a very simple non-breaking inclusion to the library, that will allow users to build clean/straightforward asynchronous processing pipelines/DAGs. ---------- components: asyncio messages: 397274 nosy: asarraf, asvetlov, yselivanov priority: normal severity: normal status: open title: [Enhancement] Asyncio task decorator to provide functionality similar to dask's delayed interface type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:40:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 03:40:03 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626061203.46.0.107255982932.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks, Stargirl for opening this issue and for the thorough description and proposals. I am sympathetic with the idea and the general proposal and (unsurprisingly) I agree with (1). For (2) there are some challenges here to consider. The most important one is that the mechanism to show those messages is really the repr() of the exit() built-in the one showing the message: >>> x = exit >>> repr(x) 'Use exit() or Ctrl-D (i.e. EOF) to exit' There is no other mechanism in the interpreter that triggers anything when the user inputs that. The most straightforward way is to raise SystemExit from the repr() of the built-in but that has some obvious problems. As printing anything where the exit function lives will also raise SystemExit (for instance printing the builtins module or objects in the GC). For these reasons I propose to go with (1) with the slight modification of "exit" to "exit()". ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:46:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 03:46:25 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626061585.52.0.745186684533.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For reference, this behaviour lives here: https://github.com/python/cpython/blob/e14d5ae5447ae28fc4828a9cee8e9007f9c30700/Lib/_sitebuiltins.py#L13-L26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:56:24 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 12 Jul 2021 03:56:24 +0000 Subject: [issue41972] bytes.find consistently hangs in a particular scenario In-Reply-To: <1602113519.53.0.297229304628.issue41972@roundup.psfhosted.org> Message-ID: <1626062184.73.0.539610323195.issue41972@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- pull_requests: +25639 pull_request: https://github.com/python/cpython/pull/27091 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 11 23:57:27 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 12 Jul 2021 03:57:27 +0000 Subject: [issue41972] bytes.find consistently hangs in a particular scenario In-Reply-To: <1602113519.53.0.297229304628.issue41972@roundup.psfhosted.org> Message-ID: <1626062247.6.0.499668817634.issue41972@roundup.psfhosted.org> Dennis Sweeney added the comment: In "Fast String Searching" (1991), A. Hume and D. Sunday emphasize that most of the runtime of string-search algorithms occurs in a code path that skips over immediately-disqualified alignments. As such, that paper recommends extracting a hot "Horspool" code path and keeping it small. For that reason, I'm posting a PR which boils down that fast path to the following: while (skip > 0 && window_last < haystack_end) { window_last += skip; skip = table[(*window_last) & 63]; } This uses two memory accesses, whereas the last implementation used three (the extra to get window[cut]). This requires the skip table to change slightly, since it is indexed by the last character in the current haystack window rather than one character later ("fast" versus "sd1" in the paper). The paper also recommends unrolling this loop 3x, but my benchmarks found no benefit to unrolling. The PR also refactors some of the main fastsearch code into separate functions, and computes and then uses a similar gap/skip integer used already in the default implementation (Hume and Sunday call this "md2"). It retains a linear-time constant space worst-case with the Two-Way algorithm. There are a bunch of benchmarks here, both on Zipf-distributed random strings and on a few c/rst/python/binary files in the cpython repo. They compare the current main branch to the PR: https://gist.github.com/sweeneyde/fc20ed5e72dc6b0f3b41c0abaf4ec3be Summary of those results: On the Zipf strings: * 83 cases slower (at most 1.59x slower) * 654 cases faster (up to 4.49x faster) * Geometric mean: 1.10x faster On the "Real world" source files: * 76 cases slower (at most 2.41x slower) * 420 cases faster (up to 18.12x faster) * Geometric mean: 1.33x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:21:05 2021 From: report at bugs.python.org (Glyph Lefkowitz) Date: Mon, 12 Jul 2021 05:21:05 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses Message-ID: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> New submission from Glyph Lefkowitz : Consider the following example that attempts to make a series of types sortable by their class name: from functools import total_ordering @total_ordering class SortableMeta(type): def __new__(cls, name, bases, ns): return super().__new__(cls, name, bases, ns) def __lt__(self, other): if not isinstance(other, SortableMeta): pass return self.__name__ < other.__name__ def __eq__(self, other): if not isinstance(other, SortableMeta): pass return self.__name__ == other.__name__ class B(metaclass=SortableMeta): pass class A(metaclass=SortableMeta): pass print(A < B) print(A > B) This should just print "True", "False", but instead the second comparison raises this exception: Traceback (most recent call last): File "total_ordering_metaclass.py", line 27, in print(A > B) File "lib/python3.9/functools.py", line 91, in _gt_from_lt op_result = self.__lt__(other) TypeError: expected 1 argument, got 0 The problem here is that functools considers .__special__ to be equivalent to operator.special. I'm pretty sure this should be invoking "self < other" rather than self.__lt__(other). ---------- components: Library (Lib) messages: 397278 nosy: glyph priority: normal severity: normal stage: needs patch status: open title: functools.total_ordering doesn't work with metaclasses type: behavior versions: Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:22:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 05:22:27 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1626067347.85.0.228689123175.issue43299@roundup.psfhosted.org> Andrei Kulakov added the comment: Robert: thanks for the response.. I looked a bit more into it and I'm starting to think it's a PyWin issue, not pyclbr. It seems to me that PyWin is calling pyclbr readmodule_ex with module='__main__', and pyclbr is supposed to find it on the filesystem. The problem is, '__main__' is the special name for current script or interactive session. It doesn't give pyclbr any info on where the script might be, if it exists (maybe it's pywin's interactive window?). So, unless someone more familiar with pyclbr steps in and gives us a bit more insight, I think the best course may be to report this to PyWin. They might also know more about pyclbr, perhaps they've run into similar issues with it before! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:23:29 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 05:23:29 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1626067409.13.0.627816379079.issue43299@roundup.psfhosted.org> Andrei Kulakov added the comment: (Also if they are able to help, please report back here and update this issue, that will be much appreciated!) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:33:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 12 Jul 2021 05:33:30 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types Message-ID: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> New submission from Serhiy Storchaka : 1. Different handling of None: >>> isinstance(None, int | type(None)) True >>> issubclass(type(None), int | type(None)) True >>> isinstance(None, int | None) True >>> issubclass(type(None), int | None) False 2. Different handling of virtual subclasses: >>> import collections.abc >>> isinstance({}, int | collections.abc.Mapping) True >>> issubclass(dict, int | collections.abc.Mapping) False I do not know what behavior is correct. ---------- components: Interpreter Core messages: 397281 nosy: gvanrossum, serhiy.storchaka priority: normal severity: normal status: open title: Discrepancy between isinstance() and issubclass() for union types type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:39:28 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 12 Jul 2021 05:39:28 +0000 Subject: [issue44599] Changing logging format for one handler changes it for all In-Reply-To: <1626023540.4.0.759613436664.issue44599@roundup.psfhosted.org> Message-ID: <1626068368.53.0.661480226189.issue44599@roundup.psfhosted.org> Vinay Sajip added the comment: > It looks like an unexpected behavior to me when reading the doc. Perhaps you missed this? https://docs.python.org/3/library/logging.html?highlight=exc_text#logging.Formatter.format "Note that the formatted exception information is cached in attribute exc_text. This is useful because the exception information can be pickled and sent across the wire, but you should be careful if you have more than one Formatter subclass which customizes the formatting of exception information. In this case, you will have to clear the cached value after a formatter has done its formatting, so that the next formatter to handle the event doesn?t use the cached value but recalculates it afresh." ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 01:53:59 2021 From: report at bugs.python.org (Glyph Lefkowitz) Date: Mon, 12 Jul 2021 05:53:59 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1626069239.47.0.154366095236.issue44605@roundup.psfhosted.org> Glyph Lefkowitz added the comment: Adding versions after confirming the bug is the same on 3.10 ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 02:31:57 2021 From: report at bugs.python.org (John Belmonte) Date: Mon, 12 Jul 2021 06:31:57 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1626071517.17.0.185817733303.issue44594@roundup.psfhosted.org> John Belmonte added the comment: To clarify the problem case, I believe the discrepancy is seen when raising exceptions as follows: exc = foo() try: raise exc finally: exc.__context__ = None (From my understanding, Trio has valid use cases for doing this since it wants to control complex exception chaining, and this is beyond the scope of __suppress_context__.) Neither ExitStack nor AsyncExcitStack are preserving the None context in the case above. === `with` statement === Traceback (most recent call last): File "exit_stack_test.py", line 251, in assert False File "/.../python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "exit_stack_test.py", line 244, in my_cm raise exc MyException === enter_context() === Traceback (most recent call last): File "exit_stack_test.py", line 240, in my_cm yield File "exit_stack_test.py", line 259, in assert False AssertionError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "exit_stack_test.py", line 259, in assert False File "/.../python3.7/contextlib.py", line 524, in __exit__ raise exc_details[1] File "/.../python3.7/contextlib.py", line 509, in __exit__ if cb(*exc_details): File "/.../python3.7/contextlib.py", line 377, in _exit_wrapper return cm_exit(cm, exc_type, exc, tb) File "/.../python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "exit_stack_test.py", line 244, in my_cm raise exc MyException ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 02:33:45 2021 From: report at bugs.python.org (John Belmonte) Date: Mon, 12 Jul 2021 06:33:45 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1626071625.99.0.27177468395.issue44594@roundup.psfhosted.org> John Belmonte added the comment: [reposting the example, with source] example: class MyException(Exception): pass @contextmanager def my_cm(): try: yield except BaseException: exc = MyException() try: raise exc finally: exc.__context__ = None print('\n=== `with` statement ===') try: with my_cm(): assert False except BaseException as e: traceback.print_exc() print('\n=== enter_context() ===') try: with ExitStack() as stack: stack.enter_context(my_cm()) assert False except BaseException as e: traceback.print_exc() output: === `with` statement === Traceback (most recent call last): File "exit_stack_test.py", line 251, in assert False File "/.../python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "exit_stack_test.py", line 244, in my_cm raise exc MyException === enter_context() === Traceback (most recent call last): File "exit_stack_test.py", line 240, in my_cm yield File "exit_stack_test.py", line 259, in assert False AssertionError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "exit_stack_test.py", line 259, in assert False File "/.../python3.7/contextlib.py", line 524, in __exit__ raise exc_details[1] File "/.../python3.7/contextlib.py", line 509, in __exit__ if cb(*exc_details): File "/.../python3.7/contextlib.py", line 377, in _exit_wrapper return cm_exit(cm, exc_type, exc, tb) File "/.../python3.7/contextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "exit_stack_test.py", line 244, in my_cm raise exc MyException ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 02:39:03 2021 From: report at bugs.python.org (=?utf-8?b?0JrQvtC90YHRgtCw0L3RgtC40L0g0JPQu9GD0YXQvtCy?=) Date: Mon, 12 Jul 2021 06:39:03 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626071943.43.0.310368741717.issue44572@roundup.psfhosted.org> Change by ?????????? ?????? : ---------- keywords: +patch pull_requests: +25640 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27092 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 02:48:56 2021 From: report at bugs.python.org (Muffinlicious) Date: Mon, 12 Jul 2021 06:48:56 +0000 Subject: [issue44607] Teleport method for turtle class Message-ID: <1626072536.55.0.653021323155.issue44607@roundup.psfhosted.org> New submission from Muffinlicious : I use turtle pretty often in a teaching setting. It's extremely common that I'll define the following function at the top of my code: def teleport(x, y): turtle.penup() turtle.setpos(x, y) turtle.pendown() Shouldn't this sort of method already exist within the turtle class? ---------- components: Tkinter messages: 397286 nosy: Muffinlicious priority: normal severity: normal status: open title: Teleport method for turtle class type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 03:00:30 2021 From: report at bugs.python.org (stardust222) Date: Mon, 12 Jul 2021 07:00:30 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten Message-ID: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> New submission from stardust222 <490661700 at qq.com>: In the following code, the memory use of function _tkinter._flatten is increase as the number of calls when I input an illegal value. import sys import tracemalloc import _tkinter arg_list = [] arg_list.append('ptqiioaaejhdoat') # check for memory usage memory_recorder = [] tracemalloc.start() start_snapshot = tracemalloc.take_snapshot() for i in range(0, 100): try: _tkinter._flatten(arg_list[0]) except: pass if i % 10 == 0: one_snapshot = tracemalloc.take_snapshot() memory_recorder.append(one_snapshot.compare_to(start_snapshot, 'lineno')[0]) for i in range(2, len(memory_recorder)): if str(memory_recorder[i].traceback) == str(memory_recorder[1].traceback): print(memory_recorder[i].traceback) print(memory_recorder[i].size) tracemalloc.stop() And the output on my machine is test.py:19 3248 test.py:19 4800 test.py:19 6448 test.py:19 8000 test.py:19 9648 test.py:19 11248 test.py:19 12848 test.py:19 14400 ---------- components: C API messages: 397287 nosy: Stardust1225 priority: normal severity: normal status: open title: Memory use increase in function _tkinter._flatten type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 03:31:56 2021 From: report at bugs.python.org (Amanieu) Date: Mon, 12 Jul 2021 07:31:56 +0000 Subject: [issue44599] Changing logging format for one handler changes it for all In-Reply-To: <1626023540.4.0.759613436664.issue44599@roundup.psfhosted.org> Message-ID: <1626075116.27.0.6777405318.issue44599@roundup.psfhosted.org> Amanieu added the comment: Yes I did miss that. My bad and thank you so much. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 03:40:22 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Mon, 12 Jul 2021 07:40:22 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1626075622.1.0.827800602187.issue43948@roundup.psfhosted.org> Change by Tzu-ping Chung : ---------- keywords: +patch pull_requests: +25641 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27093 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 03:48:36 2021 From: report at bugs.python.org (John Belmonte) Date: Mon, 12 Jul 2021 07:48:36 +0000 Subject: [issue44594] AsyncExitStack.enter_async_context() is mishandling exception __context__ In-Reply-To: <1625875193.61.0.628325060677.issue44594@roundup.psfhosted.org> Message-ID: <1626076116.21.0.691065293918.issue44594@roundup.psfhosted.org> John Belmonte added the comment: cc: ncoghlan for help with ExitStack exception context ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 04:10:34 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 12 Jul 2021 08:10:34 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626077434.05.0.561794738976.issue44603@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 stage: -> needs patch type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:01:29 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 12 Jul 2021 09:01:29 +0000 Subject: [issue44207] Add a version number to Python functions In-Reply-To: <1621612378.09.0.0247616387464.issue44207@roundup.psfhosted.org> Message-ID: <1626080489.87.0.0521917326415.issue44207@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 9487a17e3c7cbb3f11c144775cd108601701bb74 by Mark Shannon in branch 'main': bpo-44207: Add an internal version number to function objects. (GH-27078) https://github.com/python/cpython/commit/9487a17e3c7cbb3f11c144775cd108601701bb74 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:19:21 2021 From: report at bugs.python.org (Art) Date: Mon, 12 Jul 2021 09:19:21 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626081561.0.0.425274104534.issue44604@roundup.psfhosted.org> Change by Art : ---------- title: [Enhancement] Asyncio task decorator to provide functionality similar to dask's delayed interface -> [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:37:24 2021 From: report at bugs.python.org (David Goncalves) Date: Mon, 12 Jul 2021 09:37:24 +0000 Subject: [issue33178] Add support for BigEndianUnion and LittleEndianUnion in ctypes In-Reply-To: <1522331303.68.0.467229070634.issue33178@psf.upfronthosting.co.za> Message-ID: <1626082644.61.0.334870484013.issue33178@roundup.psfhosted.org> David Goncalves added the comment: PR 25480 passes checks and awaits core review. All comments thus far have been addressed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:37:51 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 12 Jul 2021 09:37:51 +0000 Subject: [issue44607] Teleport method for turtle class In-Reply-To: <1626072536.55.0.653021323155.issue44607@roundup.psfhosted.org> Message-ID: <1626082671.07.0.950041260261.issue44607@roundup.psfhosted.org> Vedran ?a?i? added the comment: In my view, turtle is a great tool for exploring _polar_ coordinates. If you set emphasis to rectangular coordinates, there are many tools that are much better. Second, your function might be ok for you, but it is really not suitable for standard library. Probably you meant something like (a method) def teleport(self, *args): restore = self.isdown() self.penup() self.setpos(*args) if restore: self.pendown() ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:43:17 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Mon, 12 Jul 2021 09:43:17 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626082997.81.0.320250441401.issue44603@roundup.psfhosted.org> Vedran ?a?i? added the comment: Of course, the "license" mention should be changed in the same way (in the same message). ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 05:52:07 2021 From: report at bugs.python.org (Taylor Alexander) Date: Mon, 12 Jul 2021 09:52:07 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626083527.11.0.833531483318.issue44603@roundup.psfhosted.org> Taylor Alexander added the comment: Hello all. Curious issue. Thanks Stargirl for opening it. Would it be possible for the __repr__ function to examine the calling commands and determine if the origin is the special case where exit is typed in the REPL? Then only when Quitter repr is called would the special case be checked. I?m not too familiar with Python internals but I know for example when an exception occurs a stack trace would include information like that. Probably performance of Quitter repr isn?t critical we just don?t want it to have the wrong behavior. But if there?s any way to determine in that call if we?re in this one special case it seems it would be safe to exit. ---------- nosy: +tlalexander _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 06:12:19 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Mon, 12 Jul 2021 10:12:19 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1626084739.43.0.435736885472.issue44583@roundup.psfhosted.org> Ronald Oussoren added the comment: IMHO the most important question to answer first is: Why is adding OSF1 support a good idea? The PR, which IMHO in its current state is not mergeable, adds some complexity to the build and ongoing maintenance of CPython itself. This tends to be acceptable for in-use and maintained operating systems, but is a lot less so for hardware and operating systems that are basically museum pieces. So, why do you want to run bleeding edge CPython on such hardware? And as Terry mentioned this is something that should be discussed on python-dev, not on the tracker. A secondary, but still important, question is the support question. A fairly recent discussion on Solaris support should give some insight as to what's required there: https://mail.python.org/archives/list/python-dev at python.org/thread/VDD7NMEDFXMOP4S74GEYJUHJRJPK2UR3/. And note that OpenSolaris appears to be a lot more actively used and supported than OSF1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 06:15:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 10:15:11 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626084911.18.0.653169707271.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Unfortunately, I don't know how that can help because the stack trace is the same in these two cases: >>> import traceback >>> class A: ... def __repr__(self): ... traceback.print_stack() >>> A() File "", line 1, in File "", line 4, in __repr__ Traceback (most recent call last): File "", line 1, in TypeError: __repr__ returned non-string (type NoneType) >>> print([A()]) File "", line 1, in File "", line 4, in __repr__ Traceback (most recent call last): File "", line 1, in TypeError: __repr__ returned non-string (type NoneType) This also becomes a bit tricky if __repr__ is called from C code or from native threads. In general, the underlying problem is that __repr__ should not have side effects. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 06:47:43 2021 From: report at bugs.python.org (Taylor Alexander) Date: Mon, 12 Jul 2021 10:47:43 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626086863.15.0.120501734884.issue44603@roundup.psfhosted.org> Taylor Alexander added the comment: Makes sense. Thanks for taking a look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 07:14:37 2021 From: report at bugs.python.org (Jay Krell) Date: Mon, 12 Jul 2021 11:14:37 +0000 Subject: [issue44583] Failure to build on OSF1. In-Reply-To: <1625731472.11.0.0989263409796.issue44583@roundup.psfhosted.org> Message-ID: <1626088477.71.0.947875067839.issue44583@roundup.psfhosted.org> Jay Krell added the comment: I have a machine up and running that I would like to run this on. Perhaps that is vastly inadequate. Nothing is free, I realize. And Solaris, agreed, would seem to merit "more" support, but zero==zero. I will see if I can setup a buildbot and I am wondering being a core developer, if I have the time, ability (probably), approval, etc. As long as Solaris is in an amd64 VM (not SPARC) I am interested in that as well. I have run it recently and it is vastly easier/faster than OSF1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 07:18:15 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 12 Jul 2021 11:18:15 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626088695.4.0.77945091585.issue44353@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Jelle I can try to implement it in C to see if it will give better performance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:06:44 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 12 Jul 2021 12:06:44 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626091604.87.0.697486940811.issue44353@roundup.psfhosted.org> Ken Jin added the comment: @Yurii, I would like to caution against a C accelerator for the typing module. My reasoning follows: 1. The maintenance burden is higher. typing is already somewhat complex in Python (lots of MRO/metaclass wizardry). A C module would require knowledge of the C API. 2. Following from 1., I fear it may raise the barrier for contributions. This is purely anecdotal but I think there are more contributors who know Python than Python + C API. 3. C API code is much more error-prone than Python code. 4. It's very hard to find available reviewers for typing-related C changes. 5. Backports become harder due to point 3. and 4. Also C code needs much more scrutiny. If we cause some obscure bug in Python, it raises an exception; in C it potentially segfaults and kills the interpreter. 6. Third-party monkey-patching becomes harder. Unfortunately, I can't offer a good solution to this issue at the moment either. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:16:45 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 12 Jul 2021 12:16:45 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626092205.28.0.158928834526.issue44603@roundup.psfhosted.org> Steven D'Aprano added the comment: I strongly oppose this change. Merely printing an object should not have a side-effect of this magnitude. Standard Python behaviour is that an object's repr should return a useful string, not exit the interpreter. This is a backwards-incompatible change: right now, it is perfectly safe to print the builtins namespace in the interactive interpreter: vars(builtins) Doing so gives you are rather large dict, but it is safe and useful. If we make exit actually exit the interpreter instead of print a human readable string, printing the builtins will no longer be safe. It will surprisingly exit in the middle of printing the dict. `exit` is not magic syntax, it is an actual object. It exists in the builtins namespace. We can put it in lists, we can introspect it and treat it like any other object. And most importantly, we can print it and get a useful string. It is not user-friendly to introduce magical special cases. To call a function, Python always requires parentheses. In the builtins and stdlib there are no special cases of functions that magically perform some task just by trying to view it in the interactive interpreter. (Of course third party code can do anything. If somebody wants the `+` operator to exit the interpreter, or len(obj) to erase their hard drive, Python will allow it.) Making a handful of objects -- help, exit (quit), license -- behave differently to everything else is not user friendly. Consistency is more important than convenience, especially when it comes to something like exit where the side-effect is to exit the interpreter. What of copyright and credits? I think their design is a mistake, especially copyright. With 11 lines of output, the copyright object seriously uglifies printing the builtins. But at least it doesn't exit the interpreter. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:20:45 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 12 Jul 2021 12:20:45 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626092445.22.0.390255729222.issue44603@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a backwards-incompatible change, at the very least it needs an okay from the core devs (and possibly even a PEP) not just a patch. Stargirl Flowers suggested: > we could ask the user to confirm that they want to exit Please, no, that is the very opposite of a user-friendly change! If I call exit() in the REPL, I want to exit. ---------- stage: needs patch -> versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:33:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 12 Jul 2021 12:33:22 +0000 Subject: [issue44607] Teleport method for turtle class In-Reply-To: <1626072536.55.0.653021323155.issue44607@roundup.psfhosted.org> Message-ID: <1626093202.57.0.575015107229.issue44607@roundup.psfhosted.org> Serhiy Storchaka added the comment: What other Turtle implementations support the teleport command? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:48:18 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Jul 2021 12:48:18 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626094098.72.0.646274468701.issue26329@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25642 pull_request: https://github.com/python/cpython/pull/27094 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:48:26 2021 From: report at bugs.python.org (Joannah Nanjekye) Date: Mon, 12 Jul 2021 12:48:26 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626094106.8.0.434826963652.issue26329@roundup.psfhosted.org> Joannah Nanjekye added the comment: New changeset 66c5853406bbcccecf35372795078c0641a5f385 by Furkan Onder in branch 'main': bpo-26329: update os.path.normpath documentation (GH-20138) https://github.com/python/cpython/commit/66c5853406bbcccecf35372795078c0641a5f385 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 08:48:24 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Jul 2021 12:48:24 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626094104.51.0.803809614826.issue26329@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25643 pull_request: https://github.com/python/cpython/pull/27095 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:08:46 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 12 Jul 2021 13:08:46 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626095326.07.0.132658705114.issue44603@roundup.psfhosted.org> Stargirl Flowers added the comment: I don't think we should completely write off the possibility of doing this just because the *current* implementation is counter-intuitive. As I expressed in the original post, the explanation of this behavior is rather unsatisfying to newcomers. Also @steven.daprano, please do not confuse one recommendation for implementation for the concept. I agree that printing the Quitter object should not exit the interpreter. However, I disagree that "exit" should not be a special case. Specifically, when using the interactive interpreter the behavior (regardless of implementation strategy) would ideally be: >>> exit (interpreter exit) >>> exit() (interpreter exit) >>> print(exit) Call "exit()" to quit Python. When using the interactive interpreter you can simply type "exit". This behavior closely matches IPython's behavior, and even a cursory search reveals not only individual users running into this and being frustrated, but even threads where this behavior has reached "meme status": https://twitter.com/0xabad1dea/status/1414204661360472065?s=19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:09:10 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 12 Jul 2021 13:09:10 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626095350.03.0.662226088785.issue44603@roundup.psfhosted.org> Stargirl Flowers added the comment: Also, if a PEP is recommended, I will be happy to author it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:26:04 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 13:26:04 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626096364.75.0.653335387023.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > However, I disagree that "exit" should not be a special case. But a special case of *what*? How would you implement this in a backwards-compatible way? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:32:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 13:32:17 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626096737.66.0.738595859177.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: IPython and other reprs are an entire abstraction layer on top of Python, which allows them to do a lot of extra things like implement new commands and alters a lot of behaviours, but the CPython REPL is just the interpreter evaluating commands, and this is very coupled with the regular machinery, at to the point that is the tokenizer the one consuming input (lazily!) from standard input. Unless I am missing anything, the only way to do the desired behaviour is to re-architect part of how interactive mode works or to directly make exit a keyword, which is backwards incompatible. I may be missing simpler ways of course, but in general, my opinion is that anything that involves modifying the compiler pipeline to somehow special case this is too much cost for the advantage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:43:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 13:43:51 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626097431.84.0.859419900134.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For reference, IPython has an entire interception + filtering mechanism to auto call certain functions: https://github.com/ipython/ipython/blob/0e4d6390b2174fb1b352a082b72ad387ae696e87/IPython/core/prefilter.py#L414-L425 where exit is one instance of this: https://github.com/ipython/ipython/blob/81b87f20aa8836b42fbb2b1dee7b662d8d5d46c6/IPython/core/autocall.py#L51-L57 As you can see, this requires an entirely different execution abstraction and a new layer in the middle that filters/intercepts the user input **after** it has been transformed into some intermediate representation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 09:55:12 2021 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 12 Jul 2021 13:55:12 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626098112.94.0.359497018222.issue44603@roundup.psfhosted.org> Paul Ganssle added the comment: If we want to confine the behavior to just the repl, we could possibly have the repl set an environment variable or something of that nature for interactive sessions, so that `__repr__` of `exit` can tell the difference between being invoked in a REPL and not ? though I suppose it could cause some pretty frustrating and confusing behavior if some library function is doing something like this behind the scenes: ``` def get_all_reprs(): return { v: repr(obj) for v, obj in globals() ] ``` You could invoke some function and suddenly your shell quits for no apparent reason. And if it only happens when triggered in a REPL, you'd be doubly confused because you can't reproduce it with a script. I do think the "type exit() to exit" is a papercut. The ideal way to fix it would be in the REPL layer by special-casing `exit`, but I realize that that may introduce unnecessary complexity that isn't worth it for this one thing. > Second, if absolutely necessary we could ask the user to confirm that they want to exit. A thought occurs: we could simply re-word the message to make it seem like we're asking for confirmation: ``` >>> exit Do you really want to exit? Press Ctrl+Z to confirm, or type exit() to exit without confirmation. ``` Then it won't seem as much like we know what you meant to do but aren't doing it, despite the fact that the behavior is exactly the same ?. ---------- nosy: +p-ganssle _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:03:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 14:03:12 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626098592.69.0.0151792871776.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > would be in the REPL layer by special-casing `exit` Unfortunately, there is no REPL *layer* as my previous comments mentioned. There is a few details that change for interactive mode but fundamentally the pipeline is the same as reading from a file, except that the file is stdin and it has some special logic in the parser to do that in a lazy way and fail fast. But there is no semantic information that separates REPL for non-REPL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:16:42 2021 From: report at bugs.python.org (pavel-lexyr) Date: Mon, 12 Jul 2021 14:16:42 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1626099402.86.0.0680258316265.issue44571@roundup.psfhosted.org> pavel-lexyr added the comment: There is a core part of the `takedowhile` proposal's use case that I am having trouble envisioning via the alternative `before_and_after` proposal. If the `after` part of the iterator the user does not engage with, the transitional elements will be stuck indefinitely. What would a correct usage be, in case one wants the following two conditions to hold true: 1. the amount of elements after the first falsifying one is minimal, i.e. 0 2. all the yielded elements are processed no matter what? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:19:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 14:19:50 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626099590.33.0.871245949638.issue44603@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25644 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27096 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:19:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 14:19:58 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626099598.31.0.597661910923.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: One thing we *could* do which is not super invasive, is to match a single AST node of type NAME at the end of Python run. This seems to work but is a bit inelegant: >>> print(exit) Use exit() or Ctrl-D (i.e. EOF) to exit >>> [exit] [Use exit() or Ctrl-D (i.e. EOF) to exit] >>> exit bye! I have opened a draft with this in PR27096 ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:26:54 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 12 Jul 2021 14:26:54 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626100014.9.0.353442495724.issue44603@roundup.psfhosted.org> Stargirl Flowers added the comment: I do want to be cautious of saying that we can't do it because of the way the REPL is currently implemented- which appears to be an implementation driven by convenience more than necessity. I also find pushing against special-case behavior in the REPL strange. The REPL already has special-case behavior: printing the header, the __interactivehook__ that configures readline, heck, the `>>>` are unique the REPL and plainly copy-pasting a REPL session into a file won't work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:39:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 14:39:05 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626100745.02.0.155605515038.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I do want to be cautious of saying that we can't do it because of the way the REPL is currently implemented- which appears to be an implementation driven by convenience more than necessity. Apologies if I have not been clear on this. Is not that we can't do it, is just the balance between complexity and the benefits of the change. > I also find pushing against special-case behavior in the REPL strange. The REPL already has special-case behavior: printing the header, the __interactivehook__ that configures readline, heck, the `>>>` are unique the REPL and plainly copy-pasting a REPL session into a file won't work. But that is just printing, not semantic behaviour. What we are discussing here is to give a different semantic behaviour to exit NAME only in interactive mode. This is fundamentally different that just printing or make the parser show ">>>" every time it asks for a new line, as those are not changing the *meaning* of Python code. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:42:48 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Mon, 12 Jul 2021 14:42:48 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626100968.31.0.322014563911.issue44603@roundup.psfhosted.org> Stargirl Flowers added the comment: Fair point about semantic behavior and complexity, but hopefully we can come up with a solution that's easier for users. I do like the PR suggested. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 10:52:52 2021 From: report at bugs.python.org (Paul Ganssle) Date: Mon, 12 Jul 2021 14:52:52 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626101572.44.0.585294961025.issue44603@roundup.psfhosted.org> Paul Ganssle added the comment: I'm +1 for Pablo's approach. That's approximately what I meant by "special-case it in the REPL layer" anyway. Are there any downsides to doing it this way? It seems tightly scoped and with minimal overhead. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:04:28 2021 From: report at bugs.python.org (Christof Hanke) Date: Mon, 12 Jul 2021 15:04:28 +0000 Subject: [issue41354] filecmp.cmp documentation does not match actual code In-Reply-To: <1595316543.83.0.558279011146.issue41354@roundup.psfhosted.org> Message-ID: <1626102268.62.0.160049731421.issue41354@roundup.psfhosted.org> Christof Hanke added the comment: Andrei, See https://bugs.python.org/issue42958 Someone else stumbled over this topic. Maybe you can merge these two requests? Otherwise, I'm fine with a new arg. Christof ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:05:08 2021 From: report at bugs.python.org (Christof Hanke) Date: Mon, 12 Jul 2021 15:05:08 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626102308.51.0.449013531633.issue42958@roundup.psfhosted.org> Christof Hanke added the comment: Hi, this is also discussed in https://bugs.python.org/issue41354. Ciao, Christof ---------- nosy: +chanke _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:05:02 2021 From: report at bugs.python.org (Tarun Johar) Date: Mon, 12 Jul 2021 15:05:02 +0000 Subject: [issue44609] Buffer support in the stable ABI Message-ID: <1626102302.84.0.543468149442.issue44609@roundup.psfhosted.org> New submission from Tarun Johar : PEP 384 and PEP 652 define a stable ABI to be used with Python 3.2 and later. On Windows, symbols for the stable ABI are exported from the python3.dll shared library. The following functions are present in Python 3.9 but have been removed from Python 3.10b3: PyObject_AsCharBuffer() PyObject_AsReadBuffer() PyObject_AsWriteBuffer() PyObject_CheckReadBuffer() The justification for the removal of these functions was discussed in this issue: https://bugs.python.org/issue41103 Without these functions, an extension cannot utilize the stable ABI to access the buffer memory of data structures. The buffer protocol is suggested as an alternative, but the buffer functions PyObject_GetBuffer() and PyBuffer_Release() are not present in the stable ABI. While these two functions may be added to the stable ABI, removal of the four functions above makes Python 3.10 incompatible with previous versions. It is requested that the four functions be reinstated and maintained as described in PEP 652. ---------- components: Build messages: 397319 nosy: tarun.johar priority: normal severity: normal status: open title: Buffer support in the stable ABI type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:08:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:08:06 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626102486.8.0.761997191911.issue26329@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 443db64f496d3988d20cfda2c3c2ceb6702df36f by Miss Islington (bot) in branch '3.10': bpo-26329: update os.path.normpath documentation (GH-20138) (GH-27094) https://github.com/python/cpython/commit/443db64f496d3988d20cfda2c3c2ceb6702df36f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:09:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:09: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: <1626102545.78.0.900527650542.issue44022@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0389426fa4af4dfc8b1d7f3f291932d928392d8b by Miss Islington (bot) in branch '3.8': bpo-44022: Improve the regression test. (GH-26503) (#26506) https://github.com/python/cpython/commit/0389426fa4af4dfc8b1d7f3f291932d928392d8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:11:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:11:14 +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: <1626102674.89.0.333509655089.issue44472@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6fb4248cd9502f50dd089fdcf548d735dcfd981e by Miss Islington (bot) in branch '3.9': bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) (#26831) https://github.com/python/cpython/commit/6fb4248cd9502f50dd089fdcf548d735dcfd981e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:11:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:11:37 +0000 Subject: [issue43298] Windows build cannot detect missing Windows SDK In-Reply-To: <1614014751.18.0.52094135212.issue43298@roundup.psfhosted.org> Message-ID: <1626102697.32.0.586975840329.issue43298@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e7009f4f9a6a55036ef628a07bedc8dab1aa851e by Miss Islington (bot) in branch '3.9': bpo-43298: Improved error message when building without the Windows SDK installed (GH-26800) (#26803) https://github.com/python/cpython/commit/e7009f4f9a6a55036ef628a07bedc8dab1aa851e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:12:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:12:03 +0000 Subject: [issue43207] InspectLoader.is_package is not an abstract method In-Reply-To: <1613140800.67.0.306485673538.issue43207@roundup.psfhosted.org> Message-ID: <1626102723.46.0.542083728568.issue43207@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 779983ed7f86610be4a7201deeffdcb8608977e0 by Miss Islington (bot) in branch '3.9': bpo-43207: InspectLoader.is_package is not an abstract method (GH-24517) (#26322) https://github.com/python/cpython/commit/779983ed7f86610be4a7201deeffdcb8608977e0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:12:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:12:42 +0000 Subject: [issue38820] Make Python compatible with OpenSSL 3.0.0 In-Reply-To: <1573916819.64.0.690362352385.issue38820@roundup.psfhosted.org> Message-ID: <1626102762.32.0.752310232547.issue38820@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c92b391dcefe9a7b3e6290bc2e2356eedfcf4bc3 by Christian Heimes in branch '3.9': [3.9] bpo-38820: Test with OpenSSL 3.0.0-alpha16 (GH-25942) (#25944) https://github.com/python/cpython/commit/c92b391dcefe9a7b3e6290bc2e2356eedfcf4bc3 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:13:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:13:52 +0000 Subject: [issue43207] InspectLoader.is_package is not an abstract method In-Reply-To: <1613140800.67.0.306485673538.issue43207@roundup.psfhosted.org> Message-ID: <1626102832.42.0.133319062248.issue43207@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:20:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Jul 2021 15:20:05 +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: <1626103205.43.0.593436766775.issue42194@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25645 pull_request: https://github.com/python/cpython/pull/27097 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:20:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:20:02 +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: <1626103202.72.0.612178631135.issue42194@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset da2e673c53974641a0e13941950e7976bbda64d5 by David Sanders in branch 'main': bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026) https://github.com/python/cpython/commit/da2e673c53974641a0e13941950e7976bbda64d5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:20:15 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Jul 2021 15:20:15 +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: <1626103215.84.0.197415934526.issue42194@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25646 pull_request: https://github.com/python/cpython/pull/27098 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:22:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:22:37 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626103357.49.0.00987721525546.issue26329@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 47abf240365ddd54a91c6ac167900d4bf6806c4f by Miss Islington (bot) in branch '3.9': bpo-26329: update os.path.normpath documentation (GH-20138) (#27095) https://github.com/python/cpython/commit/47abf240365ddd54a91c6ac167900d4bf6806c4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:23:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:23:31 +0000 Subject: [issue26329] os.path.normpath("//") returns // In-Reply-To: <1455116285.45.0.915370101527.issue26329@psf.upfronthosting.co.za> Message-ID: <1626103411.55.0.66905539733.issue26329@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:23:50 2021 From: report at bugs.python.org (Bartosz Kaznowski) Date: Mon, 12 Jul 2021 15:23:50 +0000 Subject: [issue44610] Format issue with strftime and %Y Message-ID: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> New submission from Bartosz Kaznowski : When you convert a date pre the year 1000 to a string with `%Y` as the formatter and then back to a date again then it fails. This is because `%Y` expects it to be formatted with leading zeroes. For example, the year 1/01/01 (yyyy/mm/dd) should be 0001/01/01 when formatting using %Y/%m/%d. However, %Y returns 1. You can see this in action here: from datetime import date, datetime format = "%Y-%m-%d" formatted = date.min.strftime("%Y-%m-%d") datetime.strptime(formatted, format).date() `ValueError: time data '1-01-01' does not match format '%Y-%m-%d'` is raised on the forth line. ---------- components: Library (Lib) messages: 397329 nosy: bkaznowski priority: normal severity: normal status: open title: Format issue with strftime and %Y type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:25:50 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 15:25:50 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1626103550.32.0.750941111807.issue43299@roundup.psfhosted.org> Andrei Kulakov added the comment: Actually, I was mistaken about this, `readmodule_ex` can get the __main__ from sys.modules.. I will look more into this later today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:27:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 15:27:40 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626103660.19.0.125655420788.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Are there any downsides to doing it this way? It seems tightly scoped and with minimal overhead. We also need to support quit(), if we go this route. It makes parsing in the REPL a bit slower because it needs to check for this at every command and is a bit "floating" in the middle of the parser and the compiler (but that's a consequence that we don't have any defined layer for this). We also need to check that this also works with piping input. Other than that, only arguments based on the purity of the language, but I think having this working is far more important. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:43:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:43:24 +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: <1626104604.3.0.548238484841.issue42194@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 721d4796be60e6a0a11dee8318794f78928648c1 by Miss Islington (bot) in branch '3.10': bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026) (#27097) https://github.com/python/cpython/commit/721d4796be60e6a0a11dee8318794f78928648c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 11:58:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 15:58:59 +0000 Subject: [issue43048] Printing RecursionError results in RecursionError In-Reply-To: <1611798337.38.0.626995188313.issue43048@roundup.psfhosted.org> Message-ID: <1626105539.88.0.913997346359.issue43048@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 489c27358376e772a61753c3f67daa836ca1eab7 by Vladimir Feinberg in branch '3.9': [3.9] bpo-43048: RecursionError traceback RecursionError bugfix for cpy3.9 (GH-24460) (#24460) https://github.com/python/cpython/commit/489c27358376e772a61753c3f67daa836ca1eab7 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:01:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 16:01:52 +0000 Subject: [issue43048] Printing RecursionError results in RecursionError In-Reply-To: <1611798337.38.0.626995188313.issue43048@roundup.psfhosted.org> Message-ID: <1626105712.55.0.992339297861.issue43048@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:22:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 16:22:15 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626106935.29.0.758554788142.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Since Paul is +1 if another core dev (or devs) are +1 as well with the approach in PR27096 I would feel confident to proceed with this. Alternatively, we could discuss this more generally in python-dev if someone feels that we should have a more open discussion about the tradeoffs. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:23:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 16:23:42 +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: <1626107022.9.0.261977959874.issue42194@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c786988b19d7b6808d4c940f7206b95e49e06b71 by Miss Islington (bot) in branch '3.9': bpo-42194: Add "New in version: 3.9" to argparse.BooleanOptionalAction (GH-23026) (#27098) https://github.com/python/cpython/commit/c786988b19d7b6808d4c940f7206b95e49e06b71 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:24:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 12 Jul 2021 16:24:22 +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: <1626107062.83.0.0571025933552.issue42194@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:30:50 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 12 Jul 2021 16:30:50 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1626107450.64.0.190250786222.issue44571@roundup.psfhosted.org> Tim Peters added the comment: If you don't use the 'after` iterator, then of course you'll never see the values (if any) it would have yielded. How could it possibly be otherwise? By design and construction, the `before` iterator ends before yielding the first (if any) transitional element. As Raymond said at the start, the `takedowhile()` proposal appears much harder to use correctly, since there's no reasonably sane way to know that the last value it yields _is_ the transitional element (or, perhaps, that there was no transitional element, and the underlying iterable was just exhausted without finding one). If the proposal were instead for `takewhile_plus_one_more_if_any()`, then at least the ugly name would warn about the surprising intended behavior ;-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:40:18 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 12 Jul 2021 16:40:18 +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: <1626108018.08.0.168659719292.issue44428@roundup.psfhosted.org> Change by Thomas Grainger : ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:40:43 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 12 Jul 2021 16:40:43 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1626108043.17.0.52674340419.issue44571@roundup.psfhosted.org> Tim Peters added the comment: That said, if you really do want those semantics, it's easy to build on top of Raymond's API: def takewhile_plus_one_more_if_any(pred, iterable): from itertools import islice, chain before, after = before_and_after(pred, iterable) return chain(before, islice(after, 1)) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 12:53:56 2021 From: report at bugs.python.org (pavel-lexyr) Date: Mon, 12 Jul 2021 16:53:56 +0000 Subject: [issue44571] itertools: takedowhile() In-Reply-To: <1625524408.64.0.445781965255.issue44571@roundup.psfhosted.org> Message-ID: <1626108836.68.0.779064992157.issue44571@roundup.psfhosted.org> pavel-lexyr added the comment: Thank you - that answers the questions. The use case where we would want to know if the last element is transitional or not completely slipped my mind for some reason. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 13:16:33 2021 From: report at bugs.python.org (Dan Stromberg) Date: Mon, 12 Jul 2021 17:16:33 +0000 Subject: [issue44611] CPython uses deprecated randomness API Message-ID: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> New submission from Dan Stromberg : CPython 3.9 uses CryptGenRandom(), which has been deprecated by Microsoft. I'm told the randomness produced by CryptGenRandom() is fine, but Microsoft has introduced a newer API for getting randomness. For these reasons, Python/bootstrap_hash.c should be updated to use https://docs.microsoft.com/en-us/windows/win32/seccng/cng-por , but it is not urgent, and is not needed in older versions of CPython. Also the documentation that references CryptGenRandom() should be updated, EG: https://docs.python.org/3/library/os.html#os.urandom ---------- components: Windows messages: 397339 nosy: paul.moore, steve.dower, strombrg, tim.golden, zach.ware priority: normal severity: normal status: open title: CPython uses deprecated randomness API type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 13:35:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 17:35:27 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626111327.5.0.438909315302.issue42958@roundup.psfhosted.org> Andrei Kulakov added the comment: Christof and Alexander, as you both said your preference is to have some way of enforcing "only shallow" compare, I want to clarify -- it seems if you do that, you will get the answer of True if the files are most likely the same (sig is equal), but if the sig is not equal, I'm not sure what answer you expect or why. The sig may be different because of mtime, and then the files may be different or the same, it's anyone's guess. I wonder if both of you expect the same behavior, and if so, for the same use case or not? ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 13:42:12 2021 From: report at bugs.python.org (Muffinlicious) Date: Mon, 12 Jul 2021 17:42:12 +0000 Subject: [issue44607] Teleport method for turtle class In-Reply-To: <1626072536.55.0.653021323155.issue44607@roundup.psfhosted.org> Message-ID: <1626111732.71.0.0164461947381.issue44607@roundup.psfhosted.org> Muffinlicious added the comment: Turtle is the most accessible and well-known drawing module for kids to use so teleporting makes more sense in the context of drawing random shapes or small pictures around the screen. I've seen the penup/goto/pendown combo so often that I figure it at least warrants a suggestion. Also my crappy function was mostly just meant as an outline, haha. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 13:42:22 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 17:42:22 +0000 Subject: [issue43299] pyclbr.readmodule_ex traversing "import __main__": dies with ValueError: __main__.__spec__ is None / is not set In-Reply-To: <1614016105.41.0.669776853412.issue43299@roundup.psfhosted.org> Message-ID: <1626111742.98.0.743997886724.issue43299@roundup.psfhosted.org> Andrei Kulakov added the comment: Upon further pondering, I'm not sure PyWin is doing the right thing here. I believe it's best to first file it with PyWin and find out what it is trying to do and why. Pyclbr behavior sort of makes sense to me -- pyclbr goal is to parse and browse the source of a module, but the __main__ module is either the current script, in which case it can be imported under another name (and then it would have the __spec__), or it's an interactive session, which you probably don't need to browse (maybe?). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 13:45:03 2021 From: report at bugs.python.org (Ethan Furman) Date: Mon, 12 Jul 2021 17:45:03 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1626111903.6.0.283187515663.issue44559@roundup.psfhosted.org> Change by Ethan Furman : ---------- pull_requests: +25647 pull_request: https://github.com/python/cpython/pull/27099 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:10:20 2021 From: report at bugs.python.org (Bartosz Kaznowski) Date: Mon, 12 Jul 2021 18:10:20 +0000 Subject: [issue44610] Format issue with strftime and %Y In-Reply-To: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> Message-ID: <1626113420.57.0.666564521892.issue44610@roundup.psfhosted.org> Change by Bartosz Kaznowski : ---------- versions: +Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:15:53 2021 From: report at bugs.python.org (Bartosz Kaznowski) Date: Mon, 12 Jul 2021 18:15:53 +0000 Subject: [issue44610] Format issue with strftime and %Y In-Reply-To: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> Message-ID: <1626113753.52.0.307229465355.issue44610@roundup.psfhosted.org> Change by Bartosz Kaznowski : ---------- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:34:00 2021 From: report at bugs.python.org (Leonardo Freua) Date: Mon, 12 Jul 2021 18:34:00 +0000 Subject: [issue44612] inspect module points that could be using f-String Message-ID: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> New submission from Leonardo Freua : There are some points in inspect module (I counted 48 since version 3.7) that could be using f-String formatting instead of format(). Changing these points will improve code readability, it will also decrease the complexity at these points and not to mention the fact that f-String formatting has better performance. Obs.: Many other points could receive this improvement in other modules. This would provide the improvements I mentioned earlier, especially in older snippets of code. ---------- components: Library (Lib) messages: 397343 nosy: Leonardofreua priority: normal severity: normal status: open title: inspect module points that could be using f-String type: enhancement versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:38:10 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Jul 2021 18:38:10 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 Message-ID: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> New submission from Barry A. Warsaw : As discussed with Jason, importlib.metadata will be made non-provisional in 3.10. I have a PR in the works for this. ---------- assignee: barry components: Documentation messages: 397344 nosy: barry, jaraco priority: normal severity: normal status: open title: Make importlib.metadata non-provisional in Python 3.10 versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:41:47 2021 From: report at bugs.python.org (Leonardo Freua) Date: Mon, 12 Jul 2021 18:41:47 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626115307.07.0.418964084148.issue44612@roundup.psfhosted.org> Change by Leonardo Freua : ---------- keywords: +patch pull_requests: +25648 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27100 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:43:08 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Jul 2021 18:43:08 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626115388.93.0.435186639545.issue44613@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- keywords: +patch pull_requests: +25649 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27101 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:49:36 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 12 Jul 2021 18:49:36 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626115776.26.0.755959355237.issue44612@roundup.psfhosted.org> Ammar Askar added the comment: As per https://bugs.python.org/issue36249 and https://bugs.python.org/issue38351 We don't generally do large-scale changes that are mostly formatting based. We would prefer that these sort of improvements happen when someone happens to be touching that code anyway unless there is a demonstrable improvement from them. ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:53:02 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 12 Jul 2021 18:53:02 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626115982.11.0.887736229007.issue44600@roundup.psfhosted.org> Ammar Askar added the comment: Brandt, maybe this regression test from a previous tracing bug might be useful for the test writing: https://github.com/python/cpython/pull/22026/files#diff-8b73bfc55514d8add8904c5f4d1d24b7b644ebfccba8d846085303577aa94dd6 ---------- nosy: +ammar2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 14:58:42 2021 From: report at bugs.python.org (Leonardo Freua) Date: Mon, 12 Jul 2021 18:58:42 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626116322.83.0.536646672445.issue44612@roundup.psfhosted.org> Leonardo Freua added the comment: Understood. Anyway, it was good to try to help at this point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:02:35 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 12 Jul 2021 19:02:35 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626116555.51.0.989903522741.issue44612@roundup.psfhosted.org> Ammar Askar added the comment: Thanks for trying to help Leonardo! You might consider looking for easy issues on the bug tracker or reviewing open pull requests to help. Definitely take a look at the dev guide :) https://cpython-devguide.readthedocs.io/fixingissues/ ---------- resolution: -> rejected stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:05:50 2021 From: report at bugs.python.org (Leonardo Freua) Date: Mon, 12 Jul 2021 19:05:50 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626116750.53.0.862545601278.issue44612@roundup.psfhosted.org> Leonardo Freua added the comment: Thanks, Ammar. I'll look. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:22:56 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 12 Jul 2021 19:22:56 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1626117776.14.0.958730800341.issue44605@roundup.psfhosted.org> Dennis Sweeney added the comment: The one twist is that if type(b) is a strict subtype of type(a), then "a < b" first calls type(b).__gt__(b, a), then falls back to type(a).__lt__(a, b). Example: >>> class Int(int): ... def __gt__(self, other): ... print("Here!") ... return int(self) > int(other) ... ... >>> 5 < Int(6) Here! True see https://github.com/python/cpython/blob/da2e673c53974641a0e13941950e7976bbda64d5/Objects/object.c#L683 So I think replacing "a.__lt__(b)" with "a < b" would be an unnecessary change in behavior, since "a < b" still has to decide which method to use. I think instead "a.__lt__(b)" could be replaced with "type(a).__lt__(a, b)" ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:31:52 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 12 Jul 2021 19:31:52 +0000 Subject: [issue44612] inspect module points that could be using f-String In-Reply-To: <1626114840.28.0.434964034307.issue44612@roundup.psfhosted.org> Message-ID: <1626118312.02.0.93272090052.issue44612@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, thank you Leonardo! There are probably places in the stdlib where changing to f-strings would be a performance improvement. Of course finding those places is the challenge! ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:32:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 12 Jul 2021 19:32:48 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626118368.1.0.457752176895.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 1890dd235f618d60c938f6904d2e1a8a56f99c1c by Batuhan Taskaya in branch 'main': bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037) https://github.com/python/cpython/commit/1890dd235f618d60c938f6904d2e1a8a56f99c1c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:47:30 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Jul 2021 19:47:30 +0000 Subject: [issue10716] Modernize pydoc to use better HTML and separate CSS In-Reply-To: <1292491539.55.0.135732310832.issue10716@psf.upfronthosting.co.za> Message-ID: <1626119250.5.0.874817816056.issue10716@roundup.psfhosted.org> ?ric Araujo added the comment: Someone would need to take the patch, apply it to current main branch, fix issues and open a PR. ---------- versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 15:51:09 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 12 Jul 2021 19:51:09 +0000 Subject: [issue10716] Modernize pydoc to use better HTML and separate CSS In-Reply-To: <1292491539.55.0.135732310832.issue10716@psf.upfronthosting.co.za> Message-ID: <1626119469.51.0.00130537814435.issue10716@roundup.psfhosted.org> ?ric Araujo added the comment: On second thought, this issue is not purely programming, but also has a UI component. Better HTML and separated CSS would be good, but before that I think we?d need someone with design chops to mock up a better page layout and style (better than big coloured rectangles!), then I think have a discussion on python-dev (not to discuss all details in committee, but to validate the overall change). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 16:00:39 2021 From: report at bugs.python.org (Mark Dickinson) Date: Mon, 12 Jul 2021 20:00:39 +0000 Subject: [issue44593] _randbelow_with_getrandbits may request an unnecessary random bit In-Reply-To: <1625863592.21.0.811014081503.issue44593@roundup.psfhosted.org> Message-ID: <1626120039.43.0.860771723591.issue44593@roundup.psfhosted.org> Change by Mark Dickinson : ---------- resolution: -> duplicate superseder: -> _randbelow_with_getrandbits function inefficient with powers of two _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 16:12:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 12 Jul 2021 20:12:59 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626120779.85.0.131990258824.issue44606@roundup.psfhosted.org> Guido van Rossum added the comment: Ken Jin, should we treat type(None) as a subclass of int|None? ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 17:04:32 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 21:04:32 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626123872.32.0.635210364483.issue42958@roundup.psfhosted.org> Andrei Kulakov added the comment: Also see this 16 years old issue: https://bugs.python.org/issue1234674 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 17:07:41 2021 From: report at bugs.python.org (Norman Lorrain) Date: Mon, 12 Jul 2021 21:07:41 +0000 Subject: [issue38825] shutil.disk_usage - Lacking documentation In-Reply-To: <1626041929.22.0.834566645359.issue38825@roundup.psfhosted.org> Message-ID: Norman Lorrain added the comment: Something like this: .. impl-detail:: Where applicable (e.g. Unix) *path* must point to somewhere on a **mounted** filesystem partition. On Sun, 11 Jul 2021 at 16:18, Tyler Crompton wrote: > > Tyler Crompton added the comment: > > Not even the kernel knows how much space is available on a nonmounted > partition. It doesn't know much beyond the fact that it exists and where it > exists. There exist tools that can analyze nonmounted partitions, but these > will vary by filesystem and operating system. If someone wants to implement > solutions for the most common filesystem-OS combinations, then that might > be helpful. > > But considering that no one has done that or even asked for it yet, I'm > not sure that doing so is worth the effort. So I agree that documenting it > is the best approach. It should be documented such that the limitations are > mentioned, not necessarily how it's implemented. If explaining which system > calls are used helps explain the limitations, then so be it. Additionally, > as far as I'm concerned, there's no reason to restrict other Python > implementations from implementing functionality for nonmounted disks. So > the limitations should be described as being CPython-specific, akin to what > is done for `readline.set_auto_history`. > > ---------- > nosy: +tylercrompton > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:07:45 2021 From: report at bugs.python.org (Florian Streibelt) Date: Mon, 12 Jul 2021 22:07:45 +0000 Subject: [issue44614] Broken Pipe in Server of Manager in multiprocessing when finalizing, sometimes Message-ID: <1626127665.43.0.394299771131.issue44614@roundup.psfhosted.org> New submission from Florian Streibelt : It seems that the shutdown() method of the Server in in managers.py is already sending the result of its execution directly into the connection, and then the handle_request() method is trying to send ('#RETURN', None) yet again after returning from the call to shutdown() which sometimes yields a Broken Pipe Exception. with the following line in handle_request(): result = func(c, *args, **kwds) a call to shutown() is made, and in shutdown() I see: c.send(('#RETURN', None)) and back in handle_request(): msg = ('#RETURN', result) ? c.send(msg) attached you find a minimal example that shows this behaviour sometimes, if logging is set to not more than DEBUG. I am guessing that the Broken Pipe depends on a race with the other side being closed. Although the race condition does not look like having an impact, it is highly confusing when debugging. log: INFO MainProcess util.py:54 sending shutdown message to manager DEBUG BaseManager-12 util.py:50 manager received shutdown message INFO BaseManager-12 util.py:54 Failure to send message: ('#RETURN', None) INFO BaseManager-12 util.py:54 process shutting down INFO BaseManager-12 util.py:54 ... request was (None, 'shutdown', (), {}) DEBUG BaseManager-12 util.py:50 running all "atexit" finalizers with priority >= 0 INFO BaseManager-12 util.py:54 ... exception was BrokenPipeError(32, 'Broken pipe') DEBUG BaseManager-12 util.py:50 running the remaining "atexit" finalizers INFO BaseManager-12 util.py:54 process exiting with exitcode 0 ---------- components: Library (Lib) files: race2.py messages: 397358 nosy: mutax priority: normal severity: normal status: open title: Broken Pipe in Server of Manager in multiprocessing when finalizing, sometimes type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50145/race2.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:08:40 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Mon, 12 Jul 2021 22:08:40 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626127720.77.0.459528024613.issue44613@roundup.psfhosted.org> Jason R. Coombs added the comment: Thanks Barry for filing this. I was planning to do it but happy for you to beat me to it. I had one question I'd been meaning to ask - with this change, can the code paths that were deprecated in 3.10 be removed in 3.11 (SelectableGroups and cast to dict of sequence of EntryPoint objects)? I was planning a slightly accelerated removal of the compatibility support because: (a) The backport presented the deprecation for older Pythons already and so users will likely have migrated off the deprecated behaviors prior to the release of 3.10. (b) It will be substantially harder to maintain the backport while the backport drops that support. (c) In extreme cases, the backport is available to provide backward compatibility even for Python 3.11. Let me know if you would rather I pose this question elsewhere or elaborate on the proposition. It doesn't affect the PR or move out of provisional. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:18:36 2021 From: report at bugs.python.org (Florian Streibelt) Date: Mon, 12 Jul 2021 22:18:36 +0000 Subject: [issue44615] Multiprocessing Pool example and comments incomplete/wrong? Message-ID: <1626128316.93.0.838560232198.issue44615@roundup.psfhosted.org> New submission from Florian Streibelt : The docs at the url https://docs.python.org/3/library/multiprocessing.html#module-multiprocessing.pool state in a red warning box: "Warning multiprocessing.pool objects have internal resources that need to be properly managed (like any other resource) by using the pool as a context manager or by calling close() and terminate() manually. Failure to do this can lead to the process hanging on finalization." however, when using the context manager, as it is also shown in the examples, the context manager will call terminate() instead of close() and join() on the pool, possible leading to deadlocks if I understand the documentation correct. It seems the only safe way of using a Pool as Context Manager is to manually call pool.close() and pool.join() prior to leaving it, which, to be honest, does not make sense to me. see pool.py: def __exit__(self, exc_type, exc_val, exc_tb): self.terminate() ---------- assignee: docs at python components: Documentation messages: 397360 nosy: docs at python, mutax priority: normal severity: normal status: open title: Multiprocessing Pool example and comments incomplete/wrong? versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:18:52 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 12 Jul 2021 22:18:52 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626128332.91.0.48459286351.issue44611@roundup.psfhosted.org> Tim Peters added the comment: Dan, the Microsoft URL in your message gives a 404 for me. Did you perhaps mean to end it with "cng-portal" (instead of "cng-por")? ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:24:18 2021 From: report at bugs.python.org (Thomas Grainger) Date: Mon, 12 Jul 2021 22:24:18 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626128658.03.0.24388571927.issue44611@roundup.psfhosted.org> Thomas Grainger added the comment: https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal ? ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:30:15 2021 From: report at bugs.python.org (Christof Hanke) Date: Mon, 12 Jul 2021 22:30:15 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626129015.57.0.365620942092.issue42958@roundup.psfhosted.org> Christof Hanke added the comment: Hi Andrei, I would follow rsync. >From the man page: """ [...] -c, --checksum This changes the way rsync checks if the files have been changed and are in need of a transfer. Without this option, rsync uses a "quick check" that (by default) checks if each file?s size and time of last modification match between the sender and receiver. [...] """ so, yes you can have false positives with a shallow comparison of size + mtime only. But that's usually ok for e.g. incremental backups. Wow, the bug is that old... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:49:21 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 12 Jul 2021 22:49:21 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626130161.48.0.853580744046.issue42958@roundup.psfhosted.org> Andrei Kulakov added the comment: But rsync is a quite more specific tool. For example, unix cmp command does not guess based on any part of `stat` sig. That's a much closer command in scope to 'filecmp'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 18:51:39 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 12 Jul 2021 22:51:39 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable Message-ID: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> New submission from Ned Batchelder : This construct isn't traced properly: except ExceptionName as var: if something: raise Here's a reproducer: -- 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 f(x): try: 1/0 except ZeroDivisionError as error: if x: raise return 12 print(sys.version) sys.settrace(trace) for x in [0, 1]: try: print(f(x)) except: print("oops") ----------------------------------- When run with 3.10.0b4, it produces this output: 3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def f(x): line 11: try: line 12: 1/0 exce 12: 1/0 line 13: except ZeroDivisionError as error: line 14: if x: * line 15: raise line 16: return 12 retu 16: return 12 12 call 10: def f(x): line 11: try: line 12: 1/0 exce 12: 1/0 line 13: except ZeroDivisionError as error: line 14: if x: line 15: raise retu 15: raise oops The starred line claims that raise is being run, but it is not run at that point. The variable on the except clause is important. If you change that line to "except ZeroDivisionError:", then the output is correct: 3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def f(x): line 11: try: line 12: 1/0 exce 12: 1/0 line 13: except ZeroDivisionError: line 14: if x: line 16: return 12 retu 16: return 12 12 call 10: def f(x): line 11: try: line 12: 1/0 exce 12: 1/0 line 13: except ZeroDivisionError: line 14: if x: line 15: raise retu 15: raise oops ---------- components: Interpreter Core keywords: 3.10regression messages: 397365 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Incorrect tracing for "except" with variable type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 19:07:37 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 12 Jul 2021 23:07:37 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626131257.41.0.419275444923.issue44616@roundup.psfhosted.org> Ned Batchelder added the comment: Based on https://github.com/nedbat/coveragepy/issues/1187, btw ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 19:38:14 2021 From: report at bugs.python.org (Thomas) Date: Mon, 12 Jul 2021 23:38:14 +0000 Subject: [issue34451] docs: tutorial/introduction doesn't mention toggle of prompts In-Reply-To: <1534877418.64.0.56676864532.issue34451@psf.upfronthosting.co.za> Message-ID: <1626133094.04.0.00916884135674.issue34451@roundup.psfhosted.org> Change by Thomas : ---------- keywords: +patch nosy: +thmsdnnr nosy_count: 6.0 -> 7.0 pull_requests: +25650 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27105 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 19:54:46 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Jul 2021 23:54:46 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626134086.5.0.389834792558.issue44616@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- nosy: +barry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 19:56:50 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 12 Jul 2021 23:56:50 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626134210.57.0.648266167022.issue44613@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25651 pull_request: https://github.com/python/cpython/pull/27106 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 19:56:46 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Mon, 12 Jul 2021 23:56:46 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626134206.43.0.186016426941.issue44613@roundup.psfhosted.org> Barry A. Warsaw added the comment: New changeset f6954cdfc50060a54318fb2aea4d80408381243a by Barry Warsaw in branch 'main': bpo-44613: Make importlib.metadata non-provisional (#27101) https://github.com/python/cpython/commit/f6954cdfc50060a54318fb2aea4d80408381243a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:29:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 00:29:47 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626136187.55.0.841064435741.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d by Ammar Askar in branch 'main': bpo-43950: Add documentation for PEP-657 (GH-27047) https://github.com/python/cpython/commit/9c3eaf88dc5d5bed80cc45936de06b7b3162bc6d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:40:59 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Jul 2021 00:40:59 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626136859.3.0.204454142661.issue44613@roundup.psfhosted.org> Barry A. Warsaw added the comment: New changeset 7223ce3b3f50ec8a825e317437ea0359b6ad6856 by Miss Islington (bot) in branch '3.10': bpo-44613: Make importlib.metadata non-provisional (GH-27101) (#27106) https://github.com/python/cpython/commit/7223ce3b3f50ec8a825e317437ea0359b6ad6856 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:41:12 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Jul 2021 00:41:12 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626136872.54.0.536919814623.issue44613@roundup.psfhosted.org> Change by Barry A. Warsaw : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:42:56 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Jul 2021 00:42:56 +0000 Subject: [issue44613] Make importlib.metadata non-provisional in Python 3.10 In-Reply-To: <1626115090.32.0.857844530408.issue44613@roundup.psfhosted.org> Message-ID: <1626136976.62.0.266139372469.issue44613@roundup.psfhosted.org> Barry A. Warsaw added the comment: Jason, I think the question you raise re: accelerated deprecation, is probably a RM or SC question. I'll nosy in Pablo and see if he has a strong opinion. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:45:24 2021 From: report at bugs.python.org (Dan Stromberg) Date: Tue, 13 Jul 2021 00:45:24 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626128658.03.0.24388571927.issue44611@roundup.psfhosted.org> Message-ID: Dan Stromberg added the comment: Yes, cng-portal. On Mon, Jul 12, 2021 at 3:24 PM Thomas Grainger wrote: > > Thomas Grainger added the comment: > > https://docs.microsoft.com/en-us/windows/win32/seccng/cng-portal ? > > ---------- > nosy: +graingert > > _______________________________________ > Python tracker > > _______________________________________ > -- Dan Stromberg | Senior Software Engineer Mobile +1.949.342.6502 ** This email is confidential and is intended for the recipient(s) addressed herein ** ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:47:24 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Jul 2021 00:47:24 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626099598.31.0.597661910923.issue44603@roundup.psfhosted.org> Message-ID: <20210713004529.GD13804@ando.pearwood.info> Steven D'Aprano added the comment: Please don't do this. On Mon, Jul 12, 2021 at 02:19:58PM +0000, Pablo Galindo Salgado wrote: > >>> exit > bye! This is a user-hostile and unfriendly UI for Python. The Python REPL is not a shell like bash etc, it should be safe to evaluate any builtin object at the interactive interpreter to view its repr without side-effects. Especially not major side-effects such as exiting the interpreter with its total loss of program state. The only motivation of this change is pure laziness to avoid typing parentheses when you want to call an object. I know that the creator of Perl famously says that laziness and hubris are virtues for programmers, but I disagree. Pandering to laziness in language design is not a virtue. This does not add any new and improved functionality, or make the language better, or more friendly for beginners exploring things at the REPL. It is a useability regression, making it more hostile and unfriendly for people expecting to be able to view objects by entering them at the REPL without catastrophic side-effects, and the only benefit is to save two characters. Having said that Pablo, I don't dislike your hack to make the exit repr pretend to be a confirmation message anywhere near as much. I don't think it is necessary, I think it looks even stranger when displaying the builtin namespace dict, but at least it is not a useability regression. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 20:53:58 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Jul 2021 00:53:58 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626103660.19.0.125655420788.issue44603@roundup.psfhosted.org> Message-ID: <20210713005205.GE13804@ando.pearwood.info> Steven D'Aprano added the comment: > Other than that, only arguments based on the purity of the language, > but I think having this working is far more important. Having this "working" is not important at all. This is precisely the sort of user-hostile anti-feature that we should avoid, not compromise the execution model just to save typing two characters. I mean, seriously, we're talking about typing *two characters*. If people care so much about minimizing the amount of typing when they exit the REPL, they can use Ctrl-D or just close the terminal window. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:03:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 01:03:52 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626138232.71.0.278953744661.issue44603@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Thanks Steven for your input and your comments and for expressing your concerns. I will hold the PR then until there is consensus on how to proceed and all concerns are addressed (eventually closing it if there isn't consensus). I'm any case, I think we should at least proceed with the uncontroversial part of the proposal: > (1) Include "exit" in the interpreter startup message, making it: Type "help()", "copyright", "credits" or "license" for more information, or type "exit()" to quit Python. This is, including exit in the message and using the form exit() and help() instead of exit and help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:08:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 01:08:08 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626138488.97.0.457550467529.issue44616@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Marking as release blocker for the first release candidate. Ned, I assume this comes from some recent bug report in coverage, but it would be great if you could ask your users to test the latest beta and report any issue before we release the first candidate. That way we can be more sure that we won't find any future surprise Thanks in advance ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:09:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 01:09:54 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626138594.88.0.723551064011.issue44616@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I assume this is due to some artificial bytecode for cleaning the variable in the exception ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:22:38 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Tue, 13 Jul 2021 01:22:38 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626139358.93.0.60068765666.issue44603@roundup.psfhosted.org> Stargirl Flowers added the comment: @steven.daprano I appreciate your perspective but you laid out a lot of strong opinions as if they're incontrovertible truths. The motivation here isn't laziness- I created this bug because I saw actual people across various skill levels that are bugged by this behavior. I don't think that I can accept your declaration that changing this behavior would be user hostile in the face of multiple pieces of user feedback that says the existing behavior is hostile and changing it would be an improvement. It's not about saving two characters. It's about doing what the user actual means and expects- based on feedback it seems that almost everyone expects "exit" to exit. Your point about being able to inspect objects falls a bit flat when the current behavior is: >>> exit Use exit() or Ctrl-D (i.e. EOF) to exit If I weren't an experienced Python developer, I would have no idea that "exit" is actually an object and its __repr__ is what's showing there. To those who haven't ascended to language experts, this just seems like the program chiding us - like responding to "can I have some water" with "*may* you have some water". I didn't type "exit" to view the exit object, I typed it to leave the interpreter. If I *do* want to inspect it, well, there's dir() and help(), which are far, far more useful than the __repr__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:37:42 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Tue, 13 Jul 2021 01:37:42 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626140262.12.0.993951507087.issue44616@roundup.psfhosted.org> Barry A. Warsaw added the comment: Pablo, this is triggered by my bug report here: https://github.com/nedbat/coveragepy/issues/1187 I tested this again today with the 3.10 git head and still got the coverage misses. Happy to try any other combinations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 21:58:30 2021 From: report at bugs.python.org (Taylor Alexander) Date: Tue, 13 Jul 2021 01:58:30 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626141510.8.0.243374835753.issue44603@roundup.psfhosted.org> Taylor Alexander added the comment: Am I correct in thinking that the proposed change only affects the use case where a user types exit in to the REPL and hits return? And that any other case is unaffected? I can only imagine that the majority of users who type exit in to the interpreter are expecting the REPL to exit. Stargirl do I recall you mentioning (perhaps on twitter) that there are threads online of users expressing frustration with this feature? It would be helpful to see what users have said about it. I would push back against the idea that this is about laziness. It sounds like this is about reducing user confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 22:14:19 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 13 Jul 2021 02:14:19 +0000 Subject: [issue44602] Issue with get_build_version in msvc9compiler.py in distutils In-Reply-To: <1626045902.73.0.895322421093.issue44602@roundup.psfhosted.org> Message-ID: <1626142459.92.0.24917620387.issue44602@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Distutils, Windows nosy: +dstufft, eric.araujo, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 22:15:58 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 13 Jul 2021 02:15:58 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626142558.13.0.108250553091.issue44608@roundup.psfhosted.org> Change by Ned Deily : ---------- components: +Tkinter _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 12 23:34:48 2021 From: report at bugs.python.org (Pablo Aguilar) Date: Tue, 13 Jul 2021 03:34:48 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object Message-ID: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> New submission from Pablo Aguilar : Hey, I'm not sure if this is really a bug but I'd like to show to prevent some undesired behavior! I'm working in the `match` support for returns (https://github.com/dry-python/returns) library when I saw a behavior similar to the described in `Constant Value Patterns` section on PEP-622 (https://www.python.org/dev/peps/pep-0622/#constant-value-patterns). A very small and reproducible example: ```python from typing import Any, ClassVar, Optional class Maybe: empty: ClassVar['Maybe'] _instance: Optional['Maybe'] = None def __new__(cls, *args: Any, **kwargs: Any) -> 'Maybe': if cls._instance is None: cls._instance = object.__new__(cls) return cls._instance Maybe.empty = Maybe() if __name__ == '__main__': my_maybe = Maybe() match my_maybe: case Maybe.empty: print('FIRST CASE') case _: print('DEFAULT CASE') ``` The output here is `FIRST CASE`, but if I delete `__new__` method the output is `DEFAULT CASE`. Is that the correct behavior? Python version: 3.10.0a7 ---------- components: Interpreter Core messages: 397380 nosy: thepabloaguilar priority: normal severity: normal status: open title: Undesired Behavior on `match` using Singleton object type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 01:44:46 2021 From: report at bugs.python.org (Christof Hanke) Date: Tue, 13 Jul 2021 05:44:46 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626155086.85.0.280136250294.issue42958@roundup.psfhosted.org> Christof Hanke added the comment: Andrei, cmp is the deep-compare part of filecmp. I thought we were taking about the shallow one. Thus, - shallow like rsync "quick": size + mtime. - deep like cmp ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 01:52:34 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Tue, 13 Jul 2021 05:52:34 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626155554.69.0.2389888627.issue44603@roundup.psfhosted.org> Vedran ?a?i? added the comment: > based on feedback it seems that almost everyone expects "exit" to exit I don't, and I don't remember being asked. Let me be clear: if exit were a Python keyword, then maybe I would expect that. Or at least, I could convince myself to expect that. But exit is _not_ a keyword, it is not even a builtin, and there is a _strong_ reason for that. One of Guido's many valuable insights about language design is that you shouldn't preclude other uses of names you find convenient for your builtins. See the last line of Zen of Python. And yes, I _have_ used exit as a name for my objects (e.g. as a flag in Pygame, set exit = False at the beginning and exit = True somewhere in the loop when I find out that the game is over). Although I don't recall ever actually typing `exit` into Python REPL to inspect its value, I really think that scenario is plausible (for example, if a game exited prematurely, and I wanted to see whether exit was set to True prematurely, or there was some other reason), and it would _annoy me immensely_ if instead of showing me the status of the flag it would drop me out of Python. In fact, you're proposing to use exit as a keyword, but lying about it to the users. If it were really so important, then it _should_ be a keyword, and at least I'd know that I can't use it for my variables anymore. (It's not the first time such a thing would happen. The same thing happened with `async` a few years ago.) But please don't introduce those "keywords just in a particular context", they are horrible from the perspective of usability. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:01:12 2021 From: report at bugs.python.org (Stargirl Flowers) Date: Tue, 13 Jul 2021 06:01:12 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626156072.72.0.0704010695052.issue44603@roundup.psfhosted.org> Change by Stargirl Flowers : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:03:15 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 06:03:15 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626156195.4.0.412541773238.issue44608@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +25652 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27107 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:06:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 06:06:31 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626156391.52.0.89638554317.issue44608@roundup.psfhosted.org> Serhiy Storchaka added the comment: Thank you for your report stardust222. Indeed, there is a leak if an argument is a sequence or set, but not list or tuple. PR 27107 fixes it. ---------- components: +Extension Modules -C API, Tkinter versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:16:48 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 13 Jul 2021 06:16:48 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1626157008.62.0.56821873159.issue44617@roundup.psfhosted.org> Dennis Sweeney added the comment: This code... match my_maybe: case Maybe.empty: print('FIRST CASE') case _: print('DEFAULT CASE') ... is roughly equivalent to this code: if my_maybe == Maybe.empty: print('FIRST CASE') case _: print('DEFAULT CASE') I don't think this is a bug in the match/case compiler, I think it's simply a matter of how Maybe() == Maybe() evaluates. Since your __new__ code always returns the same object, Maybe() == Maybe() will return True. But by default, each Maybe() call constructs a new instance that won't be equal to any others. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:19:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 06:19:02 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626157142.45.0.825777259614.issue44606@roundup.psfhosted.org> Serhiy Storchaka added the comment: I have found this when refactored the code of Objects/unionobject.c. So I have a patch which fixes this, but I want to make sure what behavior is considered correct. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 02:35:52 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 13 Jul 2021 06:35:52 +0000 Subject: [issue44597] Poll returns POLLOUT on Pipe read endpoint on MacOS 10.14 In-Reply-To: <1625914947.01.0.465830160545.issue44597@roundup.psfhosted.org> Message-ID: <1626158152.19.0.591112271377.issue44597@roundup.psfhosted.org> Ronald Oussoren added the comment: Without having looked at this issue in detail... This looks like an issue with macOS and not Python. In general API's providing access to system calls are just thin wrappers around those system calls. If this is a bug in macOS there's nothing we can do about this, other than perhaps working around the bug in stdlib usages of select.poll. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 03:41:18 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Tue, 13 Jul 2021 07:41:18 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes Message-ID: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> New submission from Mauricio Villegas : Classes in the datetime module are implemented using __new__ with some named parameters. I want to be able to inspect their signature to know which are the names of the parameters it accepts like it works for most classes. However, this does not work for classes in the datetime module. I already mentioned this in https://bugs.python.org/issue40897 but now I am thinking this should be a separate issue so I am creating this one. An example is the class timedelta. It has as parameters days, seconds, microseconds, milliseconds, minutes, hours and weeks. If I run the following script trying different python versions for py in 36 37 38 39; do source py${py}/bin/activate echo "=== $(python3 --version) ===" python3 -c " from datetime import timedelta import inspect print(inspect.signature(timedelta.__new__)) print(inspect.signature(timedelta.__init__)) inspect.signature(timedelta) " deactivate done What I get is === Python 3.6.9 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type === Python 3.7.11 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type === Python 3.8.11 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type === Python 3.9.6 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type ---------- messages: 397387 nosy: mauvilsa priority: normal severity: normal status: open title: inspect.signature does not work for datetime classes versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 03:54:15 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Tue, 13 Jul 2021 07:54:15 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626162855.17.0.95031374746.issue44618@roundup.psfhosted.org> Change by Mauricio Villegas : ---------- components: +Library (Lib) type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 04:43:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 08:43:58 +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: <1626165838.62.0.33143856573.issue44472@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 4a0f1df9527f7d67064d33f5366476b3c93dc86c by Miss Islington (bot) in branch '3.10': bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822) (GH-26830) https://github.com/python/cpython/commit/4a0f1df9527f7d67064d33f5366476b3c93dc86c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 05:29:29 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Jul 2021 09:29:29 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626168569.61.0.659845899756.issue44606@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy > 2. Different handling of virtual subclasses: This looks like a bug. I think the union form of isinstance/issubclass should have the same behavior as the tuple form. We promise checking of virtual classes in the docs for union types: https://docs.python.org/3.10/library/functions.html#issubclass The fix seems to be changing one line of code in Objects/unionobject.c from PyType_IsSubtype to PyObject_IsSubclass. Since it isn't a large change and it's a bug, I think we can backport it to 3.10 too. @Serhiy and Guido, > 1. Different handling of None: > Ken Jin, should we treat type(None) as a subclass of int|None? I think we can avoid this special case altogether by converting all None to type(None) when creating _Py_Union. This is what the typing.Union counterpart does, and it is also what PEP 484 says about None https://www.python.org/dev/peps/pep-0484/#using-none: >>> Union[None, str].__args__ (, ) Though I know some people are opinionated about None -> type(None). This would require adding one more check at https://github.com/python/cpython/blob/3.10/Objects/unionobject.c#L266 . Maybe this? if(Py_IsNone(i_element)) i_element = &_PyNone_Type ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 06:48:49 2021 From: report at bugs.python.org (Prakash) Date: Tue, 13 Jul 2021 10:48:49 +0000 Subject: [issue44619] Bug in Python 3.7.10 Message-ID: <1626173329.18.0.223502644696.issue44619@roundup.psfhosted.org> New submission from Prakash : Hello - I wish to bring to your kind notice a bug in Python. Given any matrix X. While trying to compute the CoVariance matrix of that matrix X, Python does NOT compute the CoVarianceof the given matrix X. Instead, Python comptes the CoVariance of the Transpose of the given matrix X. This appears to be a bug in Python. Please refer to the below website for a given matrix and what the result should be after the computation of it's CoVariance. And I have provided a screenshot of what Python is returning. https://www.itl.nist.gov/div898/handbook/pmc/section5/pmc541.htm Please let me know if you have any questions. Regards, Prakash ---------- files: Bug in Python.pdf messages: 397390 nosy: prakashvm priority: normal severity: normal status: open title: Bug in Python 3.7.10 type: behavior versions: Python 3.7 Added file: https://bugs.python.org/file50146/Bug in Python.pdf _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 06:52:10 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 13 Jul 2021 10:52:10 +0000 Subject: [issue44619] Bug in Python 3.7.10 In-Reply-To: <1626173329.18.0.223502644696.issue44619@roundup.psfhosted.org> Message-ID: <1626173530.33.0.759327662801.issue44619@roundup.psfhosted.org> Steven D'Aprano added the comment: numpy is a third-party library, you will have to report it to them, we can't do anything about it. ---------- nosy: +steven.daprano resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 07:15:00 2021 From: report at bugs.python.org (=?utf-8?b?TMOhc3psw7MgR8O2csO2Zw==?=) Date: Tue, 13 Jul 2021 11:15:00 +0000 Subject: [issue44620] UUIDv1 is not RFC 4122 compliant Message-ID: <1626174900.35.0.48984459296.issue44620@roundup.psfhosted.org> New submission from L?szl? G?r?g : Section 4.1.5 of RFC 4122 says the following about Clock Sequence: If the clock is set backwards, or might have been set backwards (e.g., while the system was powered off), and the UUID generator can not be sure that no UUIDs were generated with timestamps larger than the value to which the clock was set, then the clock sequence has to be changed. If the previous value of the clock sequence is known, it can just be incremented; otherwise it should be set to a random or high-quality pseudo-random value. However, the current implementation increments the timestamp and not the clock sequence. Ref: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/uuid.py#L689-L690 ---------- components: Library (Lib) messages: 397392 nosy: contact2 priority: normal severity: normal status: open title: UUIDv1 is not RFC 4122 compliant 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 Jul 13 07:29:23 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 13 Jul 2021 11:29:23 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly Message-ID: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> New submission from Ned Batchelder : Python 3.9 traces this code incorrectly. Note: 3.8 and 3.10 are correct, only 3.9 gets it wrong. ----------------------------------- 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 import asyncio async def async_gen(): yield 13 async def async_test(): global a a = 17 async for i in async_gen(): print(i + 19) else: a = 21 print(sys.version) sys.settrace(trace) asyncio.run(async_test()) assert a == 21 ---------------------------------- The starred line shows a trace of a statement that is not executed: 3.9.6 (default, Jul 13 2021, 07:21:14) [Clang 12.0.0 (clang-1200.0.32.29)] call 15: async def async_test(): line 17: a = 17 line 18: async for i in async_gen(): call 12: async def async_gen(): line 13: yield 13 retu 13: yield 13 exce 18: async for i in async_gen(): line 19: print(i + 19) 32 line 18: async for i in async_gen(): call 13: yield 13 retu 13: yield 13 exce 18: async for i in async_gen(): * line 19: print(i + 19) line 21: a = 21 retu 21: a = 21 ---------- components: Interpreter Core keywords: 3.9regression messages: 397393 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Python 3.9 traces async for/else incorrectly type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 07:30:33 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 13 Jul 2021 11:30:33 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626175833.29.0.619873535606.issue44621@roundup.psfhosted.org> Ned Batchelder added the comment: The corresponding coverage.py issue: https://github.com/nedbat/coveragepy/issues/1158 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 08:27:45 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 13 Jul 2021 12:27:45 +0000 Subject: [issue44602] Issue with get_build_version in msvc9compiler.py in distutils In-Reply-To: <1626045902.73.0.895322421093.issue44602@roundup.psfhosted.org> Message-ID: <1626179265.96.0.031829728032.issue44602@roundup.psfhosted.org> Steve Dower added the comment: msvc9compiler.py has been deprecated ever since _msvccompiler.py was introduced, so no code should be using it (it was always internal anyway). And now all of distutils is also deprecated, so you probably need to report this to the setuptools project at https://github.com/pypa/setuptools so they can fix it in their embedded copy of distutils. ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:03:51 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 13 Jul 2021 13:03:51 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 Message-ID: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> New submission from Ned Batchelder : In Python 3.10, the traces at the end of an async-for loop are incorrect and different than at the end of a for-loop. ------------------------------ 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 import asyncio class AsyncIter: def __init__(self, items): self.items = items async def __aiter__(self): for i in self.items: yield i async def test1(): async for i in AsyncIter([1]): print(f"test1 {i}") def test2(): for i in [1]: print(f"test2 {i}") print(sys.version) sys.settrace(trace) asyncio.run(test1()) test2() ------------------------------------ In 3.7, 3.8 and 3.9, the two for loops behave the same: the loop jumps back to the "for" statement, and then returns (the arrowed lines): 3.9.5 (default, May 5 2021, 06:50:43) [Clang 12.0.0 (clang-1200.0.32.29)] call 18: async def test1(): line 19: async for i in AsyncIter([1]): call 13: def __init__(self, items): self.items = items line 13: def __init__(self, items): self.items = items retu 13: def __init__(self, items): self.items = items call 15: async def __aiter__(self): line 16: for i in self.items: yield i retu 16: for i in self.items: yield i exce 19: async for i in AsyncIter([1]): line 20: print(f"test1 {i}") test1 1 line 19: async for i in AsyncIter([1]): call 16: for i in self.items: yield i line 16: for i in self.items: yield i retu 16: for i in self.items: yield i exce 19: async for i in AsyncIter([1]): > retu 19: async for i in AsyncIter([1]): call 22: def test2(): line 23: for i in [1]: line 24: print(f"test2 {i}") test2 1 line 23: for i in [1]: > retu 23: for i in [1]: In 3.10, the for loop behaves the same, but now the async-for traces the body once more when it doesn't execute, and returns from the body of the loop (the starred line): 3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)] call 18: async def test1(): line 19: async for i in AsyncIter([1]): call 13: def __init__(self, items): self.items = items line 13: def __init__(self, items): self.items = items retu 13: def __init__(self, items): self.items = items call 15: async def __aiter__(self): line 16: for i in self.items: yield i retu 16: for i in self.items: yield i exce 19: async for i in AsyncIter([1]): line 20: print(f"test1 {i}") test1 1 line 19: async for i in AsyncIter([1]): call 16: for i in self.items: yield i line 16: for i in self.items: yield i retu 16: for i in self.items: yield i exce 19: async for i in AsyncIter([1]): * line 20: print(f"test1 {i}") retu 20: print(f"test1 {i}") call 22: def test2(): line 23: for i in [1]: line 24: print(f"test2 {i}") test2 1 line 23: for i in [1]: > retu 23: for i in [1]: ---------- components: Interpreter Core keywords: 3.10regression messages: 397396 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: async-for loops are traced incorrectly in Python 3.10 type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:11:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 13:11:21 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1626181881.0.0.260637218832.issue43948@roundup.psfhosted.org> ?ukasz Langa added the comment: The current behavior has been there since 2012 at least. Kind of suspicious we haven't tripped over it before. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:19:48 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:19:48 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626182388.84.0.0682337504042.issue44616@roundup.psfhosted.org> Mark Shannon added the comment: Thanks Ned, you're doing a fantastic job of finding these issues. Sorry for keeping you so busy with this. This one was a latent bug, exposed by fixing https://bugs.python.org/issue44570. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:23:06 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:23:06 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1626182586.18.0.632525330311.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25653 pull_request: https://github.com/python/cpython/pull/27109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:24:03 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:24:03 +0000 Subject: [issue44614] Broken Pipe in Server of Manager in multiprocessing when finalizing, sometimes In-Reply-To: <1626127665.43.0.394299771131.issue44614@roundup.psfhosted.org> Message-ID: <1626182643.21.0.323302046747.issue44614@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch nosy: +Mark.Shannon nosy_count: 1.0 -> 2.0 pull_requests: +25654 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:24:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:24:49 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626182689.9.0.106546389017.issue44616@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25655 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27109 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:25:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:25:37 +0000 Subject: [issue44614] Broken Pipe in Server of Manager in multiprocessing when finalizing, sometimes In-Reply-To: <1626127665.43.0.394299771131.issue44614@roundup.psfhosted.org> Message-ID: <1626182737.95.0.388203424397.issue44614@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: -25654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:25:58 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 13 Jul 2021 13:25:58 +0000 Subject: [issue44570] 3.10.0b3 doesn't trace line events for return in some cases In-Reply-To: <1625524178.46.0.642583594704.issue44570@roundup.psfhosted.org> Message-ID: <1626182758.63.0.273915997041.issue44570@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: -25653 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:41:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 13 Jul 2021 13:41:45 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1626183705.57.0.434965109973.issue35113@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- nosy: +andrei.avk nosy_count: 6.0 -> 7.0 pull_requests: +25656 pull_request: https://github.com/python/cpython/pull/27073 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:43:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 13:43:05 +0000 Subject: [issue35113] inspect.getsource returns incorrect source for classes when class definition is part of multiline strings In-Reply-To: <1540902777.26.0.788709270274.issue35113@psf.upfronthosting.co.za> Message-ID: <1626183785.88.0.202051275747.issue35113@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d4a5f0b659a2b8f206cfbdfd37fc36aedf77a71f by andrei kulakov in branch 'main': bpo-35113: clean up duplicate import and comment (#27073) https://github.com/python/cpython/commit/d4a5f0b659a2b8f206cfbdfd37fc36aedf77a71f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:54:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 13:54:17 +0000 Subject: [issue38741] Definition of multiple ']' in header configparser In-Reply-To: <1573193272.74.0.118296138456.issue38741@roundup.psfhosted.org> Message-ID: <1626184457.38.0.87386872981.issue38741@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2924bb1a566977efd45f335d6a94cd84d8047edf by jsnklln in branch 'main': bpo-38741: Definition of multiple ']' in header configparser (GH-17129) https://github.com/python/cpython/commit/2924bb1a566977efd45f335d6a94cd84d8047edf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:54:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 13:54:36 +0000 Subject: [issue38741] Definition of multiple ']' in header configparser In-Reply-To: <1573193272.74.0.118296138456.issue38741@roundup.psfhosted.org> Message-ID: <1626184476.73.0.266254507522.issue38741@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25657 pull_request: https://github.com/python/cpython/pull/27110 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:57:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 13:57:12 +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: <1626184632.8.0.7113235014.issue44514@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 48a5aa7f128caf5a46e4326c1fd285cd5fc8e59d by Kevin Follstad in branch 'main': bpo-44514: Add doctest testcleanup for configparser and bz2 (#26909) https://github.com/python/cpython/commit/48a5aa7f128caf5a46e4326c1fd285cd5fc8e59d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:58:02 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 13:58:02 +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: <1626184682.16.0.241559100481.issue44514@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25659 pull_request: https://github.com/python/cpython/pull/27112 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 09:57:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 13:57:56 +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: <1626184676.74.0.486872183169.issue44514@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25658 pull_request: https://github.com/python/cpython/pull/27111 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:08:06 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 14:08:06 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626185286.62.0.307952208295.issue43126@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25660 pull_request: https://github.com/python/cpython/pull/27113 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:08:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 14:08:11 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626185291.83.0.404981949949.issue43126@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25661 pull_request: https://github.com/python/cpython/pull/27114 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:08:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:08:07 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626185287.5.0.89001077923.issue43126@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3b5b99da4b256a31933112f4a2385386149c19e1 by andrei kulakov in branch 'main': bpo-43126: Expand docs on io.IOBase.readlines() method (#27061) https://github.com/python/cpython/commit/3b5b99da4b256a31933112f4a2385386149c19e1 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:20:17 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 13 Jul 2021 14:20:17 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626186017.28.0.584590580917.issue44603@roundup.psfhosted.org> Paul Ganssle added the comment: > In fact, you're proposing to use exit as a keyword, but lying about it to the users. If it were really so important, then it _should_ be a keyword, and at least I'd know that I can't use it for my variables anymore. (It's not the first time such a thing would happen. The same thing happened with `async` a few years ago.) But please don't introduce those "keywords just in a particular context", they are horrible from the perspective of usability. We already have so-called "soft keywords", e.g. `match`, so the horse is out of the barn at this point. I'm not sure why this is closed as rejected ? I don't see any decision one way or the other in this thread or on the PR, did I miss it? I am struggling to understand how this is a user-hostile change; it is not unreasonable for a REPL to have some commands for interacting with the REPL which are not Python functions. I have accidentally typed `exit` instead of `exit()` many times, and one of the reasons I and many others like IPython is that `exit` exits the REPL. It has never once caused a problem for me, as far as I can tell. I cannot imagine that it is a common scenario for someone to type "exit" in order to inspect the "exit" object ? it doesn't even have a useful repr! The only reason you'd do this would be if you knew what it does and were demonstrating it, or if you were exploring what the various builtins are (which I think is very rare, and you'd probably only have to learn that lesson once). Vedran's point, however, that you could do `exit = some_func()` and then type `exit` to try and inspect the `exit` object is a solid one. That said, I think we can get around this fairly easily (albeit with the cost of some additional complexity in the "handle the exit keyword" function) ? if there's a single AST node that is a name and the name is "exit" or "quit", the REPL inspects locals and globals to see if the object referred to is a Quitter, and if so it exits, otherwise pass through the command as normal (possibly raising a warning like, "Did you mean to exit? You have shadowed the `exit` builtin, so use Ctrl-Z/Ctrl-D to exit or delete your `exit` object and try again"). I understand the arguments for purity and explicability and I'm often one of the first people to argue for keeping things consistent and understandable, but this is one of those things where we could significantly improve user experience for no practical cost. We can identify with very high certainty the situations in which a user intended to exit the REPL, we should go ahead and do it to provide a more intuitive REPL experience. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:21:19 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 13 Jul 2021 14:21:19 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626186079.41.0.631780597638.issue44603@roundup.psfhosted.org> Paul Ganssle added the comment: At this point I think we should probably start a thread on python-dev to see how people feel about it. I'd be happy to author or co-author a PEP for this if need be. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:22:41 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 13 Jul 2021 14:22:41 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626168569.61.0.659845899756.issue44606@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Converting None to type(None) is fine, as long as the str() /repr() converts it back, e.g. repr(int | None) should print just that, not NoneType.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:33:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:33:57 +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: <1626186837.14.0.326161263397.issue44514@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 105e6cd67cc793c971b3e83daa87d36516fcba28 by Miss Islington (bot) in branch '3.9': bpo-44514: Add doctest testcleanup for configparser and bz2 (GH-26909) (#27111) https://github.com/python/cpython/commit/105e6cd67cc793c971b3e83daa87d36516fcba28 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:34:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:34:14 +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: <1626186854.83.0.949253894073.issue44514@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f514addfbc637a42549ddc422b35b6caad2a4363 by Miss Islington (bot) in branch '3.10': bpo-44514: Add doctest testcleanup for configparser and bz2 (GH-26909) (GH-27112) https://github.com/python/cpython/commit/f514addfbc637a42549ddc422b35b6caad2a4363 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:34:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:34:51 +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: <1626186891.95.0.873121671292.issue44514@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:35:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:35:37 +0000 Subject: [issue38741] Definition of multiple ']' in header configparser In-Reply-To: <1573193272.74.0.118296138456.issue38741@roundup.psfhosted.org> Message-ID: <1626186937.34.0.931892508423.issue38741@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1cc6769e4146951d47528a97e56ba1e8e9ee7fc1 by Miss Islington (bot) in branch '3.10': bpo-38741: Definition of multiple ']' in header configparser (GH-17129) (#27110) https://github.com/python/cpython/commit/1cc6769e4146951d47528a97e56ba1e8e9ee7fc1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:35:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:35:12 +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: <1626186912.39.0.853265472056.issue44514@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Kevin! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:36:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:36:28 +0000 Subject: [issue38741] Definition of multiple ']' in header configparser In-Reply-To: <1573193272.74.0.118296138456.issue38741@roundup.psfhosted.org> Message-ID: <1626186988.65.0.0418535978666.issue38741@roundup.psfhosted.org> ?ukasz Langa added the comment: Since I got to this only now, we can include the fix in main (3.11) and 3.10. It's too late in the cycle for 3.9. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:41:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:41:19 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626187279.94.0.548130642223.issue43126@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9b369c952cbefb064dda6cb781e66cc1b793fffa by Miss Islington (bot) in branch '3.10': bpo-43126: Expand docs on io.IOBase.readlines() method (GH-27061) (GH-27113) https://github.com/python/cpython/commit/9b369c952cbefb064dda6cb781e66cc1b793fffa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:41:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:41:35 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626187295.58.0.498593214363.issue43126@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a3d20bfee38c71df88d69064d47fe98a1d59e624 by Miss Islington (bot) in branch '3.9': bpo-43126: Expand docs on io.IOBase.readlines() method (GH-27061) (#27114) https://github.com/python/cpython/commit/a3d20bfee38c71df88d69064d47fe98a1d59e624 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:41:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:41:52 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626187312.21.0.340409448021.issue43126@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- 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 Jul 13 10:42:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 14:42:02 +0000 Subject: [issue43126] IOBase.readlines(0) behaviour is inconsistent with documentation In-Reply-To: <1612448887.77.0.51336599468.issue43126@roundup.psfhosted.org> Message-ID: <1626187322.86.0.696955426933.issue43126@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Andrei! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 10:48:39 2021 From: report at bugs.python.org (Jonathan Fine) Date: Tue, 13 Jul 2021 14:48:39 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help Message-ID: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> New submission from Jonathan Fine : On Linux >>> help(open('/dev/zero').writelines) gives However https://docs.python.org/3/library/io.html#io.IOBase.writelines gives Write a list of lines to the stream. Line separators are not added, so it is usual for each of the lines provided to have a line separator at the end. See also request that writelines support a line separator. https://mail.python.org/archives/list/python-ideas at python.org/thread/A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF/#A5FT7SVZBYAJJTIWQFTFUGNSKMVQNPVF ---------- assignee: docs at python components: Documentation messages: 397414 nosy: docs at python, jfine2358 priority: normal severity: normal status: open title: help(open('/dev/zero').writelines) gives no help type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:00:25 2021 From: report at bugs.python.org (Paul Moore) Date: Tue, 13 Jul 2021 15:00:25 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help In-Reply-To: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> Message-ID: <1626188425.87.0.977845784334.issue44623@roundup.psfhosted.org> Paul Moore added the comment: It does for me: >>> help(open("nul").writelines) Help on built-in function writelines: writelines(lines, /) method of _io.TextIOWrapper instance Write a list of lines to stream. Line separators are not added, so it is usual for each of the lines provided to have a line separator at the end. This is Windows, Python 3.9. What version did you get the problem with? If it's older, I'd say the problem has likely since been fixed. ---------- nosy: +paul.moore _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:04:11 2021 From: report at bugs.python.org (Paul Watson) Date: Tue, 13 Jul 2021 15:04:11 +0000 Subject: [issue44624] Script name for venv PowerShell activate Message-ID: <1626188651.64.0.496215753263.issue44624@roundup.psfhosted.org> New submission from Paul Watson : In the venv .\Scripts directory. the name 'Activate.ps1' does not conform to the PowerShell prescribed Verb-Noun format. How about using 'Initialize-Python.ps1' as the script name? Or, something else that does conform to PowerShell standard naming. ---------- components: Installation messages: 397416 nosy: Paul Watson priority: normal severity: normal status: open title: Script name for venv PowerShell activate type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:16:45 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Jul 2021 15:16:45 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626189405.35.0.539831882216.issue44606@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy, can I work on converting None to type(None) please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:30:16 2021 From: report at bugs.python.org (Jean Abou Samra) Date: Tue, 13 Jul 2021 15:30:16 +0000 Subject: [issue44355] Allow spaces in format strings In-Reply-To: <1623201005.41.0.703153649475.issue44355@roundup.psfhosted.org> Message-ID: <1626190216.63.0.0755662068647.issue44355@roundup.psfhosted.org> Jean Abou Samra added the comment: Maybe leave the current state, keeping backwards compatibility, but improve the error message by adding "perhaps you wanted no spaces in the format field?" when the_field.replace(" ", "") would be valid? ---------- nosy: +Jean_Abou_Samra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:45:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 15:45:30 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626191130.18.0.0329763954289.issue42073@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- nosy: +lukasz.langa nosy_count: 4.0 -> 5.0 pull_requests: +25662 pull_request: https://github.com/python/cpython/pull/27115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:45:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 13 Jul 2021 15:45:30 +0000 Subject: [issue19072] classmethod doesn't honour descriptor protocol of wrapped callable In-Reply-To: <1379856164.11.0.6368818134.issue19072@psf.upfronthosting.co.za> Message-ID: <1626191130.29.0.0906670579042.issue19072@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- nosy: +lukasz.langa nosy_count: 11.0 -> 12.0 pull_requests: +25663 pull_request: https://github.com/python/cpython/pull/27115 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:46:38 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 13 Jul 2021 15:46:38 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help In-Reply-To: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> Message-ID: <1626191198.11.0.726722731629.issue44623@roundup.psfhosted.org> Zachary Ware added the comment: I also can't reproduce this with a fresh build of 3b5b99da4b on Linux. ---------- nosy: +zach.ware resolution: -> works for me status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 11:50:11 2021 From: report at bugs.python.org (Jonathan Fine) Date: Tue, 13 Jul 2021 15:50:11 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help In-Reply-To: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> Message-ID: <1626191411.56.0.785453857636.issue44623@roundup.psfhosted.org> Jonathan Fine added the comment: I used my default Python, which is Python 3.6. However, with 3.7 and 3.8 I get the same as Paul. So I'm closing this as 'not a bug' (as there's not an already-fixed option for closing). ---------- resolution: works for me -> not a bug status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:01:31 2021 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Jul 2021 16:01:31 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1626192091.41.0.712408882286.issue43124@roundup.psfhosted.org> R. David Murray added the comment: This bug report starts with "a malicious user with direct access to `smtplib.SMTP(..., local_hostname, ..)", which is a senseless supposition. Anyone with "access to" the SMTP object could just as well be talking directly to the SMTP server and do anything they want that SMTP itself allows. The concern here is that data a program might obtain *from unsanitized user input* could be used to do header injection. The "proof of concept" does not address this at all. We'd need to see a scenario under which data that could reasonably be derived from user input ends up being passed as arguments to an smtplib method that calls putcmd with arguments. So, I would rate this as *very* low impact issue, unless someone has an *actual example* of code using smtplib that passes user input through to smtplib commands in an exploitable way. That said, it is perfectly reasonable to be proactive here and prevent scenarios we haven't yet thought of, by doing as recommended (and a bit more) by raising a ValueError if 'args' in the putcmd call contain either \n or \r characters. I don't think we need to check 'cmd', because I can't see any scenario in which the SMTP command would be derived from user input. If you want to be *really* paranoid you could check cmd too, and since it will always be a short string the additional performance impact will be minor. ---------- type: performance -> 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 Tue Jul 13 12:01:52 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Jul 2021 16:01:52 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626192112.21.0.203752687411.issue44603@roundup.psfhosted.org> Mark Dickinson added the comment: Related 2005 python-dev discussion: https://mail.python.org/archives/list/python-dev at python.org/thread/VNGY2DLML4QJUXE73JLVBIH5WFBZNIKG/ ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:05:41 2021 From: report at bugs.python.org (R. David Murray) Date: Tue, 13 Jul 2021 16:05:41 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1626192341.7.0.36222596859.issue43124@roundup.psfhosted.org> R. David Murray added the comment: s/header injection/command injection/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:14:34 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 13 Jul 2021 16:14:34 +0000 Subject: [issue44624] Script name for venv PowerShell activate In-Reply-To: <1626188651.64.0.496215753263.issue44624@roundup.psfhosted.org> Message-ID: <1626192874.2.0.924851040665.issue44624@roundup.psfhosted.org> Change by Ammar Askar : ---------- nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:15:43 2021 From: report at bugs.python.org (Azat Ibrakov) Date: Tue, 13 Jul 2021 16:15:43 +0000 Subject: [issue44625] Python C API version of `fractions` module Message-ID: <1626192943.31.0.963042102585.issue44625@roundup.psfhosted.org> New submission from Azat Ibrakov : Are there any plans for implementing `fractions` module in C (like for `decimal` there is a https://github.com/python/cpython/blob/main/Modules/_decimal/_decimal.c module)? I've implemented one myself (https://github.com/lycantropos/cfractions) and from benchmarks (available at https://stackoverflow.com/a/67821911/5997596) we can see that it can be faster that current pure Python implementation. ---------- messages: 397424 nosy: lycantropos priority: normal severity: normal status: open title: Python C API version of `fractions` module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:16:50 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Jul 2021 16:16:50 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626193010.55.0.861528411726.issue44603@roundup.psfhosted.org> Mark Dickinson added the comment: and the related issue: https://bugs.python.org/issue1446372 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:18:09 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 13 Jul 2021 16:18:09 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help In-Reply-To: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> Message-ID: <1626193089.19.0.593876719047.issue44623@roundup.psfhosted.org> Zachary Ware added the comment: Even with 3.6 I get a different result: ``` Python 3.6.13 (tags/v3.6.13:aa73e1722e, Mar 23 2021, 15:45:49) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> help(open('/dev/zero').writelines) Help on built-in function writelines: writelines(lines, /) method of _io.TextIOWrapper instance ``` This appears to be because TextIOWrapper.writelines just didn't have a docstring in 3.6. I can't explain why `help` just gave you the repr of the method, though. ---------- resolution: not a bug -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:18:29 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 13 Jul 2021 16:18:29 +0000 Subject: [issue44623] help(open('/dev/zero').writelines) gives no help In-Reply-To: <1626187719.66.0.592633008408.issue44623@roundup.psfhosted.org> Message-ID: <1626193109.21.0.0819633322883.issue44623@roundup.psfhosted.org> Change by Zachary Ware : ---------- versions: +Python 3.6 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:26:07 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 13 Jul 2021 16:26:07 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626193567.94.0.855530698464.issue44603@roundup.psfhosted.org> Paul Ganssle added the comment: Re-opening this because I think the discussion is not done and I don't see any reason why this was rejected. > Related 2005 python-dev discussion: https://mail.python.org/archives/list/python-dev at python.org/thread/VNGY2DLML4QJUXE73JLVBIH5WFBZNIKG/ @Mark Thanks for digging these up! From what I can tell, that discussion ended up with a combination of there not being quite enough enthusiasm for the idea to drive it forward and no one coming up with a good way to localize the effect to just the case where we know the person was trying to type "exit" in a REPL. I think Pablo's patch shows that a very limited addition to the "REPL layer" is actually plausible, and we *could* implement this without taking on an enormous amount of additional complexity or affecting non-interactive use cases. Fernando's point about it being dangerous to generalize this additional layer of "interactive-use only" keywords is a good one (see: https://mail.python.org/archives/list/python-dev at python.org/message/L37RD7SG26IOBETPI7TETKFGHPAPC75Q/), though it seems that it was this thread that prompted him to add exit/quit as auto-call magic keywords to IPython, and I think that has worked out in the intervening 16 years. I don't think there's much danger of us wanting to generalize this concept, since the only really compelling argument for doing it this way for exit/quit is that almost everyone seems to think it *should* work this way (despite it never having worked this way, and there not being any equivalents), and gets tripped up when it doesn't. > and the related issue: https://bugs.python.org/issue1446372 Looks to me like that is an issue for adding the message when you type "exit". There's no additional discussion disqualifying the use of "exit" as an interactive-only keyword. ---------- resolution: rejected -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:26:22 2021 From: report at bugs.python.org (Paul Ganssle) Date: Tue, 13 Jul 2021 16:26:22 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626193582.76.0.138294613119.issue44603@roundup.psfhosted.org> Change by Paul Ganssle : ---------- stage: resolved -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:33:21 2021 From: report at bugs.python.org (Andrew Svetlov) Date: Tue, 13 Jul 2021 16:33:21 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626194001.01.0.171345597245.issue44604@roundup.psfhosted.org> Andrew Svetlov added the comment: I'm not convinced why @task decorator should be a part of asyncio. You can provide the implementation as a part of some third-party library on pypy.org. Looks like it doesn't require any change of asyncio itself. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:51:02 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 13 Jul 2021 16:51:02 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626195062.83.0.845095544737.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25664 pull_request: https://github.com/python/cpython/pull/27117 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 12:52:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Tue, 13 Jul 2021 16:52:09 +0000 Subject: [issue44625] Python C API version of `fractions` module In-Reply-To: <1626192943.31.0.963042102585.issue44625@roundup.psfhosted.org> Message-ID: <1626195129.96.0.664894577099.issue44625@roundup.psfhosted.org> Mark Dickinson added the comment: No, no plans. There are tradeoffs here - the extra speed comes at the expense of increased maintenance burden. (It's certainly much harder to make minor changes and fixes to the decimal module now that it's written in C.) ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:16:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 17:16:19 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626196579.29.0.631704054136.issue44606@roundup.psfhosted.org> Serhiy Storchaka added the comment: 3. There is also a crash in isinstance(): >>> class BadMeta(type): ... def __instancecheck__(cls, inst): ... 1/0 ... >>> x = int | BadMeta('A', (), {}) >>> isinstance([], x) Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set Python runtime state: initialized Traceback (most recent call last): File "", line 3, in __instancecheck__ ZeroDivisionError: division by zero The above exception was the direct cause of the following exception: SystemError: returned a result with an exception set Current thread 0x00007f024beb1280 (most recent call first): File "", line 1 in Aborted (core dumped) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:29:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 17:29:43 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626197383.11.0.406391990972.issue44606@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25665 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27120 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:30:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 17:30:02 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626197402.91.0.729270444808.issue44606@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- type: behavior -> crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:31:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 13 Jul 2021 17:31:25 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626197485.3.0.794408555793.issue44606@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 27120 fixes __instancecheck__ and __subclasscheck__. Converting None to type(None) will be done in other PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:34:37 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 13 Jul 2021 17:34:37 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626197677.15.0.0294402440689.issue44606@roundup.psfhosted.org> Ken Jin added the comment: > 3. There is also a crash in isinstance(): That's unfortunate :(. Serhiy, thanks for catching all these bugs in union. I recently realized you probably made 50% of all bug reports for union and they're very much appreciated :). > Converting None to type(None) will be done in other PR. Alright. Do tell me if you're too busy and want me to take it up instead. I'll be glad to help. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 13:36:33 2021 From: report at bugs.python.org (Martin Ortner) Date: Tue, 13 Jul 2021 17:36:33 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1626197793.35.0.538596059645.issue43124@roundup.psfhosted.org> Martin Ortner added the comment: > This bug report starts with "a malicious user with direct access to `smtplib.SMTP(..., local_hostname, ..)", which is a senseless supposition. Anyone with "access to" the SMTP object could just as well be talking directly to the SMTP server and do anything they want that SMTP itself allows. Let's not argue about the phrasing and settle on the fact that I am not a native English speaker which might be the root cause of the confusion. The core of the issue is that this *unexpected side-effect* may be security-relevant. Fixing it probably takes less time than arguing about phrasing, severity, or spending time describing exploitation scenarios for a general-purpose library that should protect the underlying protocol from injections. Be kind, I come in peace. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:23:06 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 13 Jul 2021 18:23:06 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield Message-ID: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> New submission from Ned Batchelder : In Python 3.10, this code is traced incorrectly. I don't know if there's a simpler format that would show the problem. This code is already simplified from https://github.com/nedbat/coveragepy/issues/1188. ------------------------------ import linecache, sys def trace(frame, event, arg): # The weird globals here is to avoid a NameError on shutdown... if frame.f_code.co_filename == globals().get("__file__"): lineno = frame.f_lineno print("{} {}: {}".format(event[:4], lineno, linecache.getline(__file__, lineno).rstrip())) return trace print(sys.version) sys.settrace(trace) def f(a, p, z): if p: print(f"{a=}") if a: if z: for x in [1,2]: yield x else: for x in [1,2]: yield x else: print("nope") import itertools for a, p, z in itertools.product([0, 1], repeat=3): list(f(a, p, z)) ------------------------------------ Running this with 3.10.0b4 produces this output. The starred lines show a is false, but tracing then indicates a line which is not executed: 3.10.0b4 (default, Jul 11 2021, 13:51:53) [Clang 12.0.0 (clang-1200.0.32.29)] call 13: def f(a, p, z): line 14: if p: line 24: print("nope") nope retu 24: print("nope") call 13: def f(a, p, z): line 14: if p: line 24: print("nope") nope retu 24: print("nope") call 13: def f(a, p, z): line 14: if p: line 15: print(f"{a=}") a=0 * line 16: if a: line 22: yield x retu 22: yield x call 13: def f(a, p, z): line 14: if p: line 15: print(f"{a=}") a=0 * line 16: if a: line 22: yield x retu 22: yield x call 13: def f(a, p, z): line 14: if p: line 24: print("nope") nope retu 24: print("nope") call 13: def f(a, p, z): line 14: if p: line 24: print("nope") nope retu 24: print("nope") call 13: def f(a, p, z): line 14: if p: line 15: print(f"{a=}") a=1 line 16: if a: line 17: if z: line 21: for x in [1,2]: line 22: yield x retu 22: yield x call 22: yield x line 21: for x in [1,2]: line 22: yield x retu 22: yield x call 22: yield x line 21: for x in [1,2]: line 22: yield x retu 22: yield x call 13: def f(a, p, z): line 14: if p: line 15: print(f"{a=}") a=1 line 16: if a: line 17: if z: line 18: for x in [1,2]: line 19: yield x retu 19: yield x call 19: yield x line 18: for x in [1,2]: line 19: yield x retu 19: yield x call 19: yield x line 18: for x in [1,2]: retu 18: for x in [1,2]: ---------- components: Interpreter Core keywords: 3.10regression messages: 397434 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Incorrect tracing of nested if/if/for/yield type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:23:52 2021 From: report at bugs.python.org (jg) Date: Tue, 13 Jul 2021 18:23:52 +0000 Subject: [issue44627] Python terminal cmd line recall Message-ID: <1626200632.58.0.557312314472.issue44627@roundup.psfhosted.org> New submission from jg : Command line recall in python terminal treats strings case insensitively. Example: Define a 'dummy' function that takes a string as input. If you run dummy twice with the same input string, but different cases, it only saves one. >>> dummy("This is a test") # run this >>> dummy("THIS IS A TEST") # run again w/ different string Now if you try cmd recall, it only recalls the first. I believe it should recall both. Maybe it's treating one as a duplicate - erroneously? ---------- components: Windows messages: 397435 nosy: jggammon, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python terminal cmd line recall type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:43:14 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 13 Jul 2021 18:43:14 +0000 Subject: [issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils) Message-ID: <1626201794.58.0.874918644983.issue44628@roundup.psfhosted.org> New submission from Leonardo Freua : There is a broken link in the docstring of the runtime_library_dir_option() method of the UnixCCompiler class. See the broken link below: http://sourceforge.net/tracker/index.php?func=detail&aid=445902&group_id=5470&atid=105470 And the link that is working for this same issue: https://bugs.python.org/issue445902 I will send a PR removing the link, leaving without it, as there is already exists the issue ID in the docstring. ---------- components: Library (Lib) messages: 397436 nosy: Leonardofreua priority: normal severity: normal status: open title: Remove the broken link for issue #445902 in unixcompiler.py (distutils) versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:46:32 2021 From: report at bugs.python.org (Art) Date: Tue, 13 Jul 2021 18:46:32 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626201992.48.0.1286170304.issue44604@roundup.psfhosted.org> Art added the comment: I understand the hesitation to add this to the library, however I'd like to make a case for why I believe that it fits. To start this is my understanding of the scope of asyncio (or at least part of the scope, taken from the asyncio docs): asyncio provides a set of high-level APIs to: - run Python coroutines concurrently and have full control over their execution; - perform network IO and IPC; - control subprocesses; - distribute tasks via queues; - synchronize concurrent code; I believe this decorator would be another high-level api that would be considered a valid, useful, simple, and if it was more well-known, popular, method of exerting "full control over their execution". Here's an example of a few places from around the internet where people are asking how to do something that would directly benefit from this API, and where I believe frankly that this API would provide a much cleaner/better solution than those proposed. https://old.reddit.com/r/learnpython/comments/oi3ueo/how_do_you_use_asyncio_to_do_this/ (inspiration for demo solution provided above) https://stackoverflow.com/questions/58581270/what-is-the-cleanest-way-to-write-and-run-a-dag-of-tasks (user specifies their tasks are IO bound and that they tried to use asyncio, but to no avail, or it was too complicated) In both these cases above, it is explicitly implied that the user tried to use asyncio to solve their problem, but could not find a satisfactory way to do so. Here's a few more examples of asyncio code, that aren't as directly related to the issue at hand, but would greatly benefit from this isolated "task" structure. https://stackoverflow.com/questions/58905515/how-to-ensure-python-s-asyncio-library-executes-tasks-in-depth-first-search-orde (user trying to build/execute a DAG of async tasks) https://stackoverflow.com/questions/67481509/how-should-i-design-a-concurrency-pipeline-with-asyncio (user could/should consider their task pipeline as a DAG which would conceptually simplify what they are trying to achieve) To directly address the concern of "why add this to asyncio, and not a third-party library". 1) I believe this falls into the scope of the library as demonstrated in the first paragraph of this comment 2) Users look to and trust asyncio to provide good high level apis to build better code/systems (As you can see from some of the examples I posted above) 3) This is a very simple high-level api, that will not interfere with anything else in the library. Will introduce no compatibility issues 4) This point is conjecture, but I believe that this api will keep users from unnecessarily moving their workflows to other libraries like dask (which I love and contribute too) or airflow as you can see from some of the examples where users claim to try other libraries for something that asyncio could easily handle. 5) Inclusion in asyncio (over a third-party library) would provide faster, more reputable exposure to users of a great method of thinking about/solving their problems. I hope you'll re-consider your position, but completely understand if not, in which case I'll close this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:46:59 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 13 Jul 2021 18:46:59 +0000 Subject: [issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils) In-Reply-To: <1626201794.58.0.874918644983.issue44628@roundup.psfhosted.org> Message-ID: <1626202019.59.0.528751647045.issue44628@roundup.psfhosted.org> Change by Leonardo Freua : ---------- keywords: +patch pull_requests: +25666 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27121 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 14:48:59 2021 From: report at bugs.python.org (Art) Date: Tue, 13 Jul 2021 18:48:59 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626202139.1.0.774499714646.issue44604@roundup.psfhosted.org> Art added the comment: Note: regarding my inclusion of "airflow" in point #4 above. I in no way believe that airflow is a viable alternative to this proposal. I included it because one of those posts I linked explicitly mentioned that they looked into it as an alternative. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:03:35 2021 From: report at bugs.python.org (Sergey B Kirpichev) Date: Tue, 13 Jul 2021 19:03:35 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626203015.29.0.647812365305.issue44626@roundup.psfhosted.org> Change by Sergey B Kirpichev : ---------- nosy: +Sergey.Kirpichev _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:21:56 2021 From: report at bugs.python.org (Steve Dower) Date: Tue, 13 Jul 2021 19:21:56 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626204116.43.0.0703216947762.issue44572@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0ee0a740e12ec8568aafa033aa6bb08b265afe26 by Konstantin-Glukhov in branch 'main': bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092) https://github.com/python/cpython/commit/0ee0a740e12ec8568aafa033aa6bb08b265afe26 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:26:06 2021 From: report at bugs.python.org (Sebastian Bank) Date: Tue, 13 Jul 2021 19:26:06 +0000 Subject: [issue12178] csv writer doesn't escape escapechar In-Reply-To: <1306348030.98.0.468032848078.issue12178@psf.upfronthosting.co.za> Message-ID: <1626204366.25.0.657157262639.issue12178@roundup.psfhosted.org> Sebastian Bank added the comment: Thanks Tal. AFAICT there was an undocumented change in behaviour related to this fix. Python 3.9 quotes values with escapechar: ``` import csv import io kwargs = {'escapechar': '\\'} value = 'spam\\eggs' print(value) with io.StringIO() as buf: writer = csv.writer(buf, **kwargs) writer.writerow([value]) line = buf.getvalue() print(line.strip()) with io.StringIO(line) as buf: reader = csv.reader(buf, **kwargs) (new_value,), = reader print(new_value) spam\eggs "spam\eggs" spameggs ``` - quotes escapechar - fails to double the escapechar (this bug) Btw, from https://docs.python.org/3/library/csv.html#csv.QUOTE_MINIMAL > only quote those fields which contain special characters > such as delimiter, quotechar or any of the characters in lineterminator. this seems incorrect because escapechar is not mentioned (but at the same time it says 'such as') and maybe better matching the name 'minimal' (or one might expect 'more' quoting as a better default). Python 3.10: https://github.com/python/cpython/blob/5c0eed7375fdd791cc5e19ceabfab4170ad44062/Lib/test/test_csv.py#L207-L208 See also https://github.com/xflr6/csv23/actions/runs/1027687524 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:28:58 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 19:28:58 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626204538.72.0.639258375252.issue44572@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25667 pull_request: https://github.com/python/cpython/pull/27124 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:29:04 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 19:29:04 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626204544.61.0.184225624596.issue44572@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25668 pull_request: https://github.com/python/cpython/pull/27125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:35:40 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 13 Jul 2021 19:35:40 +0000 Subject: [issue44629] Some files from distutils module are importing all exceptions unnecessarily Message-ID: <1626204940.79.0.533758495697.issue44629@roundup.psfhosted.org> New submission from Leonardo Freua : Some files from the distutils module are importing all the exceptions from the errors.py file unnecessarily, when in fact only a few of the Exception classes are used. Could I open a PR by fixing the files that are making these unnecessary imports? Or is this problem in the same category as f-String refactorings? ---------- components: Library (Lib) messages: 397441 nosy: Leonardofreua priority: normal severity: normal status: open title: Some files from distutils module are importing all exceptions unnecessarily type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:43:10 2021 From: report at bugs.python.org (Tzu-ping Chung) Date: Tue, 13 Jul 2021 19:43:10 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1626205390.21.0.685222516963.issue43948@roundup.psfhosted.org> Tzu-ping Chung added the comment: Personally I am not very surprised. The scenario (installing a package to the user scheme of a macOS Framework build) is quite obscure on its own, and AFAIK no third-party package installers is currently using sysconfig. Both pip and setuptools use distutils, and everything else uses one of them to perform the installation indirectly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:46:33 2021 From: report at bugs.python.org (Jay Swanson) Date: Tue, 13 Jul 2021 19:46:33 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1626205593.2.0.151150350462.issue33125@roundup.psfhosted.org> Jay Swanson added the comment: I know this is closed, but is it possible that the ARM64EC support coming in Windows 11 that allows mixed native/emulated code is something that would help this along? That along with the sunsetting of 32-bit systems. ---------- nosy: +jay.swanson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:48:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 19:48:32 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626205712.69.0.762382263696.issue44572@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 425756abdc03263ab3a52b068befd1ddb16c2dd2 by Miss Islington (bot) in branch '3.10': bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092) (GH-27124) https://github.com/python/cpython/commit/425756abdc03263ab3a52b068befd1ddb16c2dd2 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:52:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 19:52:14 +0000 Subject: [issue34292] test_compile hangs in AMD Ubuntu buildbots In-Reply-To: <1533041303.96.0.56676864532.issue34292@psf.upfronthosting.co.za> Message-ID: <1626205934.32.0.334835819238.issue34292@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:51:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 19:51:59 +0000 Subject: [issue37271] Make multiple passes of the peephole optimizer until bytecode cannot be optimized further In-Reply-To: <1560477510.59.0.491449903314.issue37271@roundup.psfhosted.org> Message-ID: <1626205919.77.0.537725731313.issue37271@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:52:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 19:52:30 +0000 Subject: [issue38842] test_multiprocessing_spawn altered the execution environment in AMD64 FreeBSD Non-Debug 3.x In-Reply-To: <1574120393.33.0.271928086665.issue38842@roundup.psfhosted.org> Message-ID: <1626205950.94.0.829731781599.issue38842@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 15:52:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 19:52:25 +0000 Subject: [issue34388] collect_gdb fails for test.pythoninfo in several AMD64 FreeBSD buildbots In-Reply-To: <1534089535.5.0.56676864532.issue34388@psf.upfronthosting.co.za> Message-ID: <1626205945.44.0.978458004584.issue34388@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 16:44:35 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Tue, 13 Jul 2021 20:44:35 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626209075.73.0.667525950189.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25669 pull_request: https://github.com/python/cpython/pull/27126 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 17:27:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 21:27:58 +0000 Subject: [issue33346] Syntax error with async generator inside dictionary comprehension In-Reply-To: <1524567941.57.0.682650639539.issue33346@psf.upfronthosting.co.za> Message-ID: <1626211678.54.0.475991722814.issue33346@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 054e9c84ac7c394941bba3ea1829d14dce1243fc by Serhiy Storchaka in branch 'main': bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766) https://github.com/python/cpython/commit/054e9c84ac7c394941bba3ea1829d14dce1243fc ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 17:27:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 13 Jul 2021 21:27:58 +0000 Subject: [issue33346] Syntax error with async generator inside dictionary comprehension In-Reply-To: <1524567941.57.0.682650639539.issue33346@psf.upfronthosting.co.za> Message-ID: <1626211678.54.0.475991722814.issue33346@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 054e9c84ac7c394941bba3ea1829d14dce1243fc by Serhiy Storchaka in branch 'main': bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766) https://github.com/python/cpython/commit/054e9c84ac7c394941bba3ea1829d14dce1243fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 17:49:13 2021 From: report at bugs.python.org (Thomas Wouters) Date: Tue, 13 Jul 2021 21:49:13 +0000 Subject: [issue44630] Assertion failure in csv module Message-ID: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> New submission from Thomas Wouters : The csv module has some incorrect exception handling when dealing with dialect objects that are not csv.Dialect subclasses (or that otherwise raise errors when accessing the dialect attributes): >>> csv.reader([], dialect=None) python: ../../cpython/Objects/typeobject.c:3820: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed. Aborted The problem is Modules/_csv.c tries to cater to dialects that lack the attributes it wants to access, but does so by leaving exceptions set between calls to PyObject_SetAttrString(). Since 3.7, that causes assertion failures. (I have a PR with a fix.) ---------- assignee: twouters components: Extension Modules messages: 397446 nosy: gregory.p.smith, twouters priority: normal severity: normal status: open title: Assertion failure in csv module type: crash versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 17:55:23 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 13 Jul 2021 21:55:23 +0000 Subject: [issue44627] Python terminal cmd line recall In-Reply-To: <1626200632.58.0.557312314472.issue44627@roundup.psfhosted.org> Message-ID: <1626213323.49.0.103571055925.issue44627@roundup.psfhosted.org> Eryk Sun added the comment: By default, reading input from the console uses the console's built-in command-line editor. You can clear the console input history with Alt+F7; display the history list with F7; navigate in the history list with the up and down arrow keys, even when the list isn't displayed; recall the first and last entries of the list with page up and page down; and cycle through matching command completions with F8. Having said that, the new implementation of the console in Windows 10 has a bug in the "Discard Old Duplicates" history option [1]. Try disabling this option in the console's "Properties" dialog, which can be accessed from the Alt+Space control menu. --- [1] https://github.com/microsoft/terminal/issues/4186 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 17:56:45 2021 From: report at bugs.python.org (Thomas Wouters) Date: Tue, 13 Jul 2021 21:56:45 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626213405.72.0.177542182516.issue44630@roundup.psfhosted.org> Change by Thomas Wouters : ---------- keywords: +patch pull_requests: +25670 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27127 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:04:27 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 13 Jul 2021 22:04:27 +0000 Subject: [issue44631] Refactoring the repr() of the _Environ class (os module) Message-ID: <1626213867.27.0.881981550683.issue44631@roundup.psfhosted.org> New submission from Leonardo Freua : Currently, the repr() code of the _Environ class does many things in a bunched way, making it difficult to read and difficult to determine the result returned by the method. Therefore, I propose an adjustment in the code to make it more readable, as well as your test. ---------- components: Library (Lib) messages: 397448 nosy: Leonardofreua priority: normal severity: normal status: open title: Refactoring the repr() of the _Environ class (os 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 Tue Jul 13 18:18:08 2021 From: report at bugs.python.org (Leonardo Freua) Date: Tue, 13 Jul 2021 22:18:08 +0000 Subject: [issue44631] Refactoring the repr() of the _Environ class (os module) In-Reply-To: <1626213867.27.0.881981550683.issue44631@roundup.psfhosted.org> Message-ID: <1626214688.68.0.0527245113304.issue44631@roundup.psfhosted.org> Change by Leonardo Freua : ---------- keywords: +patch pull_requests: +25671 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27128 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:18:29 2021 From: report at bugs.python.org (Yury Selivanov) Date: Tue, 13 Jul 2021 22:18:29 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626214709.04.0.103269727809.issue44604@roundup.psfhosted.org> Yury Selivanov added the comment: Yeah, I'm also not convinced this has to be part of asyncio, especially since we'll likely have task groups in 3.11. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:56:52 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Jul 2021 22:56:52 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626217012.94.0.145382061552.issue44630@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 0093876328afa330224c9d887c18dee0b3117852 by T. Wouters in branch 'main': bpo-44630: Fix assertion errors in csv module (GH-27127) https://github.com/python/cpython/commit/0093876328afa330224c9d887c18dee0b3117852 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:56:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 13 Jul 2021 22:56:44 +0000 Subject: [issue38278] Need a more efficient way to perform dict.get(key, default) In-Reply-To: <1569422117.26.0.730288338211.issue38278@roundup.psfhosted.org> Message-ID: <1626217004.24.0.884741371281.issue38278@roundup.psfhosted.org> Irit Katriel added the comment: > Was LOAD_METHOD optimized for builtin methods? Maybe this can be done with specialization. ---------- nosy: +Mark.Shannon, gvanrossum, iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:56:56 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 22:56:56 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626217016.33.0.809488525918.issue44630@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25672 pull_request: https://github.com/python/cpython/pull/27129 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 18:57:02 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 22:57:02 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626217022.59.0.884246339453.issue44630@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25673 pull_request: https://github.com/python/cpython/pull/27130 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 19:18:36 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 23:18:36 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626218316.62.0.296707643638.issue44630@roundup.psfhosted.org> miss-islington added the comment: New changeset bb260c2a212aee2a7d7a32bf5208fd554bf72713 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44630: Fix assertion errors in csv module (GH-27127) (GH-27129) https://github.com/python/cpython/commit/bb260c2a212aee2a7d7a32bf5208fd554bf72713 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 19:20:32 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 13 Jul 2021 23:20:32 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626218432.22.0.0687106255433.issue44630@roundup.psfhosted.org> miss-islington added the comment: New changeset fe73509c5ba3844b45a2253967522531ab80c849 by Miss Islington (bot) in branch '3.9': bpo-44630: Fix assertion errors in csv module (GH-27127) https://github.com/python/cpython/commit/fe73509c5ba3844b45a2253967522531ab80c849 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 19:26:06 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 13 Jul 2021 23:26:06 +0000 Subject: [issue44630] Assertion failure in csv module In-Reply-To: <1626212953.96.0.40256914813.issue44630@roundup.psfhosted.org> Message-ID: <1626218766.57.0.430726018742.issue44630@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks! Things like this both internal to CPython and in CPython API misuse in all sorts of third party extension modules are why i think we as a project really should to encourage more CI systems to have -UNDEBUG builds of CPython available and in use by default when people request Python... To answer anyone's "why no news entry?" questions... This only shows up in -UNDEBUG (and thus pydebug) builds of CPython. Which basically nobody uses. We, Google, keep C assertions enabled by undefining NDEBUG in our default non-release builds that everything by default runs tests against as a way to help improve code quality. ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 20:58:57 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 14 Jul 2021 00:58:57 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626224337.55.0.896525785391.issue44603@roundup.psfhosted.org> Change by ?ric Araujo : ---------- components: +Library (Lib) -Demos and Tools nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:12:11 2021 From: report at bugs.python.org (Art) Date: Wed, 14 Jul 2021 02:12:11 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626228731.76.0.387149342157.issue44604@roundup.psfhosted.org> Art added the comment: Hi Yury, could you by any chance point me to some material on the inclusion of task groups in 3.11? I've found these "task group" docs from a library called AnyIO: https://anyio.readthedocs.io/en/stable/tasks.html. If the asyncio task group feature is similar to this, then while I think it is a nice inclusion, I believe it does not cover the use case that this proposal would cover. * If your opinion on the matter is still not final, then would you be open to a further demonstration of this proposal? I could gather several use cases from SO and other sites and demo how they could be elegantly solved with this interface. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:25:11 2021 From: report at bugs.python.org (Pablo Aguilar) Date: Wed, 14 Jul 2021 02:25:11 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1626229511.65.0.490235797868.issue44617@roundup.psfhosted.org> Pablo Aguilar added the comment: But, `Maybe.empty` works like a `Literal Pattern` or `Constant Pattern`? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:31:58 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 14 Jul 2021 02:31:58 +0000 Subject: [issue38278] Need a more efficient way to perform dict.get(key, default) In-Reply-To: <1569422117.26.0.730288338211.issue38278@roundup.psfhosted.org> Message-ID: <1626229918.88.0.633669985546.issue38278@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:31:59 2021 From: report at bugs.python.org (Pablo Aguilar) Date: Wed, 14 Jul 2021 02:31:59 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1626229919.99.0.308126028714.issue44617@roundup.psfhosted.org> Pablo Aguilar added the comment: In fact, I'm worried about how to explain some behaviors. Look here: ```python # `Maybe` here is the same class described in the first message Nothing = Maybe() Maybe.empty = Nothing if __name__ == '__main__': my_maybe = Maybe() match my_maybe: case Nothing: print('FIRST CASE') case _: print('DEFAULT CASE') ``` I can't use `Nothing` to match the values even though it's a variable but using `Maybe.empty` it works. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:54:12 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Jul 2021 02:54:12 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626231252.75.0.90367729953.issue44603@roundup.psfhosted.org> Gregory P. Smith added the comment: Agreed with Paul, this is a good idea UX wise for interactive interpreters. IPython proved that well over a decade ago. Thanks for the historical links! ---------- nosy: +gregory.p.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 22:54:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Jul 2021 02:54:34 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626231274.87.0.929164476047.issue44603@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- stage: -> patch review type: behavior -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 23:31:38 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 14 Jul 2021 03:31:38 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1626233498.42.0.591672161301.issue44617@roundup.psfhosted.org> Dennis Sweeney added the comment: >From https://www.python.org/dev/peps/pep-0635/#value-patterns : """We therefore only adopted the rule that any dotted name (i.e., attribute access) is to be interpreted as a value pattern, for example HttpStatus.OK above. This precludes, in particular, local variables and global variables defined in the current module from acting as constants.""" So your `case Nothing` example is an irrefutable capture pattern that binds the subject to the name "Nothing", while `case Maybe.empty` is a value pattern. This is probably a little confusing the first time a person sees it, but it is in fact working in compliance with PEP 634, PEP 635, and PEP 636. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 13 23:35:17 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 03:35:17 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626233717.96.0.261377282398.issue44589@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +25674 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27131 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:02:03 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 04:02:03 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626235323.03.0.671273688731.issue44589@roundup.psfhosted.org> Jack DeVries added the comment: @brandtbucher, I think that my PR implements the solution you've described here. What do you think? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:26:41 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 14 Jul 2021 04:26:41 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626141510.8.0.243374835753.issue44603@roundup.psfhosted.org> Message-ID: <20210714042434.GM13804@ando.pearwood.info> Steven D'Aprano added the comment: On Tue, Jul 13, 2021 at 01:58:30AM +0000, Taylor Alexander wrote: > I would push back against the idea that this is about laziness. It > sounds like this is about reducing user confusion. Users aren't *confused* by the instructions, which are clear and simple: call the object using parentheses. Nobody says that they don't understand what it means to "use exit() to exit". They are *annoyed* that they have to type the parentheses. This is not confusion, and it is disengenious to claim that people are "confused". Especially when people have said that they understand the technical reasons for why exit behaves as it does, and that makes them "more frustrated". So they understand the reasoning why having repr(exit) kill the interpreter is a bad idea, and rather than satisfying them, they get even more annoyed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:30:18 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 04:30:18 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626237018.34.0.196133316415.issue44603@roundup.psfhosted.org> Jack DeVries added the comment: I wonder if the middle ground here is to let it be a teachable moment, and to inform the user by having the string returned by __repr__ be a bit more descriptive. Currently, it is: > Use exit() or Ctrl-Z plus Return to exit I propose: > exit is the function that closes Python when called. To call a Python function, add parenthesis! For example, "exit()". To share a personal anecdote, Python was my first programming language. I can remember this specific case of REPL-stubbornness being instrumental in teaching me about referencing versus calling a function. Special cases cause confusion, and a shortcut that removes two characters at the expense of skirting past an essential understanding is not the right choice. The place we should be *most* careful about breaking language idioms are in the spots that are exposed to beginners and newcomers to the language. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:35:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 04:35:50 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626237350.64.0.360876868907.issue44606@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25675 pull_request: https://github.com/python/cpython/pull/27132 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:35:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 04:35:48 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626237348.22.0.164432402425.issue44606@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 81989058de381108dfd0a4255b93d4fb34417002 by Serhiy Storchaka in branch 'main': bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120) https://github.com/python/cpython/commit/81989058de381108dfd0a4255b93d4fb34417002 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 00:55:49 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 04:55:49 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626238549.37.0.235365843923.issue44606@roundup.psfhosted.org> miss-islington added the comment: New changeset b42eee78e7651693aa38c390f577e5d499dcf55d by Miss Islington (bot) in branch '3.10': bpo-44606: Fix __instancecheck__ and __subclasscheck__ for the union type. (GH-27120) https://github.com/python/cpython/commit/b42eee78e7651693aa38c390f577e5d499dcf55d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:19:36 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 05:19:36 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626239976.28.0.225230762435.issue44608@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25676 pull_request: https://github.com/python/cpython/pull/27133 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:19:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 05:19:36 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626239976.01.0.64141728099.issue44608@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6 by Serhiy Storchaka in branch 'main': bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107) https://github.com/python/cpython/commit/f572cbf1faab33d9afbbe3e95738ed6fbe6e48e6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:19:41 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 05:19:41 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626239981.72.0.616789715639.issue44608@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25677 pull_request: https://github.com/python/cpython/pull/27134 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:21:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 05:21:16 +0000 Subject: [issue44606] Discrepancy between isinstance() and issubclass() for union types In-Reply-To: <1626068010.0.0.827203286312.issue44606@roundup.psfhosted.org> Message-ID: <1626240076.93.0.947023320617.issue44606@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 Jul 14 01:33:24 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 05:33:24 +0000 Subject: [issue44632] Union with TypeVar does not work as intended Message-ID: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> New submission from Serhiy Storchaka : >>> import typing >>> int | typing.T int | ~T >>> typing.T | int typing.Union[~T, int] >>> T2 = TypeVar('T2') >>> int | T2 typing.Union[int, ~T2] >>> T2 | int typing.Union[~T2, int] There is a support of TypeVar in type.__or__, but it does not work with user defined TypeVars, only with internal TypeVars defined in the typing module. ---------- components: Interpreter Core messages: 397466 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Union with TypeVar does not work as intended type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:40:24 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 05:40:24 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626241224.73.0.351003468926.issue44608@roundup.psfhosted.org> miss-islington added the comment: New changeset 7e1d6308a3fc536719adcf1df0aa4e9953c12f8b by Miss Islington (bot) in branch '3.10': bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107) https://github.com/python/cpython/commit/7e1d6308a3fc536719adcf1df0aa4e9953c12f8b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:42:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 05:42:46 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented Message-ID: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> New submission from Serhiy Storchaka : >>> import typing >>> (int | typing.T)[1] NotImplemented It is related to issue44632. ---------- components: Interpreter Core messages: 397468 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Indexing the union type can return NotImplemented type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:44:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 05:44:16 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626241456.79.0.138773430764.issue44608@roundup.psfhosted.org> miss-islington added the comment: New changeset 94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b by Miss Islington (bot) in branch '3.9': bpo-44608: Fix memory leak in _tkinter._flatten() (GH-27107) https://github.com/python/cpython/commit/94adfe6e2cdc9ba715b6d7068d8bd521ba6bf30b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 01:47:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 05:47:33 +0000 Subject: [issue44608] Memory use increase in function _tkinter._flatten In-Reply-To: <1626073230.86.0.981576965453.issue44608@roundup.psfhosted.org> Message-ID: <1626241653.37.0.164543775652.issue44608@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 Jul 14 02:03:29 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Wed, 14 Jul 2021 06:03:29 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626242609.12.0.174932922639.issue40897@roundup.psfhosted.org> Mauricio Villegas added the comment: I created another issue since the problem appears to be a bit different: https://bugs.python.org/issue44618 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 05:09:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Jul 2021 09:09:08 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626253748.55.0.787130180168.issue44616@roundup.psfhosted.org> Mark Shannon added the comment: New changeset e5862f79c16e28f1ec51d179698739a9b2d8c1d2 by Mark Shannon in branch 'main': bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109) https://github.com/python/cpython/commit/e5862f79c16e28f1ec51d179698739a9b2d8c1d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 05:42:37 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Jul 2021 09:42:37 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626255757.71.0.748465753289.issue44616@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25678 pull_request: https://github.com/python/cpython/pull/27135 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:06:00 2021 From: report at bugs.python.org (Ned Batchelder) Date: Wed, 14 Jul 2021 10:06:00 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626257160.82.0.838670173583.issue44626@roundup.psfhosted.org> Ned Batchelder added the comment: The original reporter of the coverage.py issue says they have a simpler reproducer: https://github.com/nedbat/coveragepy/issues/1188#issuecomment-879572874 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:44:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Jul 2021 10:44:08 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626259448.24.0.812156320943.issue44616@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 794ff7d505f852dc4e0f94901dc7387afaead3bb by Mark Shannon in branch '3.10': bpo-44616: Mark all clean up instructions at end of named exception block as artificial (GH-27109) (GH-27135) https://github.com/python/cpython/commit/794ff7d505f852dc4e0f94901dc7387afaead3bb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:51:23 2021 From: report at bugs.python.org (Pavel Moiseenko) Date: Wed, 14 Jul 2021 10:51:23 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps Message-ID: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> New submission from Pavel Moiseenko : The version of the app is duplicated in the name of the app in the list of installed apps in "Settings - Apps - Apps & features" and "Control Panel - Programs - Programs and Features" in the version for Windows. Please remove the version number from the app name, as the version number is displayed next to the name in a separate field. ---------- components: Windows files: 2021-07-14 13-49-41 Settings.png messages: 397474 nosy: paul.moore, rakleed, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Version is duplicated in name of app in list of installed apps type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50147/2021-07-14 13-49-41 Settings.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:51:57 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 10:51:57 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor Message-ID: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> New submission from Serhiy Storchaka : There is a difference between typing.Union and the builtin union type in representing None in __args__: >>> import typing >>> typing.Union[int, None].__args__ (, ) >>> typing.Union[int, type(None)].__args__ (, ) >>> (int | None).__args__ (, None) >>> (int | type(None)).__args__ (, ) The former converts None to NoneType, the latter leaves it as is, and only performs conversion in __instancecheck__ and __subclasscheck__. In the discussion for issue44606 it was proposed to convert None to NoneType in the union type constructor to make more uniform with typing.Union and simplify __instancecheck__ and __subclasscheck__. ---------- components: Interpreter Core messages: 397475 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Convert None to NoneType in the union type constructor type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:52:17 2021 From: report at bugs.python.org (Pavel Moiseenko) Date: Wed, 14 Jul 2021 10:52:17 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626259937.57.0.815174937622.issue44634@roundup.psfhosted.org> Change by Pavel Moiseenko : Added file: https://bugs.python.org/file50148/2021-07-14 13-50-19 Programs and Features.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:54:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 10:54:46 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626260086.51.0.11776500892.issue44635@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +gvanrossum, kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 06:55:13 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 10:55:13 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626260113.7.0.285555249887.issue44635@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25679 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27136 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 07:04:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 11:04:42 +0000 Subject: [issue44636] It is possible to create a 1-type union type Message-ID: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> New submission from Serhiy Storchaka : typing.Union always collapsed to a simple type if it contains a single type. >>> import typing >>> typing.Union[int, typing.T][int] But the builtin union type can contain a single type: >>> (int | typing.T)[int] int >>> type((int | typing.T)[int]) ---------- components: Interpreter Core messages: 397476 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: It is possible to create a 1-type union type type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 07:05:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 11:05:14 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626260714.46.0.0831146569646.issue44636@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +Union with TypeVar does not work as intended _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 07:05:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 11:05:35 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626260735.41.0.454269454654.issue44633@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +Union with TypeVar does not work as intended _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 07:26:51 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 11:26:51 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1626262011.98.0.578489033615.issue42064@roundup.psfhosted.org> miss-islington added the comment: New changeset 05162993fe62e7fa3acebdd0062586b9bf63d46a by Erlend Egeberg Aasland in branch 'main': bpo-42064: Move `sqlite3` exceptions to global state, part 2 of 2 (GH-26884) https://github.com/python/cpython/commit/05162993fe62e7fa3acebdd0062586b9bf63d46a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 08:44:57 2021 From: report at bugs.python.org (Baptiste) Date: Wed, 14 Jul 2021 12:44:57 +0000 Subject: [issue44637] Quoting issue on header Reply-To Message-ID: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> New submission from Baptiste : Hello, When using as_string() on a Reply-To header like the following: msg['Reply-To'] = '"foo Research, Inc. Foofoo BarBar on Summer Special Friday: 0.50 days (2021-02-31)" ' The double quote disappear, which lead to wrong header value See attached file for example ---------- components: email files: Reply-To.py messages: 397478 nosy: Abridbus, Julien Castiaux, barry, r.david.murray priority: normal severity: normal status: open title: Quoting issue on header Reply-To type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50149/Reply-To.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 09:39:49 2021 From: report at bugs.python.org (jg) Date: Wed, 14 Jul 2021 13:39:49 +0000 Subject: [issue44627] Python terminal cmd line recall In-Reply-To: <1626213323.49.0.103571055925.issue44627@roundup.psfhosted.org> Message-ID: jg added the comment: Thanks, I didn't know about the F7 or F8 commands. My 'Discard Old Duplicates' was already disabled (default?). John G. Gammon -. .. .... .. .-.. .- -.. -- .. .-. .- .-. .. This message and any attachments hereto may contain confidential and/or privileged information. If you are not the intended recipient or authorized to receive this for the intended recipient, please advise the sender immediately by reply e-mail and delete this message; you must not use, copy, disclose or take any other action based on this message or any information herein. Thank you for your cooperation. ________________________________ From: report=bugs.python.org at roundup.psfhosted.org on behalf of Eryk Sun Sent: Tuesday, July 13, 2021 16:55 To: jggammon at hotmail.com Subject: [issue44627] Python terminal cmd line recall Eryk Sun added the comment: By default, reading input from the console uses the console's built-in command-line editor. You can clear the console input history with Alt+F7; display the history list with F7; navigate in the history list with the up and down arrow keys, even when the list isn't displayed; recall the first and last entries of the list with page up and page down; and cycle through matching command completions with F8. Having said that, the new implementation of the console in Windows 10 has a bug in the "Discard Old Duplicates" history option [1]. Try disabling this option in the console's "Properties" dialog, which can be accessed from the Alt+Space control menu. --- [1] https://github.com/microsoft/terminal/issues/4186 ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 09:47:17 2021 From: report at bugs.python.org (R. David Murray) Date: Wed, 14 Jul 2021 13:47:17 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626270437.09.0.17735548699.issue44637@roundup.psfhosted.org> R. David Murray added the comment: There is definitely a problem here, though I see a different problem when I run it (AttributeError: 'Group' object has no attribute 'local_part', presumably because of the ':' not getting escaped correctly). I believe it applies to any address header, not just Reply-To. Unfortunately I don't have time to investigate the cause, at least right now. An interesting first step on diagnosing it might be to produce a minimal example: start deleting special characters from inside that quoted string until you find the one (or ones) that is triggering it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 10:03:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 14 Jul 2021 14:03:49 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626271429.04.0.67485877278.issue44618@roundup.psfhosted.org> Guido van Rossum added the comment: Doesn?t it do that with any built in function? Try Len or open, for example. I think that?s a feature, at least not a bug specific to date time. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 10:10:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 14 Jul 2021 14:10:30 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626271830.12.0.494953443132.issue44632@roundup.psfhosted.org> Guido van Rossum added the comment: The code for recognizing TypeVars must be wrong. Is it also wrong in e.g. list[T]? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 10:25:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Wed, 14 Jul 2021 14:25:45 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626272745.85.0.080293514789.issue44626@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25680 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27138 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 10:48:27 2021 From: report at bugs.python.org (Christian Steinmeyer) Date: Wed, 14 Jul 2021 14:48:27 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed Message-ID: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> New submission from Christian Steinmeyer : When executing the code below with the attached zip file (or any other that has one or more files directly at root level), I get a "ValueError: seek of closed file". It seems, the zipfile handle being part of the `TestClass` instance is being closed, when the `zipfile.Path` is garbage collected, when it is no longer referenced. Since `zipfile.Path` even takes a `zipfile.Zipfile` as an argument, I don't think it is intended? It surprised me at least. ``` import zipfile class TestClass: def __init__(self, path): self.zip_file = zipfile.ZipFile(path) def iter_dir(self): return [each.name for each in zipfile.Path(self.zip_file).iterdir()] def read(self, filename): with self.zip_file.open(filename) as file: print(file.read()) root = "zipfile.zip" test = TestClass(root) files = test.iter_dir() test.read(files[0]) ``` ---------- components: Library (Lib) files: zipfile.zip messages: 397483 nosy: christian.steinmeyer priority: normal severity: normal status: open title: zipfile.ZipFile is closed when zipfile.Path is closed type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50150/zipfile.zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:22:07 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 15:22:07 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626276127.02.0.583582404485.issue44616@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:24:08 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Wed, 14 Jul 2021 15:24:08 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626276248.41.0.624056641097.issue44618@roundup.psfhosted.org> Mauricio Villegas added the comment: > Doesn?t it do that with any built in function? Sorry. I did not include what is the behavior for other classes. An example could be calendar.Calendar. In this case the signature gives: >>> from calendar import Calendar >>> import inspect >>> print(inspect.signature(Calendar.__init__)) (self, firstweekday=0) >>> print(inspect.signature(Calendar)) (firstweekday=0) Note that the signature gives firstweekday which is the only init parameter. Calendar is not implemented with __new__ so getting the signature would be for object, that does not include named parameters. It also works fine when you implement a class with __new__. For example: >>> class MyClass: def __new__(cls, paramA, paramB=1): obj = object.__new__(cls) obj.paramA = paramA obj.paramB = paramB return obj >>> print(inspect.signature(MyClass.__new__)) (cls, paramA, paramB=1) >>> print(inspect.signature(MyClass)) (paramA, paramB=1) I do think it is a bug specific to the datetime classes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:26:08 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 14 Jul 2021 15:26:08 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626276368.3.0.360415593128.issue44638@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: This seems similar to https://bugs.python.org/issue40564 ---------- nosy: +jaraco, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:27:27 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 14 Jul 2021 15:27:27 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626276447.91.0.034829421667.issue44632@roundup.psfhosted.org> Ken Jin added the comment: Oh this is a fun one :). > The code for recognizing TypeVars must be wrong. Is it also wrong in e.g. list[T]? list[T] is correct. I was pretty puzzled since I thought their code is nearly the same, but then I noticed a subtle difference -- GenericAlias checks for type(o).__module__ == "typing", while Union checks for o.__module__ == "typing", and o.__module__ is wherever the user defines it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:37:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 15:37:44 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626277064.64.0.263356046297.issue44632@roundup.psfhosted.org> Serhiy Storchaka added the comment: Good question. It works correctly in list[T]. There is a tiny difference between implementations of the check in genericaliasobject.c and unionobject.c. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:50:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 14 Jul 2021 15:50:43 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626277843.74.0.0896192244425.issue44618@roundup.psfhosted.org> Guido van Rossum added the comment: You're right, it seems specific to built-in *classes* like those in datetime. We get the same with inspect.signature(int), since int is also a built-in class. I don't know who maintains inspect, but it's not me. :-( ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:54:09 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 14 Jul 2021 15:54:09 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1626278049.16.0.177742096748.issue33125@roundup.psfhosted.org> Steve Dower added the comment: I'm sure it will help, but official support will continue to be blocked by availability of CI/CD systems for first- and third-party packages/testing. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:55:34 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 14 Jul 2021 15:55:34 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626278134.55.0.136568852817.issue44634@roundup.psfhosted.org> Steve Dower added the comment: Apart from the duplication, is there some reason why this is a problem? The name is used in a number of other places where the version number is very helpful. I'm not sure we can separate the variables in WiX. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 11:56:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 15:56:30 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626278190.14.0.060144652079.issue44632@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25681 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27139 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:00:15 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 14 Jul 2021 16:00:15 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1626278415.08.0.941774713751.issue44473@roundup.psfhosted.org> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +25682 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27140 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:17:22 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 14 Jul 2021 16:17:22 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626279442.19.0.107304383134.issue44572@roundup.psfhosted.org> Steve Dower added the comment: New changeset 5fc784e28ab9cd02c30395d1973ff825b787efa2 by Miss Islington (bot) in branch '3.9': bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent erroneous STDIN consumption (GH-27092) https://github.com/python/cpython/commit/5fc784e28ab9cd02c30395d1973ff825b787efa2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:17:42 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 14 Jul 2021 16:17:42 +0000 Subject: [issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN In-Reply-To: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org> Message-ID: <1626279462.73.0.635604960918.issue44572@roundup.psfhosted.org> Steve Dower added the comment: Thanks for the contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:23:24 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 14 Jul 2021 16:23:24 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626279804.11.0.377041718255.issue44589@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks for the patch @jack__d! I'll try to find time to review it today. I do wish you would have coordinated with me here before writing it, though. I'd already begun working on a patch with a few new contributors yesterday, as I mentioned in my comment. In the future, please check in with those involved in the PR discussion first (*especially* if the issue is already "assigned"). We're doing this for fun, too. :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:24:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 14 Jul 2021 16:24:13 +0000 Subject: [issue38210] Intersection of dict view with iterator returns empty set In-Reply-To: <1568790606.98.0.898790756289.issue38210@roundup.psfhosted.org> Message-ID: <1626279853.01.0.203813231131.issue38210@roundup.psfhosted.org> ?ukasz Langa added the comment: This caused an unintentional behavior change in the following code: >>> {1: 2}.items() & {1: {2: 3}}.items() set() Before this change, Python 3.6 - 3.8 behaved like this instead: >>> {1: 2}.items() & {1: {2: 3}}.items() Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'dict' Interestingly, this doesn't seem to have a negative effect on correctness as the silently omitted unhashable (k, v) pair is only omitted if it's different between the two dictionaries: >>> {1: {2: 4}}.items() & {1: {2: 3}}.items() set() >>> {2: 1, 1: {2: 4}}.items() & {2: 1, 1: {2: 3}}.items() {(2, 1)} If it's the same, we still get an error in Python 3.9: >>> {1: {2: 3}}.items() & {1: {2: 3}}.items() Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'dict' >>> {2: 1, 1: {2: 3}}.items() & {2: 1, 1: {2: 3}}.items() Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'dict' ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:53:08 2021 From: report at bugs.python.org (John M. Boger) Date: Wed, 14 Jul 2021 16:53:08 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" Message-ID: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> New submission from John M. Boger : In the documentation for sqlite3.executescript() in python 3.9+, the pseudoword "transation" appears. I am reasonably sure "transaction" is meant, although it could be "translation". ---------- assignee: docs at python components: Documentation messages: 397495 nosy: John M. Boger, docs at python priority: normal severity: normal status: open title: [sqlite3] Confusing typo "transation" versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 12:54:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 16:54:58 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626281698.21.0.550384409522.issue44635@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset b81cac05606c84958b52ada09f690463a3c7e949 by Serhiy Storchaka in branch 'main': bpo-44635: Convert None to NoneType in the union type constructor (GH-27136) https://github.com/python/cpython/commit/b81cac05606c84958b52ada09f690463a3c7e949 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:01:01 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 14 Jul 2021 17:01:01 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626282061.14.0.0659649997665.issue44635@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25683 pull_request: https://github.com/python/cpython/pull/27141 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:01:33 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 17:01:33 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626282093.26.0.795336521032.issue44635@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25684 pull_request: https://github.com/python/cpython/pull/27142 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:09:24 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 17:09:24 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626282564.24.0.457528300718.issue44632@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25685 pull_request: https://github.com/python/cpython/pull/27143 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:09:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 14 Jul 2021 17:09:18 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626282558.75.0.666523185505.issue44632@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a158b20019b50e3ece6e4743ec4e6ae8d818b690 by Serhiy Storchaka in branch 'main': bpo-44632: Fix support of TypeVar in the union type (GH-27139) https://github.com/python/cpython/commit/a158b20019b50e3ece6e4743ec4e6ae8d818b690 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:38:00 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 17:38:00 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626284280.33.0.432572710215.issue44589@roundup.psfhosted.org> Jack DeVries added the comment: @brandtbucher, I'm sorry for the miscommunication. I started working on this patch at the beginning of the week after message 397215... I'm a new contributor too, and I wasn't sure if I would be able to make something that worked, so I just kept my mouth shut. Then, all of a sudden, it came together and I had a (mostly) working patch. I'm going to incorporate your review now; thank you for the feedback, and I'm very sorry for any toes I may have stepped on. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:40:20 2021 From: report at bugs.python.org (wyz23x2) Date: Wed, 14 Jul 2021 17:40:20 +0000 Subject: [issue44640] Typos in error messages of isinstance() & issubclass() Message-ID: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> New submission from wyz23x2 : >>> isinstance(2, 1) Traceback (most recent call last): ... TypeError: isinstance() arg 2 must be a type, a tuple of types or a union >>> issubclass(int, 1) Traceback (most recent call last): .. TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union. 1) It should be "an union", not "a union". 2) The punctuation marks aren't the same -- there's a comma before "or" in issubclass, but not isinstance(). And issubclass()'s ends with a period, which isn't the same with other builtins' messages. ---------- components: Interpreter Core messages: 397499 nosy: wyz23x2 priority: normal severity: normal status: open title: Typos in error messages of isinstance() & issubclass() type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:44:15 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Wed, 14 Jul 2021 17:44:15 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626284655.53.0.637746021757.issue44616@roundup.psfhosted.org> Barry A. Warsaw added the comment: I just retested my test case (see the coveragepy link below) with Python 3.10 git head and coveragepy git head, and I'm still seeing the misses only in Python 3.10: ---------- coverage: platform darwin, python 3.10.0-beta-4 ----------- Name Stmts Miss Branch BrPart Cover Missing --------------------------------------------------------------------- flufl/lock/__init__.py 5 0 0 0 100% flufl/lock/_lockfile.py 253 0 80 3 99% 412->415, 418->420, 535->exit --------------------------------------------------------------------- The lines in question: if is_locked: try: os.unlink(self._lockfile) except OSError as error: if error.errno not in ERRORS: raise # Remove our claim file. try: os.unlink(self._claimfile) except OSError as error: if error.errno not in ERRORS: raise I'm not sure whether coveragepy needs to be updated or whether there are other lurking bugs in Python 3.10. I'm reopening this issue until this is resolved. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 13:51:16 2021 From: report at bugs.python.org (wyz23x2) Date: Wed, 14 Jul 2021 17:51:16 +0000 Subject: [issue44640] Typos in error messages of isinstance() & issubclass() In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1626285076.11.0.759404495849.issue44640@roundup.psfhosted.org> Change by wyz23x2 : ---------- keywords: +patch pull_requests: +25686 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27144 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:13:25 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 18:13:25 +0000 Subject: [issue44640] Typos in error messages of isinstance() & issubclass() In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1626286405.57.0.749764865902.issue44640@roundup.psfhosted.org> Jack DeVries added the comment: The current string is correct. The word "union" is actually an exception to the "a/an" rule. Here is more detail: https://english.stackexchange.com/questions/266309/why-is-union-an-exception-to-the-a-an-rule ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:19:46 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 14 Jul 2021 18:19:46 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626286786.04.0.524055773511.issue44639@roundup.psfhosted.org> Change by Zachary Ware : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:19:34 2021 From: report at bugs.python.org (wyz23x2) Date: Wed, 14 Jul 2021 18:19:34 +0000 Subject: [issue44640] Typos in error messages of isinstance() & issubclass() In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1626286774.11.0.898183326222.issue44640@roundup.psfhosted.org> wyz23x2 added the comment: Changed to only 2). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:20:18 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 18:20:18 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626286818.14.0.460937980254.issue44639@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch nosy: +jack__d nosy_count: 3.0 -> 4.0 pull_requests: +25687 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27145 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:20:53 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 18:20:53 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626286853.83.0.00939622065243.issue44639@roundup.psfhosted.org> Jack DeVries added the comment: To my understanding, it's supposed to say "transaction". The source code is here: https://github.com/python/cpython/blob/a158b20019b50e3ece6e4743ec4e6ae8d818b690/Modules/_sqlite/connection.c#L1434-L1467 I've opened a PR to fix the typo. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 14:39:43 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 14 Jul 2021 18:39:43 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1626287983.38.0.72497980657.issue44473@roundup.psfhosted.org> Jack DeVries added the comment: I have another question about the docstring in the source beneath logging.handlers.QueueHandler.prepare. It says: > The object returned by this method is enqueued. But, the prepare method doesn't do the enqueuing operation, it just prepares the record and returns it back, so it seems like this statement is not accurate? ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 16:10:51 2021 From: report at bugs.python.org (Aaron Meurer) Date: Wed, 14 Jul 2021 20:10:51 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626293451.74.0.209012919897.issue44603@roundup.psfhosted.org> Aaron Meurer added the comment: When talking about making exit only work when typed at the interpreter, something to consider is the confusion that it can cause when there is a mismatch between the interactive interpreter and noninteractive execution, especially for novice users. I've seen beginner users add exit() to the bottom of Python scripts, presumably because the interpreter "taught" them that you have to end with that. Now imagine someone trying to use exit as part of control flow if input("exit now? ") == "yes": exit Unless exit is a full blown keyword, that won't work. And the result is yet another instance in the language where users become confused if they run across it, because it isn't actually consistent in the language model. There are already pseudo-keywords in the language, in particular, super(), but that's used to implement something which would be impossible otherwise. Exiting is not impossible otherwise, it just requires typing (). But that's how everything in the language works. I would argue it's a good thing to reinforce the idea that typing a variable by itself with no other surrounding syntax does nothing. This helps new users create the correct model of the language in their heads. ---------- nosy: +asmeurer _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 16:17:19 2021 From: report at bugs.python.org (neonene) Date: Wed, 14 Jul 2021 20:17:19 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1626293839.26.0.552790349694.issue44479@roundup.psfhosted.org> Change by neonene : ---------- nosy: +neonene nosy_count: 7.0 -> 8.0 pull_requests: +25688 pull_request: https://github.com/python/cpython/pull/27146 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 16:18:50 2021 From: report at bugs.python.org (neonene) Date: Wed, 14 Jul 2021 20:18:50 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1626293930.91.0.160589222809.issue44479@roundup.psfhosted.org> neonene added the comment: When building, some pull-requests invoke regeneration of test_frozenmain.h. On PGO mode, MSVC tries to call instrumented python and stops with "pgort140.dll not found" error. Would it be OK to run python in externals folder instead ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 16:54:53 2021 From: report at bugs.python.org (Mark Dickinson) Date: Wed, 14 Jul 2021 20:54:53 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626296093.59.0.48322222195.issue44603@roundup.psfhosted.org> Mark Dickinson added the comment: > the confusion that it can cause when there is a mismatch between the interactive interpreter and noninteractive execution I've witnessed similar confusion when teaching, using IPython. After discovering that you can do In [1]: import pandas as pd In [2]: cd datafiles /Users/mdickinson/Desktop/datafiles In [3]: df = pd.read_csv("experiment0023.csv") it's then a common error to copy those lines to a script and expect them to work. We learned to recommend that IPython's automagic always be turned off, so that at least we could easily explain that "if it starts with a %, it's a magic command interpreted by the IPython layer; otherwise it's passed to Python". If Python grew a similar interpreter layer (which seems like one possible solution here), I think we'd have the same issue of making it easy for users to distinguish "commands" intended for the interactive interpreter from those interpreted by the Python core. I could imagine ending up with users typing "%exit" or "!exit" to exit, but one you're adding an extra sigil to distinguish your commands from plain old references to Python objects it doesn't seem so different from having to type "exit()". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 17:10:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 14 Jul 2021 21:10:59 +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: <1626297059.17.0.563329095148.issue44517@roundup.psfhosted.org> Erlend E. Aasland added the comment: The AMD64 Fedora Stable 3.x buildbot has not been red for one week. Closing this now. Victor/Pablo, please reopen if you disagree. ---------- resolution: -> not a bug stage: -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 17:40:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 21:40:04 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626298804.42.0.510492998218.issue44639@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25689 pull_request: https://github.com/python/cpython/pull/27148 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 17:40:10 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 21:40:10 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626298810.27.0.781636427236.issue44639@roundup.psfhosted.org> miss-islington added the comment: New changeset 1ca27f264730abaaa48b3c5e7c6eafb45017b824 by Jack DeVries in branch 'main': bpo-44639: fix typo in sqlite.rst (transation => transaction) (GH-27145) https://github.com/python/cpython/commit/1ca27f264730abaaa48b3c5e7c6eafb45017b824 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 17:40:10 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 21:40:10 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626298810.71.0.40708171977.issue44639@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25690 pull_request: https://github.com/python/cpython/pull/27149 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 17:55:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 21:55:53 +0000 Subject: [issue44617] Undesired Behavior on `match` using Singleton object In-Reply-To: <1626147288.08.0.390931510004.issue44617@roundup.psfhosted.org> Message-ID: <1626299753.97.0.63874457287.issue44617@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:01:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 14 Jul 2021 22:01:06 +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: <1626300066.91.0.779971185258.issue20752@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:09:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:09:29 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626300569.98.0.853942031923.issue44626@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:09:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:09:53 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626300593.51.0.401741537041.issue44622@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:10:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:10:13 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626300613.34.0.465733691986.issue44622@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Marking as a release blocker. Mark, please take a look at your earliest convenience ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:22:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:22:59 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626301379.05.0.123605035217.issue44639@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3048b8bd2a5c62b9c65ff4cf75399c7e732acdea by Miss Islington (bot) in branch '3.10': bpo-44639: fix typo in sqlite.rst (transation => transaction) (GH-27145) (GH-27148) https://github.com/python/cpython/commit/3048b8bd2a5c62b9c65ff4cf75399c7e732acdea ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:39:41 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 14 Jul 2021 22:39:41 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626293451.74.0.209012919897.issue44603@roundup.psfhosted.org> Message-ID: <20210714223729.GP13804@ando.pearwood.info> Steven D'Aprano added the comment: On Wed, Jul 14, 2021 at 08:10:51PM +0000, Aaron Meurer wrote: > There are already pseudo-keywords in the language, in particular, > super() super is not a pseudo-keyword. It's a regular builtin object that interacts with some (quite clever) compiler magic that occurs when classes are created. https://stackoverflow.com/questions/19608134/why-is-python-3-xs-super-magic The big difference here is that the magic behind super helps to prevent serious bugs in user code. super's magic isn't to reduce typing, it is to solve a number of real problems with the way people use inheritence. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:49:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:49:46 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626302986.04.0.847037859618.issue44639@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 421b543311c2eee67482bba894e475a2696423d5 by Miss Islington (bot) in branch '3.9': bpo-44639: fix typo in sqlite.rst (transation => transaction) (GH-27145) (GH-27149) https://github.com/python/cpython/commit/421b543311c2eee67482bba894e475a2696423d5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:51:23 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 14 Jul 2021 22:51:23 +0000 Subject: [issue44639] [sqlite3] Confusing typo "transation" In-Reply-To: <1626281588.36.0.0767264749964.issue44639@roundup.psfhosted.org> Message-ID: <1626303083.91.0.871884454244.issue44639@roundup.psfhosted.org> Erlend E. Aasland added the comment: Thanks John, for the report, and Jack, for the fix! ---------- nosy: +erlendaasland resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:53:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:53:22 +0000 Subject: [issue34932] Add macOS TCP_KEEPALIVE to available socket options In-Reply-To: <1539005890.42.0.545547206417.issue34932@psf.upfronthosting.co.za> Message-ID: <1626303202.5.0.96223579441.issue34932@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset d59d7374a364c4e5c2b9a83d8e4543ee494285b8 by Shane Harvey in branch 'main': bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079) https://github.com/python/cpython/commit/d59d7374a364c4e5c2b9a83d8e4543ee494285b8 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:53:24 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 22:53:24 +0000 Subject: [issue34932] Add macOS TCP_KEEPALIVE to available socket options In-Reply-To: <1539005890.42.0.545547206417.issue34932@psf.upfronthosting.co.za> Message-ID: <1626303204.25.0.0560467026089.issue34932@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25691 pull_request: https://github.com/python/cpython/pull/27153 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 18:54:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 14 Jul 2021 22:54:49 +0000 Subject: [issue34932] Add macOS TCP_KEEPALIVE to available socket options In-Reply-To: <1539005890.42.0.545547206417.issue34932@psf.upfronthosting.co.za> Message-ID: <1626303289.45.0.708719409162.issue34932@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 19:06:15 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 14 Jul 2021 23:06:15 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1626303975.57.0.278445426518.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25692 pull_request: https://github.com/python/cpython/pull/27155 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 19:13:09 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 14 Jul 2021 23:13:09 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626304389.65.0.0454061376448.issue44603@roundup.psfhosted.org> Gregory P. Smith added the comment: Thanks Mark, that's a good real world experience example from the IPython side. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 19:15:40 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 14 Jul 2021 23:15:40 +0000 Subject: [issue34932] Add macOS TCP_KEEPALIVE to available socket options In-Reply-To: <1539005890.42.0.545547206417.issue34932@psf.upfronthosting.co.za> Message-ID: <1626304540.03.0.632689676425.issue34932@roundup.psfhosted.org> miss-islington added the comment: New changeset ff7af2203c1f03d9300e93e3e06a47fb78cc2bef by Miss Islington (bot) in branch '3.10': bpo-34932: Add socket.TCP_KEEPALIVE for macOS (GH-25079) https://github.com/python/cpython/commit/ff7af2203c1f03d9300e93e3e06a47fb78cc2bef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:02:28 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 15 Jul 2021 00:02:28 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1626307348.36.0.0668995001043.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25693 pull_request: https://github.com/python/cpython/pull/27156 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:06:53 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 00:06:53 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1626307613.96.0.724326373704.issue44473@roundup.psfhosted.org> miss-islington added the comment: New changeset 3b8075f9076490508567f0fb3dc689861544d1a8 by Vinay Sajip in branch 'main': bpo-44473: Update docstring and documentation for QueueHandler.prepar? (GH-27140) https://github.com/python/cpython/commit/3b8075f9076490508567f0fb3dc689861544d1a8 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:38:57 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 15 Jul 2021 00:38:57 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626309537.16.0.7978719685.issue44589@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 2693132292b2acf381ac6fa729bf3acf41d9d72b by Jack DeVries in branch 'main': bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) https://github.com/python/cpython/commit/2693132292b2acf381ac6fa729bf3acf41d9d72b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:38:51 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 00:38:51 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626309531.89.0.479174349605.issue44589@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25694 pull_request: https://github.com/python/cpython/pull/27157 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:43:44 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 15 Jul 2021 00:43:44 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626309824.49.0.0508213205722.issue44638@roundup.psfhosted.org> Jack DeVries added the comment: I'm not able to reproduce this on my machine; the script runs without any issue. > the `TestClass` instance is being closed What do you mean by this statement? You aren't doing anything to TestClass or its instance ("test") in this script. They remain in scope, so they will always be referenced. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:48:25 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 15 Jul 2021 00:48:25 +0000 Subject: [issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback Message-ID: <1626310105.09.0.713528558818.issue44641@roundup.psfhosted.org> New submission from Erlend E. Aasland : pysqlite_collation_callback() currently uses the variable argument function PyObject_CallFunctionObjArgs(). Suggesting micro-optimise this by using PyObject_Vectorcall instead. ---------- components: Extension Modules messages: 397521 nosy: erlendaasland priority: normal severity: normal status: open title: [sqlite3] Use vectorcall in pysqlite_collation_callback type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 20:50:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 15 Jul 2021 00:50:20 +0000 Subject: [issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback In-Reply-To: <1626310105.09.0.713528558818.issue44641@roundup.psfhosted.org> Message-ID: <1626310220.99.0.957457768354.issue44641@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25695 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27158 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 14 21:00:54 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 01:00:54 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626310854.05.0.905108312333.issue44589@roundup.psfhosted.org> miss-islington added the comment: New changeset 016af14d93cfba43e7a95721a97fa954c534af8e by Miss Islington (bot) in branch '3.10': [3.10] bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) (GH-27157) https://github.com/python/cpython/commit/016af14d93cfba43e7a95721a97fa954c534af8e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 00:01:41 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 15 Jul 2021 04:01:41 +0000 Subject: [issue38210] Intersection of dict view with iterator returns empty set In-Reply-To: <1568790606.98.0.898790756289.issue38210@roundup.psfhosted.org> Message-ID: <1626321701.3.0.0810785235431.issue38210@roundup.psfhosted.org> Dong-hee Na added the comment: >Interestingly, this doesn't seem to have a negative effect on correctness as the silently omitted unhashable I think so too. The error actually raises when adding the object into the set. https://github.com/python/cpython/blob/818628c2da99ba0376313971816d472c65c9a9fc/Objects/dictobject.c#L4384 Since the target object to be added is dynamically generated, I think that the issue does not need to be fixed. Otherwise, we have to check that all objects are addable to `set` object before executing this operation but it looks harmful to performance. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:11:29 2021 From: report at bugs.python.org (Christian Steinmeyer) Date: Thu, 15 Jul 2021 07:11:29 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626333089.19.0.702509166897.issue44638@roundup.psfhosted.org> Christian Steinmeyer added the comment: I work on macOS 11.4 (20F71) (Kernel Version: Darwin 20.5.0). My python version is 3.8.9 and zipp is at 3.5.0 (but 3.4.1 behaves the same for me). For me, this is behavior is reproducible. Let me try to clarify what I mean. test = TestClass(root) # this creates a zipfile handle (an instance of zipfile.ZipFile) at test.zip_file files = test.iter_dir() # this creates multiple instances of zipfile.Path() as part of the list comprehension and these are deferenced afterwards. I found that test.zip_file.fp is closed after this line executes, which to me suggests that the closing of the zipfile.Path also closes the zipfile.ZipFile that was used to create the zipfile.Path. test.read(files[0]) # this should in theory try to read from the test.zip_file for the first time, but fails because it is closed as per the above. Here is the full stack trace: Traceback (most recent call last): File "test.py", line 20, in test.read(files[0]) File "test.py", line 12, in read with self.zip_file.open(filename) as file: File "/usr/local/opt/python at 3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/zipfile.py", line 1530, in open fheader = zef_file.read(sizeFileHeader) File "/usr/local/opt/python at 3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/zipfile.py", line 763, in read self._file.seek(self._pos) ValueError: seek of closed file ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:15:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:15:28 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626333328.87.0.0802165804123.issue44635@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 6dec5255829a31826990ea40ca106cc496570df2 by Serhiy Storchaka in branch '3.10': [3.10] bpo-44635: Convert None to NoneType in the union type constructor (GH-27136). (GH-27142) https://github.com/python/cpython/commit/6dec5255829a31826990ea40ca106cc496570df2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:15:55 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:15:55 +0000 Subject: [issue44635] Convert None to NoneType in the union type constructor In-Reply-To: <1626259917.98.0.435705646715.issue44635@roundup.psfhosted.org> Message-ID: <1626333355.48.0.217556956593.issue44635@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:25:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:25:40 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626333940.58.0.637541678709.issue44632@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset cc1a47c849a206441c9b370b6ca954862a523082 by Miss Islington (bot) in branch '3.10': bpo-44632: Fix support of TypeVar in the union type (GH-27139) (GH-27143) https://github.com/python/cpython/commit/cc1a47c849a206441c9b370b6ca954862a523082 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:26:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:26:44 +0000 Subject: [issue44632] Union with TypeVar does not work as intended In-Reply-To: <1626240804.32.0.699620622244.issue44632@roundup.psfhosted.org> Message-ID: <1626334004.92.0.858171522485.issue44632@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:44:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:44:41 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626335081.1.0.845689141134.issue44636@roundup.psfhosted.org> Serhiy Storchaka added the comment: Simple example (without indexing): >>> import typing >>> typing.Union[int, int] >>> int | int int ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 03:58:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 07:58:18 +0000 Subject: [issue44642] Union of a type and the typing module function Message-ID: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> New submission from Serhiy Storchaka : The union type accepts any function from the typing module: >>> import typing >>> int | typing.cast int | typing.cast >>> int | typing.get_type_hints int | typing.get_type_hints It is a consequence of too lenient check for the typing.NewType() result (which does not work at all with PR 9951). ---------- components: Interpreter Core messages: 397528 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Union of a type and the typing module function versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 04:11:45 2021 From: report at bugs.python.org (Baptiste) Date: Thu, 15 Jul 2021 08:11:45 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626336705.49.0.801368644073.issue44637@roundup.psfhosted.org> Baptiste added the comment: Thanks David, Here is some other tests I ran Issuing: - msg['Reply-To'] = '"foo Research Inc Foofoo BarBar on Summer Special Friday 050 days (2021-02-31" ' - msg['Reply-To'] = '"foo Research Inc Foofoo BarBar on Summer Special Friday 050 days 20210231 " ' But: msg['Reply-To'] = '"foo Research Inc Foofoo BarBar on Summer Special Friday 050 days 20210231 " ' worked. It looks more related to the length of the name than the character used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 04:25:05 2021 From: report at bugs.python.org (Art) Date: Thu, 15 Jul 2021 08:25:05 +0000 Subject: [issue44604] [Enhancement] Asyncio task decorator to provide interface to define async DAGs (similar to dask's delayed interface) In-Reply-To: <1626059754.28.0.00554951175924.issue44604@roundup.psfhosted.org> Message-ID: <1626337505.94.0.841521403482.issue44604@roundup.psfhosted.org> Art added the comment: FYI - I've added created a new pypi project for this called `aiodag`. pip install aiodag Github here: https://github.com/aa1371/aiodag Pypi here: https://pypi.org/project/aiodag/ I would appreciate it if you could find some time take a look just at the readme on the github page and provide any thoughts. I still think that this would be a good fit for asyncio directly. But if still not convinced is there any conditions under which you could see this project eventually being folded into the library? Thanks for your time in reviewing this issue ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 04:30:05 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 15 Jul 2021 08:30:05 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ Message-ID: <1626337805.62.0.910568399953.issue44643@roundup.psfhosted.org> New submission from Patrick Reader : When a frame's __builtins__ is a subclass of dict with an overridden __getitem__ method, this overriden method is not used by the IMPORT_NAME instruction to lookup __import__ in the dictionary; it uses the lookup function of normal dictionaries (via _PyDict_GetItemIdWithError). This is contrary to the behaviour of the similar LOAD_BUILD_CLASS, as well as the typical name lookup semantics of LOAD_GLOBAL/LOAD_NAME, which all use PyDict_CheckExact for a "fast path" before defaulting to PyObject_GetItem, which is not the behaviour I expected. Perhaps more seriously, if __builtins__ is not a dict at all, then it gets erroneously passed to some internal dict functions resulting in a mysterious SystemError ("Objects/dictobject.c:1440: bad argument to internal function") which, to me, indicates fragile behaviour that isn't supposed to happen. Could this be changed, so that __builtins__ is used dynamically? I understand this is a highly specific use case and changing it would probably cause a bit of a slow-down in module importing so is perhaps not worth doing, but I've posted this issue to track it anyway. I cannot find evidence that this behaviour has changed at all in recent history and it seems to be the same on the main branch as in 3.9.6. Per a brief discussion with Brett Cannon on python-dev (https://mail.python.org/archives/list/python-dev at python.org/thread/ZQMF6XC76J4APJPB3X6PGATG6CV5NN44/), I have labelled this a feature request because it has never really been expected behaviour. A short demo of these things is attached. Links to relevant CPython code in v3.9.6: IMPORT_NAME: https://github.com/python/cpython/blob/v3.9.6/Python/ceval.c#L5179 BUILD_CLASS: https://github.com/python/cpython/blob/v3.9.6/Python/ceval.c#L2316 LOAD_NAME: https://github.com/python/cpython/blob/v3.9.6/Python/ceval.c#L2488 LOAD_GLOBAL: https://github.com/python/cpython/blob/v3.9.6/Python/ceval.c#L2546 ---------- components: Interpreter Core files: dict_lookup_demo.py messages: 397531 nosy: brett.cannon, pxeger priority: normal severity: normal status: open title: importing does not dispatch to __builtins__.__getitem__ to lookup __import__ type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 Added file: https://bugs.python.org/file50151/dict_lookup_demo.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 04:35:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 15 Jul 2021 08:35:25 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ In-Reply-To: <1626337805.62.0.910568399953.issue44643@roundup.psfhosted.org> Message-ID: <1626338125.84.0.596078003061.issue44643@roundup.psfhosted.org> Steven D'Aprano added the comment: Isn't `__builtins__` a private CPython feature? Other implementations may not have it or use it, and it is my understanding that we should not touch it. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 05:00:50 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 09:00:50 +0000 Subject: [issue44581] Interpreter can execute quickened opcodes in tracing mode In-Reply-To: <1625668317.03.0.495409770321.issue44581@roundup.psfhosted.org> Message-ID: <1626339650.68.0.326426207091.issue44581@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 Jul 15 06:09:39 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 10:09:39 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1626343779.54.0.770577224649.issue43948@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25696 pull_request: https://github.com/python/cpython/pull/27159 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:12:43 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 10:12:43 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626343963.54.0.466340042814.issue44622@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25697 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27160 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:24:34 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 15 Jul 2021 10:24:34 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ In-Reply-To: <1626337805.62.0.910568399953.issue44643@roundup.psfhosted.org> Message-ID: <1626344674.31.0.279446529761.issue44643@roundup.psfhosted.org> Patrick Reader added the comment: It may be, but in that case, why do LOAD_BUILD_CLASS and things still use it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:44:02 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 15 Jul 2021 10:44:02 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ In-Reply-To: <1626337805.62.0.910568399953.issue44643@roundup.psfhosted.org> Message-ID: <1626345842.04.0.872411047676.issue44643@roundup.psfhosted.org> Patrick Reader added the comment: Similarly, when passing a subclass of dict to exec or eval as the locals or globals, all other instructions dispatch to the correct __getitem__ method. I'm pretty sure that's not CPython-private ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:45:29 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Thu, 15 Jul 2021 10:45:29 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ In-Reply-To: <1626344674.31.0.279446529761.issue44643@roundup.psfhosted.org> Message-ID: <20210715104315.GR13804@ando.pearwood.info> Steven D'Aprano added the comment: On Thu, Jul 15, 2021 at 10:24:34AM +0000, Patrick Reader wrote: > It may be, but in that case, why do LOAD_BUILD_CLASS and things still use it? They're allowed to use CPython implementation details because they are part of the CPython implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:51:35 2021 From: report at bugs.python.org (Patrick Reader) Date: Thu, 15 Jul 2021 10:51:35 +0000 Subject: [issue44643] importing does not dispatch to __builtins__.__getitem__ to lookup __import__ In-Reply-To: <1626337805.62.0.910568399953.issue44643@roundup.psfhosted.org> Message-ID: <1626346295.07.0.842621525094.issue44643@roundup.psfhosted.org> Patrick Reader added the comment: Ok what I meant was, why does constructing a class use it when it looks up __build_class__ then? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:53:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 10:53:29 +0000 Subject: [issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives In-Reply-To: <1609452860.68.0.697253388073.issue42799@roundup.psfhosted.org> Message-ID: <1626346409.95.0.764327854253.issue42799@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b39eea06d148887dd91a3612febafbddda760593 by andrei kulakov in branch 'main': bpo-42799: fnmatch module: bump up size of lru_cache for patterns (GH-27084) https://github.com/python/cpython/commit/b39eea06d148887dd91a3612febafbddda760593 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:53:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 10:53:50 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626346430.55.0.844165140009.issue42073@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 06:54:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 10:54:22 +0000 Subject: [issue42799] Please document fnmatch LRU cache size (256) and suggest alternatives In-Reply-To: <1609452860.68.0.697253388073.issue42799@roundup.psfhosted.org> Message-ID: <1626346462.31.0.930300324997.issue42799@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 07:28:59 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 15 Jul 2021 11:28:59 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1626348539.6.0.214864203321.issue44473@roundup.psfhosted.org> Vinay Sajip added the comment: > But, the prepare method doesn't do the enqueuing operation, it just prepares the record and returns it back, so it seems like this statement is not accurate? It merely states what happens to the return value. It doesn't say it has already been enqueued. If you look at the entire documentation for the class (rather than just individual sentences) I don't think the way the class works is unclear. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 07:28:53 2021 From: report at bugs.python.org (Hasan) Date: Thu, 15 Jul 2021 11:28:53 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626348533.32.0.178515138111.issue42095@roundup.psfhosted.org> Change by Hasan : ---------- nosy: +zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:01:23 2021 From: report at bugs.python.org (Thomas Grainger) Date: Thu, 15 Jul 2021 12:01:23 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1626350483.53.0.35857950076.issue44070@roundup.psfhosted.org> Thomas Grainger added the comment: hello, just chiming in to let you know that this broke CI on twisted: https://github.com/twisted/twisted/pull/1628/ (As above for Chalice, I think this didn't actually break the framework itself, just the tests for the framework. ) do you know what the correct usage of importlib.util.spec_from_file_location is to match importlib.import_module ? I have a tree like this: . ??? mypkg ??? demo.py ??? __init__.py ??? __pycache__ ??? __init__.cpython-38.pyc ??? __init__.cpython-39.pyc 2 directories, 4 files but I'm not sure how to get a spec for ./mypkg/demo.py: Python 3.9.6 (default, Jul 3 2021, 16:40:50) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages'] >>> import os >>> os.getcwd() '/home/graingert/projects/syspath-tests' >>> import importlib.util >>> importlib.util.spec_from_file_location(name="mypkg.demo", location="mypkg/demo.py") ModuleSpec(name='mypkg.demo', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94644bfd0>, origin='mypkg/demo.py') >>> import mypkg.demo >>> mypkg.demo.__spec__ ModuleSpec(name='mypkg.demo', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7fc94645a160>, origin='/home/graingert/projects/syspath-tests/mypkg/demo.py') >>> ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:05:20 2021 From: report at bugs.python.org (origin400-p) Date: Thu, 15 Jul 2021 12:05:20 +0000 Subject: =?utf-8?q?=5Bissue44644=5D_Implement_=E2=80=9CHappy_Eyeballs=E2=80=9D_alg?= =?utf-8?q?orithim_=28RFC_8503=29_in_socket=2Ecreate=5Fconnection=28=29?= Message-ID: <1626350720.92.0.994422492637.issue44644@roundup.psfhosted.org> New submission from origin400-p : While support for the so-called ?Happy Eyeballs? algorithim described in RFC 8503 was implemented for asyncio in Issue #33530, socket's create_connection function remains left without it causing suboptimal performance in broken dual-stack environments. ---------- components: Library (Lib) messages: 397542 nosy: origin400-p priority: normal severity: normal status: open title: Implement ?Happy Eyeballs? algorithim (RFC 8503) in socket.create_connection() type: performance versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:13:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 12:13:15 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1626351195.94.0.766587997272.issue26280@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 641345d636320a6fca04a5271fa4c4c5ba3e5437 by Irit Katriel in branch 'main': bpo-26280: Port BINARY_SUBSCR to PEP 659 adaptive interpreter (GH-27043) https://github.com/python/cpython/commit/641345d636320a6fca04a5271fa4c4c5ba3e5437 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:23:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 15 Jul 2021 12:23:09 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1454518938.55.0.360626721568.issue26280@psf.upfronthosting.co.za> Message-ID: <1626351789.34.0.744193543937.issue26280@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 Jul 15 08:31:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 12:31:19 +0000 Subject: [issue43948] sysconfig's osx_framework_user puts headers in different locations from distutils In-Reply-To: <1619510005.78.0.165065669518.issue43948@roundup.psfhosted.org> Message-ID: <1626352279.75.0.562959906617.issue43948@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:35:42 2021 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Jul 2021 12:35:42 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626352542.56.0.585927029877.issue44637@roundup.psfhosted.org> R. David Murray added the comment: Forget what I said about my different error, I made a mistake running the test script. Interesting. If it is related to the length of the name, then the problem is most likely in the folding algorithm, specifically in what happens when the "display-name" token is wrapped across lines. And indeed, if we clone the SMTP policy and set the max_line_len to 1000 in your sample script. it renders the header correctly. The problem here is that the surrounding quotation marks are added by the 'value' property of DisplayName, but that property isn't invoked when handling parts of the display name separately during mulit-line folding. I was always bothered by the handling of the quotation marks in the part of the parser and folder dealing with quoted strings, but I never hit on a better way to do it. This, unfortunately, is going to be non-trivial problem to solve. It is probably going to require an ugly hack in the folding code :( Really, the handling of quoted strings throughout the _header_value_parser code is...a hack :( There are probably other places where it breaks down during multi-line folding. If we are lucky the hack can just add special handling for the quoted-string token type in the folder. If we aren't it will get messier :( Glancing at the folder code (it's been a long time since I worked on it), one possible approach (not necessarily the best one) would be to mark the first and last sub-tokens in a quoted-string so that folder knows to put in a leading or trailing quote mark, respectively, during folding. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 08:46:38 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 15 Jul 2021 12:46:38 +0000 Subject: [issue31791] Ensure that all PyTypeObject fields are set to non-NULL defaults In-Reply-To: <1508048549.34.0.213398074469.issue31791@psf.upfronthosting.co.za> Message-ID: <1626353198.97.0.150641251032.issue31791@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:15:28 2021 From: report at bugs.python.org (Julien Castiaux) Date: Thu, 15 Jul 2021 13:15:28 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626354928.25.0.0501595431544.issue44637@roundup.psfhosted.org> Julien Castiaux added the comment: Hello David, I'm working in the same company as Baptiste and I'm trying to solve the problem. The issue is indeed related to the folding algorithm, the DBQUOTE character is lost in the parse_tree AST thus when the folding algo split the children to find a sweat spot to split the line it doesn't re-introduce the DBQUOTE and instead inject the content of the BareQuotedString right away. I'm working on a fix which consist of adding two DBQUOTE, one at the beginning and one at the end, of the BareQuotedString token when it is created (_header_value_parser.py at get_bare_quoted_string()). I was inspired by how the angles < and > are injected around the AddrSpec token in a AngleAddr token. Right now my fix isn't correct, there are some unittest falling. I'm trying to get it working and hopefully get back to you with a nice pull-request :) Regards, Julien ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:16:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 13:16:28 +0000 Subject: [issue19072] classmethod doesn't honour descriptor protocol of wrapped callable In-Reply-To: <1379856164.11.0.6368818134.issue19072@psf.upfronthosting.co.za> Message-ID: <1626354988.05.0.244148939721.issue19072@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b83861f0265e07207a6ae2c49c40fa8f447893f2 by ?ukasz Langa in branch 'main': bpo-42073: allow classmethod to wrap other classmethod-like descriptors (#27115) https://github.com/python/cpython/commit/b83861f0265e07207a6ae2c49c40fa8f447893f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:16:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 13:16:28 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626354988.18.0.0565281817647.issue42073@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b83861f0265e07207a6ae2c49c40fa8f447893f2 by ?ukasz Langa in branch 'main': bpo-42073: allow classmethod to wrap other classmethod-like descriptors (#27115) https://github.com/python/cpython/commit/b83861f0265e07207a6ae2c49c40fa8f447893f2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:19:06 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 13:19:06 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626355146.62.0.293290456031.issue42073@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25698 pull_request: https://github.com/python/cpython/pull/27162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:19:06 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 13:19:06 +0000 Subject: [issue19072] classmethod doesn't honour descriptor protocol of wrapped callable In-Reply-To: <1379856164.11.0.6368818134.issue19072@psf.upfronthosting.co.za> Message-ID: <1626355146.74.0.544231395733.issue19072@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25699 pull_request: https://github.com/python/cpython/pull/27162 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:19:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 13:19:55 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626355195.53.0.505696702381.issue42073@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:26:07 2021 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 15 Jul 2021 13:26:07 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released Message-ID: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> New submission from Jes?s Cea Avi?n : After https://github.com/python/cpython/pull/18334, a "while condition: pass" in a thread will preclude releasing the GIL, hanging the program with CPU at 100%. Trivial to reproduce: """ #!/usr/bin/env python3.10 import threading import time def worker(): while cont: pass def main(): global cont cont = True t = threading.Thread(target=worker) t.start() time.sleep(1) cont = False t.join() if __name__ == '__main__': main() """ ---------- keywords: 3.10regression messages: 397549 nosy: Mark.Shannon, jcea, pablogsal priority: release blocker severity: normal status: open title: Python 3.10: Under some trivial circunstances, GIL not released versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:27:01 2021 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 15 Jul 2021 13:27:01 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626355621.81.0.786728801083.issue44645@roundup.psfhosted.org> Change by Jes?s Cea Avi?n : ---------- components: +Interpreter Core stage: -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:31:22 2021 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Thu, 15 Jul 2021 13:31:22 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626355882.58.0.600080309369.issue44622@roundup.psfhosted.org> Change by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:38:04 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 13:38:04 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626356284.55.0.348598747256.issue44622@roundup.psfhosted.org> Mark Shannon added the comment: New changeset f333ab0f2edec26a769ed558263ac662e5475451 by Mark Shannon in branch 'main': bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160) https://github.com/python/cpython/commit/f333ab0f2edec26a769ed558263ac662e5475451 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:42:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 13:42:15 +0000 Subject: [issue19072] classmethod doesn't honour descriptor protocol of wrapped callable In-Reply-To: <1379856164.11.0.6368818134.issue19072@psf.upfronthosting.co.za> Message-ID: <1626356535.26.0.110146643324.issue19072@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2ce8af3cbcb368a35a05a5a9f97a09405124f239 by Miss Islington (bot) in branch '3.10': bpo-42073: allow classmethod to wrap other classmethod-like descriptors (GH-27115) (GH-27162) https://github.com/python/cpython/commit/2ce8af3cbcb368a35a05a5a9f97a09405124f239 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:42:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 13:42:15 +0000 Subject: [issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__ In-Reply-To: <1603052564.81.0.969263752847.issue42073@roundup.psfhosted.org> Message-ID: <1626356535.37.0.0436478373971.issue42073@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2ce8af3cbcb368a35a05a5a9f97a09405124f239 by Miss Islington (bot) in branch '3.10': bpo-42073: allow classmethod to wrap other classmethod-like descriptors (GH-27115) (GH-27162) https://github.com/python/cpython/commit/2ce8af3cbcb368a35a05a5a9f97a09405124f239 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 09:50:12 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 13:50:12 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626357012.76.0.947285534995.issue44622@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25700 pull_request: https://github.com/python/cpython/pull/27163 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:07:59 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 14:07:59 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626358079.58.0.0315611449183.issue44184@roundup.psfhosted.org> Thomas Wouters added the comment: Reopening this issue, as there is another branch (for non-GC heaptypes) earlier in subtype_dealloc that I believe suffers from the same problem. Actually triggering the error in a test has been difficult because as far as I can tell it relies on garbage collection at the right time, but reading the code it seems clear it's problematic. I'll prepare a PR to fix it there. I'm also reopening this issue because I believe it should've been backported to 3.9, and possibly 3.8 (if it's considered a security problem to get python to read and write freed memory). I found this issue in 3.9 while debugging a pybind11 crash. I'll backport after the other PR is in (or rejected). ---------- nosy: +twouters resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:11:19 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 14:11:19 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626358279.97.0.0519423305536.issue44184@roundup.psfhosted.org> Change by Thomas Wouters : ---------- pull_requests: +25701 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27165 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:12:33 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 14:12:33 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626358353.24.0.14185854396.issue44645@roundup.psfhosted.org> Mark Shannon added the comment: https://github.com/python/cpython/pull/18334 assumes that since all loops will contain a backwards edge, checking for interrupts on JUMP_ABSOLUTE should be sufficient. However, https://github.com/python/cpython/pull/23743 changed the back edges in while statements. So `worker` compiles to: 2 0 LOAD_GLOBAL 0 (cont) 2 POP_JUMP_IF_FALSE 7 (to 14) 3 >> 4 NOP 2 6 LOAD_GLOBAL 0 (cont) 8 POP_JUMP_IF_TRUE 2 (to 4) 10 LOAD_CONST 0 (None) 12 RETURN_VALUE >> 14 LOAD_CONST 0 (None) 16 RETURN_VALUE which has no CALL or JUMP_ABSOLUTE instructions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:48:35 2021 From: report at bugs.python.org (Julien Castiaux) Date: Thu, 15 Jul 2021 14:48:35 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626360515.45.0.201072932262.issue44637@roundup.psfhosted.org> Julien Castiaux added the comment: Update, it works fine with the compat32 policy ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:54:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 14:54:46 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626360886.62.0.0790258208587.issue44622@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 47695e3c88343e794d37333853b2ba3f16505c5d by Mark Shannon in branch '3.10': bpo-44622: Set line number of END_ASYNC_FOR to match that of iterator. (GH-27160) (GH-27163) https://github.com/python/cpython/commit/47695e3c88343e794d37333853b2ba3f16505c5d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 10:56:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 14:56:21 +0000 Subject: [issue44622] async-for loops are traced incorrectly in Python 3.10 In-Reply-To: <1626181431.87.0.924795967065.issue44622@roundup.psfhosted.org> Message-ID: <1626360981.49.0.825899234653.issue44622@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:11:26 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Jul 2021 15:11:26 +0000 Subject: [issue26280] ceval: Optimize list[int] (subscript) operation similarly to CPython 2.7 In-Reply-To: <1626351789.37.0.684222885006.issue26280@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Way to go Irit!-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:14:43 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Jul 2021 15:14:43 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1626362083.68.0.841134248479.issue44642@roundup.psfhosted.org> Guido van Rossum added the comment: Is it worth being picky about this? The internal data structures are safe. A static checker will complain. What more do you need? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:17:35 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Jul 2021 15:17:35 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626362255.22.0.813586451436.issue44636@roundup.psfhosted.org> Guido van Rossum added the comment: I feel that keeping the singleton is more consistent. This normalization seems to me an example of the typing module doing too much. Singleton tuples are different from scalar values too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:21:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 15:21:52 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626362512.49.0.897249563972.issue42958@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +25702 pull_request: https://github.com/python/cpython/pull/27166 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:22:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Jul 2021 15:22:09 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1626362529.42.0.704143601977.issue44605@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:22:26 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 15 Jul 2021 15:22:26 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1626362546.58.0.16045396735.issue44605@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:37:24 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 15:37:24 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626363444.72.0.506833859212.issue42958@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up the doc update PR here: https://github.com/python/cpython/pull/27166 I've also reviewed a few dozen SO questions about filecmp.cmp and shallow arg, many of them find the docs confusing or lacking, so I thought updating docs is definitely very useful. I haven't seen any of them asking for "force shallow" behavior, but there's many of them and I haven't read all; searching for "force shallow" doesn't find any. I think it might be useful to also add a new 'force shallow' arg, but I hope more people ask for it or compile a list of SO questions asking for it, otherwise it might not be worth additional complexity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:37:55 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 15 Jul 2021 15:37:55 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626363475.3.0.881118403422.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:42:10 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 15 Jul 2021 15:42:10 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626363730.84.0.600691392232.issue44645@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25703 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27167 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:45:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 15:45:58 +0000 Subject: [issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs In-Reply-To: <1611001488.57.0.420421194337.issue42958@roundup.psfhosted.org> Message-ID: <1626363958.36.0.515285751164.issue42958@roundup.psfhosted.org> Andrei Kulakov added the comment: Alexander: sorry, I didn't notice your PR because I was first working on a different issue, and then found this as a duplicate, and only noticed there's already an open PR here. If you prefer, we can close my PR and work on updating yours. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 11:49:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Jul 2021 15:49:28 +0000 Subject: [issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback In-Reply-To: <1626310105.09.0.713528558818.issue44641@roundup.psfhosted.org> Message-ID: <1626364168.3.0.707672185852.issue44641@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5007a4f23c551f8821483d15e76d0d15d5cb9945 by Erlend Egeberg Aasland in branch 'main': bpo-44641: Use vectorcall in sqlite3 collation callback (GH-27158) https://github.com/python/cpython/commit/5007a4f23c551f8821483d15e76d0d15d5cb9945 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:15:18 2021 From: report at bugs.python.org (R. David Murray) Date: Thu, 15 Jul 2021 16:15:18 +0000 Subject: [issue44637] Quoting issue on header Reply-To In-Reply-To: <1626266697.4.0.946779337742.issue44637@roundup.psfhosted.org> Message-ID: <1626365718.49.0.381274936355.issue44637@roundup.psfhosted.org> R. David Murray added the comment: Yes, compat32 uses a different parser and folder (the legacy ones), that have a lot of small bugs relative to the RFCs (which is why I rewrote it). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:20:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 16:20:01 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626366001.1.0.145924348937.issue44636@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a difference with typing.Union which can cause confusion. If the union type is like a tuple and we leave a 1-type union, why do we bother with deduplication? Why int | str | int is collapsed into int | str? Also it complicates the comparison implementation and produces surprising exceptions: >>> int | str == {} Traceback (most recent call last): File "", line 1, in TypeError: unhashable type: 'dict' Also it breaks one of fundamental properties -- equal objects should have equal hashes. >>> (int | int) == int True >>> hash(int | int) == hash(int) False ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:20:08 2021 From: report at bugs.python.org (Ned Batchelder) Date: Thu, 15 Jul 2021 16:20:08 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626366008.48.0.909214424285.issue44616@roundup.psfhosted.org> Ned Batchelder added the comment: Barry, is it possible you accidentally used the beta 4? I ran the test suite with a freshly built 3.10, but by mistake was still using the beta, and was surprised. Once I really got the latest build in place (Python 3.10.0b4+ (heads/3.10:47695e3c88, Jul 15 2021, 11:55:52)), I got these results: platform darwin -- Python 3.10.0b4+, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 cachedir: .tox/py310/.pytest_cache rootdir: /System/Volumes/Data/root/src/foo/bug1187/flufl.lock, configfile: setup.cfg, testpaths: test, docs plugins: cov-2.12.1 collected 108 items test/test_api.py . [ 0%] test/test_lock.py ........................... [ 25%] docs/using.rst ................................................................................ [100%] ======================================================================== warnings summary ========================================================================= .tox/py310/lib/python3.10/site-packages/sybil/integration/pytest.py:58: 80 warnings /System/Volumes/Data/root/src/foo/bug1187/flufl.lock/.tox/py310/lib/python3.10/site-packages/sybil/integration/pytest.py:58: PytestDeprecationWarning: A private pytest class or function was used. self._request = fixtures.FixtureRequest(self) -- Docs: https://docs.pytest.org/en/stable/warnings.html ---------- coverage: platform darwin, python 3.10.0-beta-4 ----------- Name Stmts Miss Branch BrPart Cover Missing --------------------------------------------------------------------- flufl/lock/__init__.py 5 0 0 0 100% flufl/lock/_lockfile.py 253 0 80 0 100% --------------------------------------------------------------------- TOTAL 258 0 80 0 100% Coverage XML written to file coverage.xml Required test coverage of 100.0% reached. Total coverage: 100.00% ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:22:42 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 15 Jul 2021 16:22:42 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626366162.3.0.414905044181.issue42095@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: Hasan, Please raise a PR on GitHub. ---------- nosy: +thatiparthy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:28:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 16:28:49 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality Message-ID: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> New submission from Serhiy Storchaka : There is a rule: equal hashable objects should have the same hash. The unity type violates it. >>> x = int | str >>> y = str | int >>> x == y True >>> hash(x) == hash(y) False And hashes of equal unity type and typing.Union are different too. >>> import typing >>> z = typing.Union[int, str] >>> x == z True >>> hash(x) == hash(z) False There is also a problem with a single type (see issue44636). ---------- components: Interpreter Core messages: 397567 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: hash() of the unity type is not consistent with equality type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:47:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Jul 2021 16:47:03 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626367623.99.0.425592336234.issue44626@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a86f7dae0acf918d54086cb85e5a0b0bedeedce7 by Mark Shannon in branch 'main': bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) https://github.com/python/cpython/commit/a86f7dae0acf918d54086cb85e5a0b0bedeedce7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:47:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 15 Jul 2021 16:47:27 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1626367647.84.0.0409964892759.issue44642@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is only reminder that our test for NewType is arbitrary. And it is not compatible with PR 9951. Possible solutions are: 1. Make NewType a class and add more strict test. Pro -- we can make arbitrary repr, contra -- it has small negative effect on performance. See issue34963. 2. Remove the test for NewType at all and allow or-ing types and arbitrary functions. 3. Introduce a special attribute to distinguish unionable objects. It will make the code of unionobject.c simpler. I lean towards option 1 (not excluding 3). Small performance losses seem inevitable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 12:56:07 2021 From: report at bugs.python.org (Ken Jin) Date: Thu, 15 Jul 2021 16:56:07 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1626368167.19.0.473009191604.issue44642@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy > 1. Make NewType a class and add more strict test. See also: issue44353 (https://bugs.python.org/issue44353). We had some discussion there about converting to class but it ended in a deadlock. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 13:11:48 2021 From: report at bugs.python.org (Barry A. Warsaw) Date: Thu, 15 Jul 2021 17:11:48 +0000 Subject: [issue44616] Incorrect tracing for "except" with variable In-Reply-To: <1626130299.77.0.916237528648.issue44616@roundup.psfhosted.org> Message-ID: <1626369108.36.0.493467295798.issue44616@roundup.psfhosted.org> Barry A. Warsaw added the comment: Thanks Ned. Seems you might be right. I thought I'd done a clean test, but in any event, I just pulled 3.10 head and verified that it's producing 100% coverage. Thanks all for the fix! ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 13:41:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 15 Jul 2021 17:41:04 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626370864.04.0.077853136578.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25704 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27168 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 13:50:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 17:50:20 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers Message-ID: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> New submission from ?ukasz Langa : GH-23638 introduced a new test for Accept: headers in CGI HTTP servers. This test serializes all of `os.environ` on the server side. For non-UTF8 locales this can fail for some Unicode characters found in environment variables. This started failing this week on Azure Pipelines with their rollout of a new Windows 2019 image version that included a "BUILD_SOURCEVERSIONAUTHOR" env variable. For me specifically it includes a leading Unicode character so all my PRs started failing on Azure Pipelines Windows 2019 alone. The result was truncated output from the CGI HTTP server, like: ====================================================================== FAIL: test_accept (test.test_httpservers.CGIHTTPServerTestCase) [OrderedDict([('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')])] ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\a\1\s\lib\test\test_httpservers.py", line 860, in test_accept self.assertIn(expected.encode('ascii'), res.read()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: b"'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'" not found in b'' The root cause is that the CGI script in question (`cgi_file6` in test_httpservers.py) is crashing on server-side reaching the `print(repr(os.environ))` line. However, this exception isn't visible on the client side where the test is running. The only visible issue is truncated output. I suggest adding ENSURE_UNICODE_WORKS=?ukasz to the testing env so that this never regresses. ---------- messages: 397572 nosy: lukasz.langa priority: normal severity: normal status: open title: Non-ASCII characters in os.environ cause silent failures in test_httpservers type: behavior versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 13:53:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 17:53:12 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626371592.18.0.49797166195.issue44647@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +25705 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27161 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 14:31:57 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 18:31:57 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626373917.53.0.262627819522.issue44648@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 14:31:38 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 18:31:38 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session Message-ID: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> New submission from Andrei Kulakov : [ins] In [63]: class A:pass [ins] In [64]: import inspect [ins] In [65]: inspect.getsource(A) [snip] /usr/local/Cellar/python at 3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/inspect.py in getfile(object) 664 if getattr(module, '__file__', None): 665 return module.__file__ --> 666 raise TypeError('{!r} is a built-in class'.format(object)) The error is 'X is a built-in class', instead it should be OSError, source code is not available. ---------- messages: 397573 nosy: andrei.avk priority: normal severity: normal status: open title: Inspect.getsource raises wrong error on classes in interactive session type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 14:47:39 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 15 Jul 2021 18:47:39 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626374859.84.0.837663298304.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: Thanks, that test framework looks good for this. My initial hunch (just from looking at this) is that this has to do with how we handle cleanup after failed matches. Our "fail pop" blocks probably have whatever the last line number compiled was (which I think is always the last line of the preceding case block). The fix *should* be as simple as calling "SET_LOC(c, whatever_the_last_pattern_was)" before compiling these blocks. I have some new-ish contributors who might want to take this. As far as compiler issues go, this one seems pretty straightforward. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:06:03 2021 From: report at bugs.python.org (Christodoulos Tsoulloftas) Date: Thu, 15 Jul 2021 19:06:03 +0000 Subject: [issue44649] dataclasses slots with init=False field raises AttributeException Message-ID: <1626375963.06.0.364448585924.issue44649@roundup.psfhosted.org> New submission from Christodoulos Tsoulloftas : I am trying the new slots directive but I get an AttributeError when I try to access a field with init=False >>> from dataclasses import dataclass, field >>> >>> @dataclass(slots=True) ... class Example: ... a: str ... b: str = field(default="b", init=False) ... >>> obj = Example("a") >>> obj.__slots__ ('a', 'b') >>> obj. obj.a obj.b >>> obj.a 'a' >>> obj.b Traceback (most recent call last): File "", line 1, in AttributeError: b. Did you mean: 'b'? >>> ? python --version Python 3.10.0b4+ ---------- components: Library (Lib) messages: 397575 nosy: tefra priority: normal severity: normal status: open title: dataclasses slots with init=False field raises AttributeException type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:08:47 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 15 Jul 2021 19:08:47 +0000 Subject: [issue44649] dataclasses slots with init=False field raises AttributeException In-Reply-To: <1626375963.06.0.364448585924.issue44649@roundup.psfhosted.org> Message-ID: <1626376127.11.0.0357381999328.issue44649@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:14:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 19:14:31 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626376471.78.0.660395832445.issue44647@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 82b218f36ce6ef910bda5af227a9fd5be613c94f by ?ukasz Langa in branch 'main': bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) https://github.com/python/cpython/commit/82b218f36ce6ef910bda5af227a9fd5be613c94f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:14:55 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 19:14:55 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626376495.95.0.298410396285.issue44647@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25707 pull_request: https://github.com/python/cpython/pull/27170 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:14:50 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 19:14:50 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626376490.4.0.6185809929.issue44647@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25706 pull_request: https://github.com/python/cpython/pull/27169 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 15:57:15 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 15 Jul 2021 19:57:15 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626379035.46.0.00429571203154.issue44636@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, you are right. Make it so, Mr. Spock! :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:09:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 20:09:36 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626379776.13.0.31946116503.issue44647@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 356bdff1e952f2ab7fdebae855bd78b401b735c4 by Miss Islington (bot) in branch '3.10': bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) (#27169) https://github.com/python/cpython/commit/356bdff1e952f2ab7fdebae855bd78b401b735c4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:09:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 20:09:59 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626379799.16.0.484283025442.issue44647@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 95596d5921eeab9ae49f0dc31263a249013b6849 by Miss Islington (bot) in branch '3.9': bpo-44647: Fix test_httpservers failing on Unicode characters in os.environ on Windows (GH-27161) (#27170) https://github.com/python/cpython/commit/95596d5921eeab9ae49f0dc31263a249013b6849 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:13:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 15 Jul 2021 20:13:07 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626379987.91.0.663072406517.issue44647@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:19:08 2021 From: report at bugs.python.org (Leonardo Freua) Date: Thu, 15 Jul 2021 20:19:08 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1626380348.78.0.512629299591.issue10572@roundup.psfhosted.org> Leonardo Freua added the comment: After so long a reason came up that prevents the movement of tests of ctypes, lib2to3, and idlelib (which even continues in the same folder, only the nomenclature was changed)? ---------- nosy: +Leonardofreua _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:39:48 2021 From: report at bugs.python.org (Leonardo Freua) Date: Thu, 15 Jul 2021 20:39:48 +0000 Subject: [issue44650] Move test_futures files* into a subdirectory of Lib/test Message-ID: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> New submission from Leonardo Freua : There are currently 6 files referring to __future__ tests, these are in the root directory Lib/test. It would be interesting to move them to a directory called Lib/test/test_future. This change could contribute to the organization of the tests that have already been discussed in other issues (e.g https://bugs.python.org/issue15907). I wait for the ok to send the PR. ---------- messages: 397581 nosy: Leonardofreua priority: normal severity: normal status: open title: Move test_futures files* into a subdirectory of Lib/test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:40:33 2021 From: report at bugs.python.org (Leonardo Freua) Date: Thu, 15 Jul 2021 20:40:33 +0000 Subject: [issue44650] Move test_futures files*.py into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626381633.24.0.524529377461.issue44650@roundup.psfhosted.org> Change by Leonardo Freua : ---------- title: Move test_futures files* into a subdirectory of Lib/test -> Move test_futures files*.py into a subdirectory of Lib/test _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:40:23 2021 From: report at bugs.python.org (Leonardo Freua) Date: Thu, 15 Jul 2021 20:40:23 +0000 Subject: [issue44650] Move test_futures files* into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626381623.65.0.405076718139.issue44650@roundup.psfhosted.org> Change by Leonardo Freua : ---------- components: +Library (Lib), Tests type: -> enhancement versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:43:41 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 15 Jul 2021 20:43:41 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626381821.59.0.629848710732.issue44648@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25708 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27171 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 16:44:29 2021 From: report at bugs.python.org (Leonardo Freua) Date: Thu, 15 Jul 2021 20:44:29 +0000 Subject: [issue44650] Move test_futures files*.py into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626381869.54.0.0972213991542.issue44650@roundup.psfhosted.org> Leonardo Freua added the comment: List of files: test_future.py test_future3.py test_future4.py test_future5.py Obs.: In fact there are 5 files, since the number 2 doesn't exist. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 17:05:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 15 Jul 2021 21:05:00 +0000 Subject: [issue44641] [sqlite3] Use vectorcall in pysqlite_collation_callback In-Reply-To: <1626310105.09.0.713528558818.issue44641@roundup.psfhosted.org> Message-ID: <1626383100.59.0.00508083537764.issue44641@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 Jul 15 17:12:06 2021 From: report at bugs.python.org (Pavel Moiseenko) Date: Thu, 15 Jul 2021 21:12:06 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626383526.33.0.312427748011.issue44634@roundup.psfhosted.org> Pavel Moiseenko added the comment: This does not cause any problems in the operation of the app, but visually it looks strange. Most other apps don't indicate the version of the app in the name of the app, but just indicate it in a specially made field for this. Therefore, it would be nice if your app followed this behavior. Perhaps these links will also be helpful: https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key, https://stackoverflow.com/questions/26156405/how-to-change-add-remove-program-name-using-wix-installer And can you tell me where the WiX config file is? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 17:18:56 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 15 Jul 2021 21:18:56 +0000 Subject: [issue34828] sqlite.iterdump does not work for (most) databases with autoincrement In-Reply-To: <1538117515.33.0.545547206417.issue34828@psf.upfronthosting.co.za> Message-ID: <1626383936.23.0.836044903419.issue34828@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 17:29:10 2021 From: report at bugs.python.org (Hasan) Date: Thu, 15 Jul 2021 21:29:10 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626384550.94.0.0132610595037.issue42095@roundup.psfhosted.org> Change by Hasan : ---------- pull_requests: +25709 pull_request: https://github.com/python/cpython/pull/27172 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 17:41:41 2021 From: report at bugs.python.org (Hasan) Date: Thu, 15 Jul 2021 21:41:41 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626385301.39.0.685915535243.issue42095@roundup.psfhosted.org> Change by Hasan : ---------- pull_requests: +25710 pull_request: https://github.com/python/cpython/pull/27173 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 18:41:05 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 22:41:05 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626388865.17.0.212615160573.issue44184@roundup.psfhosted.org> Thomas Wouters added the comment: New changeset 074e7659f208051b6b973f7fdb654dd22b93aaa2 by T. Wouters in branch 'main': bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc (GH-27165) https://github.com/python/cpython/commit/074e7659f208051b6b973f7fdb654dd22b93aaa2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 18:41:07 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 22:41:07 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626388867.87.0.877298105855.issue44184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25711 pull_request: https://github.com/python/cpython/pull/27174 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 18:41:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 22:41:13 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626388873.28.0.529352369576.issue44184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25712 pull_request: https://github.com/python/cpython/pull/27175 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 18:42:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 22:42:19 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626388939.98.0.551577775368.issue44184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25713 pull_request: https://github.com/python/cpython/pull/27176 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:18:41 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 23:18:41 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626391121.12.0.607843796857.issue44184@roundup.psfhosted.org> Thomas Wouters added the comment: New changeset 6aa59c68dc7910c0675ad23c1f9d88edfb81dfcb by Miss Islington (bot) in branch '3.10': bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc (GH-27165) (GH-27174) https://github.com/python/cpython/commit/6aa59c68dc7910c0675ad23c1f9d88edfb81dfcb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:29:42 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 23:29:42 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626391782.64.0.788171816883.issue44184@roundup.psfhosted.org> Thomas Wouters added the comment: Fix extended to the other branch (and backported to 3.10), and both parts backported to 3.9. I don't think it counts as a security issue, so not backporting to 3.8. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:29:54 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 23:29:54 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626391794.32.0.111402294456.issue44184@roundup.psfhosted.org> Change by Thomas Wouters : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:31:48 2021 From: report at bugs.python.org (Hasan) Date: Thu, 15 Jul 2021 23:31:48 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626391908.55.0.656349743001.issue42095@roundup.psfhosted.org> Change by Hasan : ---------- pull_requests: -25709 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:35:33 2021 From: report at bugs.python.org (Thomas Wouters) Date: Thu, 15 Jul 2021 23:35:33 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626392133.69.0.762310161059.issue44184@roundup.psfhosted.org> Thomas Wouters added the comment: New changeset 0b4704973dbef712d05bdd62349bb4244f545430 by Miss Islington (bot) in branch '3.9': bpo-44184: Apply GH-26274 to the non-GC-type branch of subtype_dealloc (GH-27165) (GH-27175) https://github.com/python/cpython/commit/0b4704973dbef712d05bdd62349bb4244f545430 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:36:59 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 15 Jul 2021 23:36:59 +0000 Subject: [issue44184] crash on windows invoking flake8 In-Reply-To: <1621481055.92.0.677600467741.issue44184@roundup.psfhosted.org> Message-ID: <1626392219.94.0.980385610293.issue44184@roundup.psfhosted.org> miss-islington added the comment: New changeset 298ee657ab8170adf75a186c0414b7ca3baf1991 by Miss Islington (bot) in branch '3.9': bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) https://github.com/python/cpython/commit/298ee657ab8170adf75a186c0414b7ca3baf1991 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 19:38:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 15 Jul 2021 23:38:19 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626392299.13.0.977206360786.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 919ad537510fdc2c750109e0bc4eceea234324b2 by Batuhan Taskaya in branch 'main': bpo-43950: make BinOp specializations more reliable (GH-27126) https://github.com/python/cpython/commit/919ad537510fdc2c750109e0bc4eceea234324b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 20:26:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 00:26:56 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626395216.36.0.651483357723.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: I was able to replicate the error using the script as posted: ``` draft $ cat > issue44638.py import zipfile class TestClass: def __init__(self, path): self.zip_file = zipfile.ZipFile(path) def iter_dir(self): return [each.name for each in zipfile.Path(self.zip_file).iterdir()] def read(self, filename): with self.zip_file.open(filename) as file: print(file.read()) root = "zipfile.zip" test = TestClass(root) files = test.iter_dir() test.read(files[0]) draft $ python -m zipfile -c zipfile.zip issue44638.py draft $ python issue44638.py Traceback (most recent call last): File "/Users/jaraco/draft/issue44638.py", line 18, in test.read(files[0]) File "/Users/jaraco/draft/issue44638.py", line 12, in read with self.zip_file.open(filename) as file: File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 1518, in open fheader = zef_file.read(sizeFileHeader) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 741, in read self._file.seek(self._pos) ValueError: seek of closed file ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 20:39:26 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 00:39:26 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626395966.31.0.829163660088.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: Here's a much simpler repro that avoids the class construction but triggers the same error: ``` import zipfile zip_file = zipfile.ZipFile('zipfile.zip') names = [each.name for each in zipfile.Path(zip_file).iterdir()] with zip_file.open(names[0]) as file: print(file.read()) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 20:40:57 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 00:40:57 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626396057.9.0.898159209445.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: Even simpler: ``` import zipfile zip_file = zipfile.ZipFile('zipfile.zip') names = [each.name for each in zipfile.Path(zip_file).iterdir()] zip_file.open(names[0]) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 20:55:55 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 00:55:55 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626396955.9.0.703331067879.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: This also reproduces the failure: ``` zip_file = zipfile.ZipFile('zipfile.zip') path = zipfile.Path(zip_file) name = zip_file.namelist()[0] del path zip_file.open(name) ``` Removing `del path` bypasses the issue. Something about the destructor for zipfile.Path is causing the closing of the handle for zip_file. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 21:00:15 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 01:00:15 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626397215.61.0.904126588658.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: Even simpler: ``` zip_file = zipfile.ZipFile('zipfile.zip') name = zip_file.namelist()[0] zipfile.Path(zip_file) zip_file.open(name) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 21:11:49 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 01:11:49 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626397909.46.0.914439089156.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: Changing the repro to: ``` import zipfile try: import zipp except ImportError: import zipfile as zipp zip_file = zipfile.ZipFile('zipfile.zip') name = zip_file.namelist()[0] zipp.Path(zip_file) zip_file.open(name) ``` I'm able now to test against zipfile or zipp. And I notice that the issue occurs only on zipp<3.2 or Python<3.10. ``` draft $ pip-run -q 'zipp<3.3' -- issue44638.py draft $ pip-run -q 'zipp<3.2' -- issue44638.py Traceback (most recent call last): File "/Users/jaraco/draft/issue44638.py", line 11, in zip_file.open(name) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 1518, in open fheader = zef_file.read(sizeFileHeader) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 741, in read self._file.seek(self._pos) ValueError: seek of closed file ``` ``` draft $ python3.10 issue44638.py draft $ python3.9 issue44638.py Traceback (most recent call last): File "/Users/jaraco/draft/issue44638.py", line 11, in zip_file.open(name) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 1518, in open fheader = zef_file.read(sizeFileHeader) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/zipfile.py", line 741, in read self._file.seek(self._pos) ValueError: seek of closed file ``` Looking at the changelog (https://zipp.readthedocs.io/en/latest/history.html#v3-2-0), it's clear now that this issue is a duplicate of bpo-40564 and the problem goes away using the original repro and Python 3.10: ``` draft $ cat > issue44638.py import zipfile class TestClass: def __init__(self, path): self.zip_file = zipfile.ZipFile(path) def iter_dir(self): return [each.name for each in zipfile.Path(self.zip_file).iterdir()] def read(self, filename): with self.zip_file.open(filename) as file: print(file.read()) root = "zipfile.zip" test = TestClass(root) files = test.iter_dir() test.read(files[0]) draft $ python3.10 issue44638.py b'import zipfile\n\n\nclass TestClass:\n def __init__(self, path):\n self.zip_file = zipfile.ZipFile(path)\n\n def iter_dir(self):\n return [each.name for each in zipfile.Path(self.zip_file).iterdir()]\n\n def read(self, filename):\n with self.zip_file.open(filename) as file:\n print(file.read())\n\nroot = "zipfile.zip"\ntest = TestClass(root)\nfiles = test.iter_dir()\ntest.read(files[0])\n' ``` The solution is to use zipp>=3.2 or Python 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 21:12:12 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 01:12:12 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626397932.25.0.917604820324.issue44638@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Using zipfile.Path with several files prematurely closes zip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 21:16:45 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 01:16:45 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626398205.95.0.764447195796.issue44638@roundup.psfhosted.org> Jason R. Coombs added the comment: > My python version is 3.8.9 and zipp is at 3.5.0 (but 3.4.1 behaves the same for me). It's not enough to have `zipp` 3.5.0. You need to use `zipp.Path` over `zipfile.Path`. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 15 23:51:40 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 16 Jul 2021 03:51:40 +0000 Subject: [issue44413] OverflowError: mktime argument out of range after 2019 In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org> Message-ID: <1626407500.58.0.909408764783.issue44413@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 01:11:26 2021 From: report at bugs.python.org (Steven Hsu) Date: Fri, 16 Jul 2021 05:11:26 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst Message-ID: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> New submission from Steven Hsu : In Doc/glossary.rst, the definition about "coercion" is as below: "The implicit conversion of an instance of one type to another during an operation which involves two arguments of the same type." However, in the example following this definition, it shows the arguments of "different" type in an adding operation, and one of them was converted to `float` for the operation. Therefore, we should fix the definition of the coercion to as below: "The implicit conversion of an instance of one type to another during an operation which involves two arguments of the different type." Or am I realize this sentence wrong? Thanks for review. https://github.com/python/cpython/blob/main/Doc/glossary.rst ---------- assignee: docs at python components: Documentation messages: 397597 nosy: StevenHsuYL, docs at python priority: normal severity: normal status: open title: An unclear definition in Doc/glossary.rst type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 01:12:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 05:12:59 +0000 Subject: [issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close() In-Reply-To: <1543348313.91.0.788709270274.issue35332@psf.upfronthosting.co.za> Message-ID: <1626412379.05.0.761404947394.issue35332@roundup.psfhosted.org> Andrei Kulakov added the comment: I've looked a bit into this and it seems like ESTALE can be caused in two cases: - Under WPAR environment https://www.ibm.com/docs/en/aix/7.1?topic=aix-wpar-concepts https://www.ibm.com/support/pages/apar/IV50544 > When using WPAR setup under AIX, with each WPAR configured as an NFS client, it is possible that asynchronous READDIR operations fail with ESTALE error - http://www.audentia-gestion.fr/IBM/PDF/basetrf2_pdf.pdf ESTALE. The process's root or current directory is located in a virtual file system that has been unmounted. In the first case, the solution given is to run READDIR under a different CID. I've found the definition of CID just 10 minutes ago but now can't find it again :(. Anyway, it seems to be an ID corresponding to the WPAR environment. In the 2nd case, it's pretty clear that we shouldn't silence it: if you unmount a virtual partition while running rmtree on it, I'm 99.9% sure it was unintended! In the first case, I don't think Python has any specific support for WPAR? Maybe? If not, we shouldn't do anything, if yes, maybe it can be fixed to handle this. It sounds like Ronal may have ran into the first case, or something else entirely. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 01:13:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 05:13:34 +0000 Subject: [issue35332] shutil.rmtree(..., ignore_errors=True) doesn't ignore errors from os.close() In-Reply-To: <1543348313.91.0.788709270274.issue35332@psf.upfronthosting.co.za> Message-ID: <1626412414.55.0.580331637252.issue35332@roundup.psfhosted.org> Andrei Kulakov added the comment: May be related: https://bugs.python.org/issue43666 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 01:40:38 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 05:40:38 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626414038.98.0.111740308356.issue44651@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 01:52:53 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Fri, 16 Jul 2021 05:52:53 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626414773.12.0.341478453792.issue44646@roundup.psfhosted.org> Change by Jelle Zijlstra : ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 02:09:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 16 Jul 2021 06:09:56 +0000 Subject: [issue44413] OverflowError: mktime argument out of range after 2019 In-Reply-To: <1623607333.16.0.709856027198.issue44413@roundup.psfhosted.org> Message-ID: <1626415796.93.0.641467053238.issue44413@roundup.psfhosted.org> Terry J. Reedy added the comment: The posted code is incomplete, improperly indented, and a bit jumbled with respect to prompts. If the bug is real, it should be possible to reproduce without pytz. I do not have it on either Windows or macOS. Vyacheslav, can you post a better failing example? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 02:31:27 2021 From: report at bugs.python.org (hongweipeng) Date: Fri, 16 Jul 2021 06:31:27 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626417087.98.0.638618025697.issue40897@roundup.psfhosted.org> Change by hongweipeng : ---------- pull_requests: +25714 pull_request: https://github.com/python/cpython/pull/27177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 02:44:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 06:44:18 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626417858.22.0.121075956148.issue44636@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25715 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27178 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 03:01:22 2021 From: report at bugs.python.org (Christian Steinmeyer) Date: Fri, 16 Jul 2021 07:01:22 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626418882.95.0.0343830953852.issue44638@roundup.psfhosted.org> Christian Steinmeyer added the comment: Thank you for the in depth look Jason! Especially that last comment was very useful to me. Perhaps it would make sense to add something like this to the documentation of zipfile. I'm not sure what would be the best hint, but perhaps in zipfile.Path's documentation a hint that zipp.Path can be used to access newer functionality even for older python versions (if what I understand is correct) might be useful to others as well. Because as of now, I cannot find an equivalent hint yet. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 03:05:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 07:05:27 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626419127.93.0.405968466437.issue44646@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25716 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27179 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 03:37:49 2021 From: report at bugs.python.org (Paul Moore) Date: Fri, 16 Jul 2021 07:37:49 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626421069.62.0.068758452945.issue44634@roundup.psfhosted.org> Paul Moore added the comment: In "Apps and Features" on Windows 10, the application name is shown by default but not the version. I have 3 different versions of Python installed on my PC and if they all reported as "Python" it would be a lot harder to manage them (I'd have to click on each one to check the version before I knew which one to select) -1 on removing the version from the application name. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 04:35:31 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 08:35:31 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626424531.17.0.583204222061.issue44646@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset aeaa553d650786afc6e68df1f4813ae1a5b71d05 by Serhiy Storchaka in branch 'main': bpo-44646: Fix the hash of the union type. (#27179) https://github.com/python/cpython/commit/aeaa553d650786afc6e68df1f4813ae1a5b71d05 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 04:35:46 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 08:35:46 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626424546.1.0.00756192970001.issue44646@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25717 pull_request: https://github.com/python/cpython/pull/27180 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 04:47:11 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 16 Jul 2021 08:47:11 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626425231.73.0.654504170231.issue44648@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:03:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 09:03:16 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626426196.2.0.391210991746.issue44646@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 705988056e028bab3dbc5cff3671a8ddefc88ec7 by Miss Islington (bot) in branch '3.10': bpo-44646: Fix the hash of the union type. (GH-27179) (#27180) https://github.com/python/cpython/commit/705988056e028bab3dbc5cff3671a8ddefc88ec7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:03:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 09:03:39 +0000 Subject: [issue44646] hash() of the unity type is not consistent with equality In-Reply-To: <1626366529.09.0.940643989656.issue44646@roundup.psfhosted.org> Message-ID: <1626426219.13.0.128764141172.issue44646@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:18:03 2021 From: report at bugs.python.org (Pavel Moiseenko) Date: Fri, 16 Jul 2021 09:18:03 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626427083.42.0.30657087953.issue44634@roundup.psfhosted.org> Pavel Moiseenko added the comment: @paul.moore, but you don't need to open additional menus in the control panel to see the version of the app. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:25:23 2021 From: report at bugs.python.org (hongweipeng) Date: Fri, 16 Jul 2021 09:25:23 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626427523.1.0.22619079792.issue40897@roundup.psfhosted.org> hongweipeng added the comment: >>> from datetime import timedelta as a >>> from _datetime import timedelta as b >>> a is b True >>> `timedelta` is a C-level class, so inspect.signature(timedelta) is the same with inspect.signature(int). But `signature` allow C-level function such as `inspect.signature(len)`, I think one way to improve is to use the C-level function when the python-level function cannot be found. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:28:35 2021 From: report at bugs.python.org (Paul Moore) Date: Fri, 16 Jul 2021 09:28:35 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626427715.97.0.735529041699.issue44634@roundup.psfhosted.org> Paul Moore added the comment: See the attached screenshot. Only the app name is visible by default. I see no benefit to the change and a definite usability degradation for people like me with multiple Python versions. ---------- Added file: https://bugs.python.org/file50152/Apps and Features.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:49:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 09:49:40 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626428980.71.0.0708710216706.issue44636@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset d9f923280f204204f8703756aef4f655b579b4b8 by Serhiy Storchaka in branch 'main': bpo-44636: Collapse union of equal types (GH-27178) https://github.com/python/cpython/commit/d9f923280f204204f8703756aef4f655b579b4b8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:52:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 09:52:46 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626429166.26.0.909520105232.issue44636@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25718 pull_request: https://github.com/python/cpython/pull/27181 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:53:45 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 16 Jul 2021 09:53:45 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626429225.89.0.661502691327.issue44626@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25719 pull_request: https://github.com/python/cpython/pull/27182 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 05:59:35 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 16 Jul 2021 09:59:35 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626429575.18.0.675838147579.issue44645@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 000e70ad5246732fcbd27cf59268185cbd5ad734 by Mark Shannon in branch 'main': bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) https://github.com/python/cpython/commit/000e70ad5246732fcbd27cf59268185cbd5ad734 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 06:05:54 2021 From: report at bugs.python.org (Mark Shannon) Date: Fri, 16 Jul 2021 10:05:54 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626429954.59.0.483603861758.issue44645@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25720 pull_request: https://github.com/python/cpython/pull/27183 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 06:49:00 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 10:49:00 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626432540.26.0.296456752683.issue44645@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 Jul 16 06:48:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 10:48:50 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626432530.9.0.576271311494.issue44645@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0e349ea5541104c76cafc173bfcfef8de872f96f by Mark Shannon in branch '3.10': [3.10] bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167) (GH-27183) https://github.com/python/cpython/commit/0e349ea5541104c76cafc173bfcfef8de872f96f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 06:49:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 10:49:14 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626432554.21.0.452331930404.issue44626@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 37686f78ccef5f1cf4776419a4270cf0ea7eadf0 by Mark Shannon in branch '3.10': bpo-44626: Merge basic blocks earlier to enable better handling of exit blocks without line numbers (GH-27138) (GH-27182) https://github.com/python/cpython/commit/37686f78ccef5f1cf4776419a4270cf0ea7eadf0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 06:49:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 10:49:20 +0000 Subject: [issue44626] Incorrect tracing of nested if/if/for/yield In-Reply-To: <1626200586.64.0.370955870537.issue44626@roundup.psfhosted.org> Message-ID: <1626432560.74.0.722447464244.issue44626@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 Jul 16 06:52:08 2021 From: report at bugs.python.org (wyz23x2) Date: Fri, 16 Jul 2021 10:52:08 +0000 Subject: [issue44640] Fix punctuation in isinstance() error message In-Reply-To: <1626284420.22.0.865096690123.issue44640@roundup.psfhosted.org> Message-ID: <1626432728.89.0.448737531443.issue44640@roundup.psfhosted.org> Change by wyz23x2 : ---------- title: Typos in error messages of isinstance() & issubclass() -> Fix punctuation in isinstance() error message _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 06:59:48 2021 From: report at bugs.python.org (hongweipeng) Date: Fri, 16 Jul 2021 10:59:48 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626433188.55.0.198039503605.issue44618@roundup.psfhosted.org> Change by hongweipeng : ---------- keywords: +patch nosy: +hongweipeng nosy_count: 2.0 -> 3.0 pull_requests: +25721 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27177 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:07:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 11:07:49 +0000 Subject: [issue44652] Preserve natural order of args in the union type Message-ID: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are two issues related to the order of __args__ in typing.Union and the union type. 1. Indexing typing.Union preserves the order of arguments, but it is not always true when use the | operator. >>> A = typing.NewType('A', str) >>> typing.Union[typing.List[int], A] typing.Union[typing.List[int], A] >>> typing.Union[A, typing.List[int]] typing.Union[A, typing.List[int]] >>> typing.List[int] | A typing.Union[typing.List[int], A] >>> A | typing.List[int] typing.Union[typing.List[int], A] The cause is errors in __ror__ implementations. 2. There is a difference between deduplication algorithms for typing.Union and the union type. >>> typing.Union[int, str, int] typing.Union[int, str] >>> int | str | int str | int It is not particularly important, because the order of __args__ mostly affects only representation. But it is better to be consistent, and it is easy to fix these tiny issues. Note that it does not make the order of __args__ deterministic in all cases. Due to using caching for typing.Union it can be not always preserved if we merger typing.Union objects which differs only by order of arguments. >>> import typing >>> typing.Union[typing.Union[int, str], list] typing.Union[int, str, list] >>> typing.Union[typing.Union[str, int], list] typing.Union[int, str, list] ---------- components: Interpreter Core, Library (Lib) messages: 397612 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Preserve natural order of args in the union type type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:10:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 11:10:37 +0000 Subject: [issue44652] Preserve natural order of args in the union type In-Reply-To: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> Message-ID: <1626433837.99.0.00176272964697.issue44652@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25722 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27185 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:26:40 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Jul 2021 11:26:40 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1626434800.55.0.889453123188.issue15907@roundup.psfhosted.org> Irit Katriel added the comment: This kind of reorg was recently rejected in issue44573, while this issue being open inspired similar initiative (eg issue44650). For those reasons I am closing this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:27:07 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Jul 2021 11:27:07 +0000 Subject: [issue44650] Move test_futures files*.py into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626434827.74.0.0451209899254.issue44650@roundup.psfhosted.org> Irit Katriel added the comment: This kind of reorg was recently rejected in issue44573. ---------- nosy: +iritkatriel resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:26:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Jul 2021 11:26:53 +0000 Subject: [issue15907] move doctest test-data files into a subdirectory of Lib/test In-Reply-To: <1347296459.35.0.660655246065.issue15907@psf.upfronthosting.co.za> Message-ID: <1626434813.7.0.615487827706.issue15907@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:48:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 11:48:23 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626436103.7.0.370188096552.issue44636@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset c3007ab3c6cb384203bac8aa64d89c4b42f671a1 by Serhiy Storchaka in branch '3.10': [3.10] bpo-44636: Collapse union of equal types (GH-27178) (GH-27181) https://github.com/python/cpython/commit/c3007ab3c6cb384203bac8aa64d89c4b42f671a1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 07:49:32 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 11:49:32 +0000 Subject: [issue44636] It is possible to create a 1-type union type In-Reply-To: <1626260682.01.0.97762085111.issue44636@roundup.psfhosted.org> Message-ID: <1626436172.82.0.985454876879.issue44636@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 08:07:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 12:07:04 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626437224.29.0.446049888943.issue44647@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25723 pull_request: https://github.com/python/cpython/pull/27187 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 08:21:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 12:21:25 +0000 Subject: [issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary In-Reply-To: <1625503625.05.0.62837078116.issue44569@roundup.psfhosted.org> Message-ID: <1626438085.02.0.182954280707.issue44569@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 8ce3008585feed51bd08ec256a19923940d744d4 by Ammar Askar in branch 'main': bpo-44569: Decouple frame formatting in traceback.py (GH-27038) https://github.com/python/cpython/commit/8ce3008585feed51bd08ec256a19923940d744d4 ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 08:21:24 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 12:21:24 +0000 Subject: [issue44569] traceback.py: Allow customization of per-frame line formatting in StackSummary In-Reply-To: <1625503625.05.0.62837078116.issue44569@roundup.psfhosted.org> Message-ID: <1626438084.8.0.65408318469.issue44569@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 Jul 16 08:57:57 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 16 Jul 2021 12:57:57 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626440277.41.0.401049708392.issue44638@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25724 pull_request: https://github.com/python/cpython/pull/27188 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:04:58 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:04:58 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626440698.27.0.600496605091.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6aab5f9bf303a8e4cd8377fabcdcb499e0541f9a by Weipeng Hong in branch 'main': bpo-40897:Give priority to using the current class constructor in `inspect.signature` (#27177) https://github.com/python/cpython/commit/6aab5f9bf303a8e4cd8377fabcdcb499e0541f9a ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:05:19 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 13:05:19 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626440719.26.0.500865170042.issue40897@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +25725 pull_request: https://github.com/python/cpython/pull/27189 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:11:41 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 13:11:41 +0000 Subject: [issue44652] Preserve natural order of args in the union type In-Reply-To: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> Message-ID: <1626441101.37.0.711458717342.issue44652@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 0cd2d51aadcd2a0c0739a5df0a6235d64f35619e by Serhiy Storchaka in branch 'main': bpo-44652: Preserve natural order of args in the union type. (GH-27185) https://github.com/python/cpython/commit/0cd2d51aadcd2a0c0739a5df0a6235d64f35619e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:15:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 13:15:04 +0000 Subject: [issue44638] zipfile.ZipFile is closed when zipfile.Path is closed In-Reply-To: <1626274107.84.0.867808492454.issue44638@roundup.psfhosted.org> Message-ID: <1626441304.56.0.604046367414.issue44638@roundup.psfhosted.org> miss-islington added the comment: New changeset 29358e93f2bb60983271c14ce4c2f3eab35a60ca by Jason R. Coombs in branch 'main': bpo-44638: Add a reference to the zipp project and hint as to how to use it. (GH-27188) https://github.com/python/cpython/commit/29358e93f2bb60983271c14ce4c2f3eab35a60ca ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:14:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:14:54 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626441294.76.0.361695376142.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: We won't be backporting this fix to 3.9 due to larger changes between versions. ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:19:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 13:19:08 +0000 Subject: [issue44652] Preserve natural order of args in the union type In-Reply-To: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> Message-ID: <1626441548.48.0.379242127178.issue44652@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25726 pull_request: https://github.com/python/cpython/pull/27190 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:24:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:24:11 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626441851.34.0.605809512481.issue44647@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7915c96ffd7ddc5cb6d54015ee4c31255a416892 by ?ukasz Langa in branch 'main': bpo-44647: Add a permanent Unicode-valued env var to regrtest (#27187) https://github.com/python/cpython/commit/7915c96ffd7ddc5cb6d54015ee4c31255a416892 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:24:28 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 13:24:28 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626441868.46.0.346894664469.issue44647@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25727 pull_request: https://github.com/python/cpython/pull/27191 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:26:02 2021 From: report at bugs.python.org (Leonardo Freua) Date: Fri, 16 Jul 2021 13:26:02 +0000 Subject: [issue44650] Move test_futures files*.py into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626441962.0.0.771584199746.issue44650@roundup.psfhosted.org> Leonardo Freua added the comment: Definitely not the same kind of reorganization! In issue44573 what was proposed was the reorganization of the data files used in the tests. And what I'm proposing now is equivalent to what was proposed in issue15907 (and there it was accepted, there is even an open PR awaiting review.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:26:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:26:05 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626441965.98.0.207059830387.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 948e39a866ccf33b4e30668c3f88a95a65966159 by Miss Islington (bot) in branch '3.10': bpo-40897:Give priority to using the current class constructor in `inspect.signature` (GH-27177) (#27189) https://github.com/python/cpython/commit/948e39a866ccf33b4e30668c3f88a95a65966159 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:32:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 13:32:27 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union Message-ID: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> New submission from Serhiy Storchaka : >>> import typing >>> T = typing.TypeVar('T') >>> (int | T)[typing.Union[str, list]] NotImplemented See also issue44633. But in this case the expected result is int | str | list or typing.Union[init, str, list]. ---------- components: Interpreter Core messages: 397624 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Parameter substitution in the union type does not work with typing.Union type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:33:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 13:33:06 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626442386.57.0.146779826556.issue44633@roundup.psfhosted.org> Serhiy Storchaka added the comment: Expected raising a TypeError. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:33:50 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 13:33:50 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1607795510.65.0.341487246406.issue42626@roundup.psfhosted.org> Message-ID: <1626442430.35.0.841396255291.issue42626@roundup.psfhosted.org> Andrei Kulakov added the comment: I can't reproduce on MacOS in both Py 3.9.1 and in dev version. Works fine, I can erase everything after '2' and before it. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:40:41 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 16 Jul 2021 13:40:41 +0000 Subject: [issue44650] Move test_futures files*.py into a subdirectory of Lib/test In-Reply-To: <1626381588.34.0.911825284448.issue44650@roundup.psfhosted.org> Message-ID: <1626442841.32.0.752628448428.issue44650@roundup.psfhosted.org> Irit Katriel added the comment: A patch awaiting review since 2012 is not exactly the same as "the issue was accepted". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:42:12 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 13:42:12 +0000 Subject: [issue44652] Preserve natural order of args in the union type In-Reply-To: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> Message-ID: <1626442932.12.0.173407752553.issue44652@roundup.psfhosted.org> miss-islington added the comment: New changeset 80844d1ebc03e1cf3ffdeb47751522499e90b0bc by Serhiy Storchaka in branch '3.10': [3.10] bpo-44652: Preserve natural order of args in the union type. (GH-27185) (GH-27190) https://github.com/python/cpython/commit/80844d1ebc03e1cf3ffdeb47751522499e90b0bc ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:43:52 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 16 Jul 2021 13:43:52 +0000 Subject: [issue44652] Preserve natural order of args in the union type In-Reply-To: <1626433669.69.0.820300846858.issue44652@roundup.psfhosted.org> Message-ID: <1626443032.71.0.117198946362.issue44652@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:54:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:54:29 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626443669.33.0.530166307988.issue44648@roundup.psfhosted.org> ?ukasz Langa added the comment: Why do you think OSError fits here? Since objects provided on the command line by definition cannot have source code files, the problem isn't that the file is missing or inaccessible. Rather, the value provided to getsource() is wrong. So, in my view, this should rather be ValueError. Moreover, checking for __main__ is insufficient as there are __main__.py modules after all in many packages. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 09:55:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 13:55:33 +0000 Subject: [issue44647] Non-ASCII characters in os.environ cause silent failures in test_httpservers In-Reply-To: <1626371420.43.0.163040134112.issue44647@roundup.psfhosted.org> Message-ID: <1626443733.75.0.758194391299.issue44647@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 93d36a5bcec8e55026b9a749c8310b1ce490d15e by Miss Islington (bot) in branch '3.10': bpo-44647: Add a permanent Unicode-valued env var to regrtest (GH-27187) (#27191) https://github.com/python/cpython/commit/93d36a5bcec8e55026b9a749c8310b1ce490d15e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 10:55:37 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 14:55:37 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626447337.94.0.551438288852.issue44648@roundup.psfhosted.org> Andrei Kulakov added the comment: ?ukasz: Thanks for looking at this! - I agree OSError is not ideal, but I chose it because it's consistent with how inspect reports similar errors. For example, see all instances of OSError, except for first, in this function: https://github.com/python/cpython/blob/7915c96ffd7ddc5cb6d54015ee4c31255a416892/Lib/inspect.py#L930 I think it's an implementation detail that class source is not available on interactive prompt, for example function source is available via `inspect.getsource()`. If a user can do getsource(func) and getsource(cls) in a file, and getsource(func) on interactive prompt, it seems wrong to return a ValueError when the user is trying to getsource(cls) in interactive. I'm open to change it to ValueError though because I think the err message here is more important to avoid user confusion. - good point about __main__.py files, I didn't remember about them. However they will have the __file__ attribute set, so they will return that right above the check for '__main__' in my patch. I tested it to make sure: import inspect class A: 0 print(inspect.getsource(A)) ./python.exe ~/temp/__main__.py class A: 0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:13:51 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 16 Jul 2021 15:13:51 +0000 Subject: [issue44642] Union of a type and the typing module function In-Reply-To: <1626335898.92.0.441498587725.issue44642@roundup.psfhosted.org> Message-ID: <1626448431.5.0.321498243597.issue44642@roundup.psfhosted.org> Guido van Rossum added the comment: I think making NewType into a class isn't a good idea, it would be too slow. But I like issue34963 (PR 9951). So then let's do some variation on (3) -- unionable things would include all types (of course), typevars, and things that have a special attribute. We could then set that special attribute on the function returned by NewType (like PR 9951 already does for __name__ and __qualname__). What to call it? Maybe "__unionable__"? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:16:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 15:16:11 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626448571.6.0.492420215713.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: On second thought it's a bummer not to fix this in 3.9.x that will still be the only stable version until October. I'll refactor the relevant part of inspect.py in 3.9 to make the backport applicable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:16:39 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 15:16:39 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626448599.63.0.73539927807.issue44648@roundup.psfhosted.org> Andrei Kulakov added the comment: I'm not sure though how is the unit test succeeding since the test module should have __file__ set. Looking into it.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:24:47 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 15:24:47 +0000 Subject: [issue44654] Refactor and clean up the union type implementation Message-ID: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> New submission from Serhiy Storchaka : I started reviewing and rewriting Objects/unionobject.c several weeks ago. Some discovered bugs were reported and fixed in separate issues: issue44606, issue44632, issue44635, issue44636, issue44646, issue44652. Before fixing the remaining bugs (issue44633, issue44642, issue44653) I want to merge some minor changes: * Rename _Py_UnionType to _PyUnion_Type. It is how PyTypeObject instances are named. * Add _PyUnion_Check() and _PyGenericAlias_Check(). It simplified the code. * Do not expose _Py_Union(). It is only used locally. * Move declarations of _Py_make_parameters and _Py_subs_parameters from genericaliasobject.h to internal/pycore_unionobject.h. They are for internal use only. * Fix a possible leak in dedup_and_flatten_args(). * Significantly simplify union_richcompare(). The Python implementation can be used for comparing types.Union with typing.Union. * Perform cheaper tests before more expensive tests in is_unionable(). * Optimize __module__ look up in is_typing_module() and support types without __module__. * Fix outdated comments. * Minor style fixes. * Extract related tests to separate class. * Make some tests more accurate: they should test for TypeError only specific operators, not constructors. I am going to backport these changes to 3.10 to make backporting of future fixes easier. ---------- components: Interpreter Core messages: 397635 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Refactor and clean up the union type implementation versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:25:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 15:25:14 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626449114.32.0.947574553824.issue40897@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25728 pull_request: https://github.com/python/cpython/pull/27193 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:38:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 15:38:40 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1626449920.51.0.483987683952.issue44648@roundup.psfhosted.org> Andrei Kulakov added the comment: This is kind of interesting: - The unit test was wrong, it was catching the wrong OSError. (I was catching regex first but after some tweaking and changes I lost it and forgot to readd) - The reason it was passing is exactly what you pointed out -- the __main__.py in `unittest` package. After I change the class' module to __main__ in the test, it starts looking at sys.modules['__main__'] which is the one in unittest, which doesn't have this class, which causes the inspect to throw another OSError. - I fixed the unit test by both checking for error regex and patching sys.modules['__main__'] (and of course restoring it later). Thanks for helping to catch this :-) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:42:07 2021 From: report at bugs.python.org (Ken Jin) Date: Fri, 16 Jul 2021 15:42:07 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626450127.26.0.991814301918.issue44654@roundup.psfhosted.org> Ken Jin added the comment: > I am going to backport these changes to 3.10 to make backporting of future fixes easier. > * Move declarations of _Py_make_parameters and _Py_subs_parameters ... Unfortunately, _Py_make_parameters and _Py_subs_parameters are 3.11 only. They were part of https://github.com/python/cpython/pull/26980. And we couldn't backport it to 3.10 (please see the PR thread). Maybe we can ask Pablo to reconsider for addition in 3.10rc1 if we can get a core dev to approve that? > * Perform cheaper tests before more expensive tests in is_unionable(). > * Optimize __module__ look up in is_typing_module(). Yeah I noticed it re-lookups __module__ unnecessarily multiple times for the same type. I tried fixing this a month ago (and also convert to interned PyId strings) but for some reason microbenchmarks didn't show much gain. Things may be different after you clean things up. > * Extract related tests to separate class. Yes please :). Maybe even a separate file altogether. GenericAlias has its own test_genericalias. A big +1 on everything else. They were bugging me for a while but I didn't have the time to fix them. Thanks for taking this up Serhiy :)! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:43:13 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 16 Jul 2021 15:43:13 +0000 Subject: [issue20201] Argument Clinic: rwbuffer support broken In-Reply-To: <1389242396.52.0.166931579233.issue20201@psf.upfronthosting.co.za> Message-ID: <1626450193.76.0.583860841986.issue20201@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 9af34c935185eca497617a216d141c72ffaeae9c by Batuhan Taskaya in branch 'main': bpo-20201: variadic arguments support for AC (GH-18609) https://github.com/python/cpython/commit/9af34c935185eca497617a216d141c72ffaeae9c ---------- nosy: +BTaskaya _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 11:50:23 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 16 Jul 2021 15:50:23 +0000 Subject: [issue20201] Argument Clinic: rwbuffer support broken In-Reply-To: <1389242396.52.0.166931579233.issue20201@psf.upfronthosting.co.za> Message-ID: <1626450623.6.0.206988023518.issue20201@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- Removed message: https://bugs.python.org/msg397638 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:03:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 16 Jul 2021 16:03:16 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626451396.77.0.849244554394.issue44654@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:27:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 16:27:20 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626452840.9.0.779439309866.issue44645@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR 27167 hangs or fails. in the refleak buildbots, so I am going to proceed to revert ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:29:40 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 16:29:40 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626452980.44.0.556247624605.issue44645@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25729 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27194 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:31:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 16:31:50 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626453110.18.0.978660401476.issue44645@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: To reproduce the problem: ./python -m test test_threading -R : - ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:32:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 16:32:19 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626453139.08.0.92554457362.issue44645@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- Removed message: https://bugs.python.org/msg397640 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 12:33:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 16:33:20 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626453200.72.0.648107746952.issue44645@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: To reproduce the problem: $./python -m test test_threading -R : -v ... test_original_excepthook (test.test_threading.ExceptHookTests) ... ok test_system_exit (test.test_threading.ExceptHookTests) ... ok test_can_interrupt_tight_loops (test.test_threading.InterruptMainTests) ... (HANGS here or some time fails like in: ====================================================================== FAIL: test_can_interrupt_tight_loops (test.test_threading.InterruptMainTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/buildarea/pull_request.cstratak-RHEL7-ppc64le.refleak/build/Lib/test/support/threading_helper.py", line 62, in decorator return func(*args) ^^^^^^^^^^^ File "/home/buildbot/buildarea/pull_request.cstratak-RHEL7-ppc64le.refleak/build/Lib/test/test_threading.py", line 1630, in test_can_interrupt_tight_loops self.assertNotEqual(iterations, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: 0 == 0 ---------------------------------------------------------------------- https://buildbot.python.org/all/#/builders/411/builds/92 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 13:05:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 17:05:54 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626455154.61.0.260253578973.issue44645@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c90c591e5158ab7b531dcd6e2a5f00bc70ba7637 by Pablo Galindo Salgado in branch 'main': Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (#27194) https://github.com/python/cpython/commit/c90c591e5158ab7b531dcd6e2a5f00bc70ba7637 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 13:05:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 17:05:57 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626455157.31.0.438975078044.issue44645@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25730 pull_request: https://github.com/python/cpython/pull/27195 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 13:19:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 17:19:20 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626455960.54.0.38770931495.issue44654@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25731 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27196 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 13:30:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 16 Jul 2021 17:30:04 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626456604.77.0.917634767665.issue44645@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 42a5514cca6b4542f6b492b5652e337f15a89227 by Miss Islington (bot) in branch '3.10': Revert "bpo-44645: Check for interrupts on any potentially backwards edge. (GH-27167)" (GH-27194) (#27195) https://github.com/python/cpython/commit/42a5514cca6b4542f6b492b5652e337f15a89227 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 13:32:03 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 16 Jul 2021 17:32:03 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626456723.37.0.550086249638.issue44654@roundup.psfhosted.org> Serhiy Storchaka added the comment: > Yeah I noticed it re-lookups __module__ unnecessarily multiple times for the same type. Actually I thought about this change, but did not implement it. Because it does not look performance critical, and future versions will likely do different tests (for example, testing the existence of special attribute, or check against lazily imported and cached classes from the typing module). Also, the test for TypeVar can be shared between genericaliasobject.c and unionobject.c. It is mostly simple clean up, a line here, two lines there. genericaliasobject.c and unionobject.c could be merged in a single file, because they share several functions not used anywhere more. We perhaps merge them if more C implementations for typing be added in future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:28:19 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Jul 2021 18:28:19 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626460099.2.0.735302572717.issue44651@roundup.psfhosted.org> Mark Dickinson added the comment: Agreed that "of the same type" part is confusing. I suspect the intended meaning was that the operation *expects* both arguments to have the same type, so if the actual arguments have different types then they have to be coerced to a common type. In the example you mention, the 3 is converted to 3.0 so that the actual addition is applied to two arguments of the same type. So I think the "same type" part *was* intentional, if confusing. But coercion was more of a real thing in Python 2, where there was a __coerce__ special method and a coerce builtin function. It isn't really a thing any more in Python 3, except inasmuch as it means "implicit type conversion". And I can't find any uses of :term:`coercion` elsewhere in the docs. Maybe we should just delete this glossary entry? If all we mean by coercion is implicit type conversion, then the "operation which involves two arguments" part already seems over-specific: math.sqrt implicitly converts its argument to a float, for example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:32:11 2021 From: report at bugs.python.org (Mark Dickinson) Date: Fri, 16 Jul 2021 18:32:11 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626460331.12.0.44854440157.issue44651@roundup.psfhosted.org> Mark Dickinson added the comment: Searching further, none of the uses of "coerce" or "coercion" in the docs seem to be a good match for the definition in this glossary entry. For example, from ipaddress.rst: > By default, attempting to create a network object with host bits set will result in :exc:`ValueError` being raised. To request that the additional bits instead be coerced to zero, the flag ``strict=False`` can be passed to the constructor and from configparser.rst: > A convenience method which coerces the *option* in the specified *section* to an integer. etc. I think we should just get rid of the glossary entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:35:23 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Jul 2021 18:35:23 +0000 Subject: [issue44631] Refactoring the repr() of the _Environ class (os module) In-Reply-To: <1626213867.27.0.881981550683.issue44631@roundup.psfhosted.org> Message-ID: <1626460523.7.0.111314518292.issue44631@roundup.psfhosted.org> ?ric Araujo added the comment: Hello! I?ve seen your name on a few recent tickets, thanks for contributing and welcome here! In general, the CPython project doesn?t do esthetic code changes for their own sake. Not all code is changed from %-formatting when format is added, not all code using format changes to f-string, and code that works is left alone. Each change merged takes resources to run tests, build packages, update clones; it changes the history of the files touched (which is important when investigating a bug months or years later); it takes time to review (pre or post-commit); it has the opportunity of introducing bugs. Therefore, in the absence of a bug to fix or a new feature that is made easier by prior changes, I think this should be closed as not a bug. ---------- nosy: +eric.araujo, lukasz.langa versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:38:24 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Jul 2021 18:38:24 +0000 Subject: [issue44629] Some files from distutils module are importing all exceptions unnecessarily In-Reply-To: <1626204940.79.0.533758495697.issue44629@roundup.psfhosted.org> Message-ID: <1626460704.98.0.216861225328.issue44629@roundup.psfhosted.org> ?ric Araujo added the comment: distutils is a special case in the standard library: complicated code with even private helpers used by code in the wild, so we are extra careful when changing things in there. But I should say it used to be special, and we used to be careful: setuptools copied the whole of distutils into their repo to make it easier to change things, and there?s a PEP to remove distutils from the standard library. Thanks for checking first! ---------- nosy: +eric.araujo resolution: -> not a bug stage: -> resolved status: open -> closed type: enhancement -> versions: -Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:50:53 2021 From: report at bugs.python.org (Brett Cannon) Date: Fri, 16 Jul 2021 18:50:53 +0000 Subject: [issue10572] Move test sub-packages to Lib/test In-Reply-To: <1290991979.58.0.262973706564.issue10572@psf.upfronthosting.co.za> Message-ID: <1626461453.59.0.670449142245.issue10572@roundup.psfhosted.org> Brett Cannon added the comment: > After so long a reason came up that prevents the movement of tests of ctypes, lib2to3, and idlelib (which even continues in the same folder, only the nomenclature was changed)? Time and energy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:51:57 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Jul 2021 18:51:57 +0000 Subject: [issue44624] Script name for venv PowerShell activate In-Reply-To: <1626188651.64.0.496215753263.issue44624@roundup.psfhosted.org> Message-ID: <1626461517.52.0.369443375387.issue44624@roundup.psfhosted.org> Change by ?ric Araujo : ---------- components: +Library (Lib) -Installation nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 14:53:10 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 16 Jul 2021 18:53:10 +0000 Subject: [issue44628] Remove the broken link for issue #445902 in unixcompiler.py (distutils) In-Reply-To: <1626201794.58.0.874918644983.issue44628@roundup.psfhosted.org> Message-ID: <1626461590.16.0.0208241849391.issue44628@roundup.psfhosted.org> ?ric Araujo added the comment: distutils is being removed, see https://bugs.python.org/issue41282 ---------- nosy: +eric.araujo resolution: -> out of date stage: patch review -> resolved status: open -> closed versions: -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:07:11 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 16 Jul 2021 19:07:11 +0000 Subject: [issue42581] Docs site redirection doesn't work for 3.9 In-Reply-To: <1607267040.29.0.292241641932.issue42581@roundup.psfhosted.org> Message-ID: <1626462431.64.0.941360514799.issue42581@roundup.psfhosted.org> Andrei Kulakov added the comment: It works for me (the first link) -- I think this can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:14:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 19:14:32 +0000 Subject: [issue44655] Confusing error with __slots__ Message-ID: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> New submission from Eric V. Smith : This is related to issue 44649. This is the simplest non-dataclasses case I could come up with. Given: class Example: __slots__ = ('a', 'b') def __init__(self, a): self.a = a obj = Example(42) print(obj.b) I get this in 3.10 and main: Traceback (most recent call last): File "C:\home\eric\local\python\cpython\testdc.py", line 7, in print(obj.b) ^^^^^ AttributeError: b. Did you mean: 'b'? The error message is confusing. 3.8 gives: Traceback (most recent call last): File "testdc.py", line 7, in print(obj.b) AttributeError: b I don't have 3.9 around to test with. Maybe don't print the "Did you mean" part if the suggestion is the same as the requested attribute? The fact that the instance variable isn't initialized is the actual error in issue 44649, and I'll fix it there. ---------- components: Interpreter Core messages: 397652 nosy: eric.smith, pablogsal priority: normal severity: normal status: open title: Confusing error with __slots__ type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:15:50 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 19:15:50 +0000 Subject: [issue44649] dataclasses slots with init=False field raises AttributeException In-Reply-To: <1626375963.06.0.364448585924.issue44649@roundup.psfhosted.org> Message-ID: <1626462950.56.0.571360243064.issue44649@roundup.psfhosted.org> Eric V. Smith added the comment: I created issue 44655 for the confusing error message. The problem with dataclasses is that the instance variable 'b' needs to be initialized, instead of the current dataclasses behavior where it relies on the class variable when reading 'b'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:21:56 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 19:21:56 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626463316.41.0.592910963075.issue44655@roundup.psfhosted.org> Eric V. Smith added the comment: Also, the dot after the first 'b' was confusing to me: I thought it had something to do with an attribute of b. And the quotes around the second 'b' were also confusing, but that's mostly because the original example initialized a class variable named 'b' with the str value 'b'. Maybe a better error would use a colon: AttributeError: foo: Did you mean: 'foo1'? Looking at 3.10s behavior, I can't decide what logic it's using to suggest something: >>> 'foo'.formatx Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'formatx'. Did you mean: 'format'? >>> class C: pass ... >>> C().a Traceback (most recent call last): File "", line 1, in AttributeError: 'C' object has no attribute 'a' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:26:39 2021 From: report at bugs.python.org (Alexey Izbyshev) Date: Fri, 16 Jul 2021 19:26:39 +0000 Subject: [issue44656] Dangerous mismatch between MAXPATHLEN and MAX_PATH on Windows Message-ID: <1626463599.7.0.822730075701.issue44656@roundup.psfhosted.org> New submission from Alexey Izbyshev : In PC/getpathp.c CPython uses buffers with length MAXPATHLEN+1, which is 257 on Windows[1]. On Windows 7, where PathCch* functions are not available, CPython <= 3.8 fallbacks to PathCombineW()/PathCanonicalizeW()[2]. Those functions assume that the destination buffer has room for MAX_PATH (260) characters. This creates a dangerous setup: for example, gotlandmark()[3] can overflow the destination if `filename` is long enough, and `filename` can be user-controlled. I couldn't devise a simple way to trigger a buffer overflow in a default Python installation, though it is possible if one, for example, makes sure that the landmark file ("lib\os.py") can't be found in the default locations and then supplies their own, long enough paths via e.g. PYTHONPATH environment variable which eventually end up in gotlandmark(). Even when such buffer overflow is triggered on my machine, I couldn't notice any change in behavior, probably because 3 bytes is small enough to not overwrite anything important. However, I'm not comfortable with this. Could we just raise MAXPATHLEN from 256 to 260 on Windows to avoid such kind of issues for sure? Please also note that while the issue described above affects only Python <= 3.8 on Windows 7, I think it would make sense to increase MAXPATHLEN in newer versions too to avoid any similar situations in the future (i.e. if two pieces of code interact and one of them uses MAX_PATH while another uses MAXPATHLEN). [1] https://github.com/python/cpython/blob/0389426fa4af4dfc8b1d7f3f291932d928392d8b/Include/osdefs.h#L13 [2] https://github.com/python/cpython/blob/0389426fa4af4dfc8b1d7f3f291932d928392d8b/PC/getpathp.c#L278 [3] https://github.com/python/cpython/blob/0389426fa4af4dfc8b1d7f3f291932d928392d8b/PC/getpathp.c#L333 ---------- components: Windows messages: 397655 nosy: izbyshev, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Dangerous mismatch between MAXPATHLEN and MAX_PATH on Windows type: security versions: Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:29:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 19:29:11 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626463751.13.0.436716325693.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For attribute errors we just call dir() on the object and we do a suggestion based on the names so if a name appears in the dir() then we will consider it for the suggestion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:36:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 19:36:38 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626464198.34.0.188171056913.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > Maybe don't print the "Did you mean" part if the suggestion is the same as the requested attribute? I think this is a good idea and will take care of many other similar cases. Thanks for the suggestion, Eric! I will prepare a PR ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:37:59 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 19:37:59 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626464279.82.0.932153194358.issue44655@roundup.psfhosted.org> Eric V. Smith added the comment: It's obviously not super important, but it would be nicer if the version with the suggestion were more like the version without the suggestion. Specifically, mentioning the object type: >>> class E: ... __slots__=('a') ... >>> E().a Traceback (most recent call last): File "", line 1, in AttributeError: a. Did you mean: 'a'? >>> E().b Traceback (most recent call last): File "", line 1, in AttributeError: 'E' object has no attribute 'b' >>> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:38:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 19:38:32 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626464312.63.0.230763541738.issue44655@roundup.psfhosted.org> Eric V. Smith added the comment: Thanks, Pablo! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:43:58 2021 From: report at bugs.python.org (Sam Gross) Date: Fri, 16 Jul 2021 19:43:58 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro Message-ID: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> New submission from Sam Gross : The instancemethod_call function should use the PyInstanceMethod_GET_FUNCTION macro instead of the PyMethod_GET_FUNCTION macro. The current code is incorrect, but still works okay (doesn't crash) because PyInstanceMethodObject.func is at the same offset as PyMethodObject.im_func. https://github.com/python/cpython/blob/c90c591e5158ab7b531dcd6e2a5f00bc70ba7637/Objects/classobject.c#L465 ---------- components: Interpreter Core messages: 397660 nosy: colesbury priority: normal severity: normal status: open title: instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 15:49:41 2021 From: report at bugs.python.org (Sam Gross) Date: Fri, 16 Jul 2021 19:49:41 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1626464981.06.0.880815440946.issue44657@roundup.psfhosted.org> Change by Sam Gross : ---------- type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:24:11 2021 From: report at bugs.python.org (Leonardo Freua) Date: Fri, 16 Jul 2021 20:24:11 +0000 Subject: [issue44629] Some files from distutils module are importing all exceptions unnecessarily In-Reply-To: <1626204940.79.0.533758495697.issue44629@roundup.psfhosted.org> Message-ID: <1626467051.56.0.648992775055.issue44629@roundup.psfhosted.org> Leonardo Freua added the comment: Hi ?ric, thanks for the info. I'm still learning about all the processes and how things work around here in order to avoid opening issues that no longer make sense. Thanks you again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:26:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 20:26:11 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626467171.21.0.860627642154.issue44655@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25732 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27197 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:32:00 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 16 Jul 2021 20:32:00 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match Message-ID: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> New submission from Jack DeVries : Consider the following code: class A: a = 'a' # runs without error match {'a': 1}: case {'a': 1, A.a: 1}: pass # raises ValueError match {'a': 1, 'b': 1}: case {'a': 1, A.a: 1}: pass In both cases, the mapping pattern is the same (and both are not valid due to duplicate key values). However, the pattern is only evaluated in the second case. This is because a key-length optimization provides a shortcut around pattern evaluation. The docs gives users a hint that things like this might happen, which is a good thing: > Users should generally never rely on a pattern being evaluated. Depending on > implementation, the interpreter may cache values or use other optimizations > which skip repeated evaluations. > https://docs.python.org/3.10/reference/compound_stmts.html#overview However, I can't help but think that these ergonomics are strange. Consider if some other code is mutating the value of `A.a`. This could create some very strange and flaky bugs where the state of `A.a` can change and make the pattern invalid, but nonetheless not cause an exception until much later, or not at all. There is mapping pattern validation code in the `match_keys` function in ceval.c. I haven't looked, but I assume there is some other runtime validation for other match case types. I propose factoring Exception-raising validation into a separate procedure that is called before any optimization jumps occur. This trades speed for consistent behavior, and I'm interested to hear what others think! ---------- components: Interpreter Core messages: 397662 nosy: jack__d priority: normal severity: normal status: open title: No ValueError for duplicate key value in mapping patern when lengths do not match type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:32:10 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 20:32:10 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626467530.13.0.138617768703.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > it would be nicer if the version with the suggestion were more like the version without the suggestion Agreed, but that is actually not related with the suggestions. We only append a string at the end of whatever exception it was there. This difference is based on the attribute error for a slot not initialized vs an attribute error for something that is not there. For example, in 3.9: --- class E: __slots__=('blech') E().blech Traceback (most recent call last): File "/home/pablogsal/github/cpython/lel.py", line 6, in E().blech AttributeError: blech while class E: __slots__=('blech') E().bluch Traceback (most recent call last): File "/home/pablogsal/github/cpython/lel.py", line 4, in E().bluch AttributeError: 'E' object has no attribute 'bluch' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:38:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 16 Jul 2021 20:38:07 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match In-Reply-To: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> Message-ID: <1626467887.89.0.228708182548.issue44658@roundup.psfhosted.org> Jack DeVries added the comment: Another option if this problem is isolated to mapping patterns, we could introduce a new op-code: BUILD_MATCH_MAP, which is essentially a wrapper around BUILD_MAP that disallows duplicate key values. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:40:42 2021 From: report at bugs.python.org (Shane Harvey) Date: Fri, 16 Jul 2021 20:40:42 +0000 Subject: [issue10551] mimetypes read from the registry should not overwrite standard mime mappings In-Reply-To: <1290885326.33.0.141249546234.issue10551@psf.upfronthosting.co.za> Message-ID: <1626468042.75.0.347278514266.issue10551@roundup.psfhosted.org> Shane Harvey added the comment: This issue says "mimetypes read from the registry should not overwrite standard mime mappings". Was this change ever made? the following issue claims that the "HKEY_CLASSES_ROOT\.js\Content Type" registry can still overrides ".js" files: https://bugs.python.org/issue43975? ---------- nosy: +ShaneHarvey _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:51:10 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 16 Jul 2021 20:51:10 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626468670.75.0.0137718767081.issue43950@roundup.psfhosted.org> Ammar Askar added the comment: As reported by Will McGugan on twitter: Printing may be wrong for some unicode characters like: Traceback (most recent call last): File "test.py", line 1, in x = ("?" / 0) + (1 / 2) ~~~~~~^ TypeError: unsupported operand type(s) for /: 'str' and 'int' and Traceback (most recent call last): File "test.py", line 3, in x = ("?" / 0) + (1 / 2) ~~~~~~~ TypeError: unsupported operand type(s) for /: 'str' and 'int' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:54:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 20:54:39 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626468879.28.0.756985597611.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Ah, this is our friend _PyPegen_byte_offset_to_character_offset. I am glad we refactor it to be used by the Parser and the traceback mechanism. Ammar, would you like to take a look? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:58:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 20:58:29 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626469109.41.0.658277856268.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6714dec5e104bdee4a0ed4d9966de27d1bfa1e3d by Pablo Galindo Salgado in branch 'main': bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) https://github.com/python/cpython/commit/6714dec5e104bdee4a0ed4d9966de27d1bfa1e3d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:58:56 2021 From: report at bugs.python.org (Ammar Askar) Date: Fri, 16 Jul 2021 20:58:56 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626469136.35.0.128140719367.issue43950@roundup.psfhosted.org> Ammar Askar added the comment: Aah, I won't have time to investigate until Monday. I'll take a look then unless someone gets to it first :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 16:58:48 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 20:58:48 +0000 Subject: [issue44655] Confusing error with __slots__ In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626469128.07.0.763938105201.issue44655@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25733 pull_request: https://github.com/python/cpython/pull/27198 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:01:01 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 21:01:01 +0000 Subject: [issue44655] Confusing message with AttributreError suggestions In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626469261.89.0.504638711905.issue44655@roundup.psfhosted.org> Eric V. Smith added the comment: Got it. Thanks for jumping on this quickly. ---------- title: Confusing error with __slots__ -> Confusing message with AttributreError suggestions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:01:29 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 21:01:29 +0000 Subject: [issue44655] Confusing message with AttributreError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626469289.37.0.266994281007.issue44655@roundup.psfhosted.org> Change by Eric V. Smith : ---------- title: Confusing message with AttributreError suggestions -> Confusing message with AttributreError when attribute name matches suggestion _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:16:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 21:16:20 +0000 Subject: [issue44655] Confusing message with AttributreError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626470180.7.0.0207685426051.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset a0b1d401db52391d13479c53ee3880e6640df98c by Miss Islington (bot) in branch '3.10': bpo-44655: Don't include suggestions for attributes that are the same as the missing one (GH-27197) (GH-27198) https://github.com/python/cpython/commit/a0b1d401db52391d13479c53ee3880e6640df98c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:17:53 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 21:17:53 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626470273.56.0.263710284064.issue44655@roundup.psfhosted.org> Change by Eric V. Smith : ---------- title: Confusing message with AttributreError when attribute name matches suggestion -> Confusing message with AttributeError when attribute name matches suggestion _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:35:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 21:35:31 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626471331.22.0.438421027544.issue44655@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25734 pull_request: https://github.com/python/cpython/pull/27199 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:50:18 2021 From: report at bugs.python.org (Isaac) Date: Fri, 16 Jul 2021 21:50:18 +0000 Subject: [issue35673] Loader for namespace packages In-Reply-To: <1546781003.0.0.391060889435.issue35673@roundup.psfhosted.org> Message-ID: <1626472218.62.0.840405498624.issue35673@roundup.psfhosted.org> Isaac added the comment: Not sure if it's proper etiquette to bump issues on the tracker, but is there any interest in this issue for 3.11? ---------- nosy: +fwahhab _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 17:51:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 21:51:22 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626472282.69.0.695461385871.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: We can probably leverage the unicodedata_UCD_east_asian_width_impl function in the unicodedata extension module to get the width of every character as emojis normally take 2 characters in the terminal. We could expose the necessary functions from there and use them in the _PyPegen_byte_offset_to_character_offset function ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 18:00:11 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 16 Jul 2021 22:00:11 +0000 Subject: [issue35673] Loader for namespace packages In-Reply-To: <1546781003.0.0.391060889435.issue35673@roundup.psfhosted.org> Message-ID: <1626472811.26.0.592581775636.issue35673@roundup.psfhosted.org> Eric V. Smith added the comment: I think a PR with tests would be a good first step. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 19:34:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 16 Jul 2021 23:34:54 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626478494.61.0.132679112062.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset f783428a2313a729ca8b539c5a86ff114b9ff375 by Pablo Galindo Salgado in branch 'main': bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) https://github.com/python/cpython/commit/f783428a2313a729ca8b539c5a86ff114b9ff375 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 19:34:59 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 16 Jul 2021 23:34:59 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626478499.19.0.586352170909.issue44655@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25735 pull_request: https://github.com/python/cpython/pull/27201 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 20:02:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Jul 2021 00:02:22 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626480142.55.0.36578907292.issue44655@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 Jul 16 20:02:18 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Jul 2021 00:02:18 +0000 Subject: [issue44655] Confusing message with AttributeError when attribute name matches suggestion In-Reply-To: <1626462872.04.0.450801873338.issue44655@roundup.psfhosted.org> Message-ID: <1626480138.91.0.455215157184.issue44655@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset efda9054b9fc91e69ecb34eae84fdd2ca8e6feef by Miss Islington (bot) in branch '3.10': bpo-44655: Include the name of the type in unset __slots__ attribute errors (GH-27199) (GH-27201) https://github.com/python/cpython/commit/efda9054b9fc91e69ecb34eae84fdd2ca8e6feef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 20:34:02 2021 From: report at bugs.python.org (Andrew Aladjev) Date: Sat, 17 Jul 2021 00:34:02 +0000 Subject: [issue39221] Cross compiled python installed wrong version of lib2to3/Grammar pickle In-Reply-To: <1578231683.23.0.24612692977.issue39221@roundup.psfhosted.org> Message-ID: <1626482042.39.0.671383653107.issue39221@roundup.psfhosted.org> Andrew Aladjev added the comment: Hello. I've received more problems with pickle generation, reviewed source code, invented better bike for solving it. So I can provide full description of this issue and reduce other developers time on debugging. Problem: 1. Martin v. L?wis introduced pickle generation Wed Mar 19 04:43:46 2008 commit https://github.com/python/cpython/commit/5e37baea8007cb64b65a180e4d6c80de292a8a4a#diff-c9bd4064884726c21716df7118dcaeb72a63cc8ddd49484c7f4676934b37d9bb 2. Martin provided code for generating of pickle file: head + tail + ".".join(map(str, sys.version_info)) + ".pickle". This code has never been changed and comes as is in 2021 year. Code means that current python interpreter uses its own version for creating a new pickle file for new cpython interpreter. It will work only when current python interpreter equals to new cpython interpreter. This code is broken by design. 3. We can see file "Lib/lib2to3/patcomp.py" in the commit above, today (2021) it is a part of "Lib/lib2to3/pygram.py". It comes with the following code: _GRAMMAR_FILE = ... "Grammar.txt" _PATTERN_GRAMMAR_FILE = ... "PatternGrammar.txt" 4. We can review step-by-step "load_grammar" real world usage from "Lib/lib2to3/pgen2/driver.py": driver.load_grammar(_GRAMMAR_FILE) driver.load_grammar(_PATTERN_GRAMMAR_FILE) def load_grammar(gt="Grammar.txt", gp=None gp = head + tail + ".".join(map(str, sys.version_info)) + ".pickle" if force or not _newer(gp, gt): logger.info("Generating grammar tables from %s", gt) def _newer(a, b): if not os.path.exists(a): return False This "code" comes as is today as a part of latest stable python 3.9.5. This workaround means that when pickle files doesn't exist - python will recreate it in runtime inside "lib/lib2to3" folder. This workaround will ruin your production if "lib/lib2to3" is readonly and pickle files are not inside. Everybody will try to use this workaround as a security hole. But it looks like nobody from cpython cares. Solution: 1. Apply provided remove_python_version_from_pickle.patch. 2. Cross compile new cpython. 3. Cross compile portage. 4. Chroot. 5. Run python -c "import lib2to3.pygram", it will create pickles without version postfix, stop python from creating junk in runtime, fix sandbox permission issues temporaly. 6. Reinstall portage. 7. Reinstall cpython without patch, it will recreate pickles during installation. 8. Reinstall portage. This is just bike on the top of Martin's workaround. The best variant is to ignore cpython (and maybe python) completely, ignore software written in python where possible. ---------- Added file: https://bugs.python.org/file50153/remove_python_version_from_pickle.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 21:51:15 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 17 Jul 2021 01:51:15 +0000 Subject: [issue44649] dataclasses slots with init=False field raises AttributeException In-Reply-To: <1626375963.06.0.364448585924.issue44649@roundup.psfhosted.org> Message-ID: <1626486675.23.0.031928408852.issue44649@roundup.psfhosted.org> Eric V. Smith added the comment: With Pablo's changes, the error now reads (in 3.11): obj.b ^^^^^ AttributeError: 'Example' object has no attribute 'b' Which is a vast improvement! I'm working on a PR to initialize obj.b in __init__. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 22:08:19 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 02:08:19 +0000 Subject: [issue29753] [Linux] ctypes packs bitfields Incorrectly In-Reply-To: <1488933400.56.0.160685455632.issue29753@psf.upfronthosting.co.za> Message-ID: <1626487699.34.0.289618269467.issue29753@roundup.psfhosted.org> Terry J. Reedy added the comment: Charles and Sam: In the future, when responding by email, please delete the email you are responding to, except maybe for a line. When your response is posted to web page, the quote is redundant and distracting. ---------- nosy: +terry.reedy versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 22:18:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 17 Jul 2021 02:18:47 +0000 Subject: [issue40529] Auto Completions with case insensitive In-Reply-To: <1588768459.35.0.455156839892.issue40529@roundup.psfhosted.org> Message-ID: <1626488327.5.0.805874188805.issue40529@roundup.psfhosted.org> Andrei Kulakov added the comment: It seems like this would be a very good feature to have for accesibility, because persons with low level disabilities (e.g. carpal syndrom) will generally have a harder time keeping shift down while pressing a few upper case letters, and they would often have caps lock remapped to Esc or Ctrl to make them more easily usable since caps lock is almost never used. I don't have disability but that's what I've heard! ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 22:25:48 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 02:25:48 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1626488748.81.0.424229752461.issue44592@roundup.psfhosted.org> Terry J. Reedy added the comment: Traceback (most recent call last): File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1921, in __call__ return self.func(*args) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 839, in callit func(*args) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 783, in focus_get return self._nametowidget(name) File "C:\Programs\Python310\lib\tkinter\__init__.py", line 1536, in nametowidget w = w.children[n] KeyError: 'e' Is catching KeyError in the following try: # Tcl sometimes returns extra windows, e.g. for # menus; those need to be skipped result.append(self._nametowidget(child)) except KeyError: pass really correct? It appears to skip things that *can* get focus by key or mouse action. But what choice is there? Silently failing when asked to focus on something is even less obviously correct. For 'widget = root.focus_get' to assign None to widget is not obviously useful as it likely just delays the error. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:11:06 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 03:11:06 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1626491466.97.0.695611977513.issue44657@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:12:30 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:12:30 +0000 Subject: [issue43893] typing.get_type_hints does not accept type annotations with leading whitespaces In-Reply-To: <1618923799.18.0.0357006810909.issue43893@roundup.psfhosted.org> Message-ID: <1626491550.7.0.141233813479.issue43893@roundup.psfhosted.org> Guido van Rossum added the comment: The more I think about this, the less I like it. AFAIK static checkers like mypy don?t strip leading white space from forward references either. (If I?m wrong, please show evidence.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:13:57 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 03:13:57 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1626491637.99.0.838575398195.issue44657@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25736 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27202 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:16:41 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 17 Jul 2021 03:16:41 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match In-Reply-To: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> Message-ID: <1626491801.48.0.51957816093.issue44658@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: See also https://bugs.python.org/issue44589 ---------- nosy: +brandtbucher, xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:18:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:18:39 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626491919.61.0.929647808045.issue44524@roundup.psfhosted.org> Guido van Rossum added the comment: Sorry for the slow progress. I don?t think it is important for Any orUnion to have these attributes, but the ones that match ABCs or concrete classes (e.g. MutableSet, Counter) should probably have __name__, __qualname__, and __module__, since the originals have those. I think __module__ should be set to ?typing?, and __qualname__ to ?typing.WhatEver?. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:32:43 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 03:32:43 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626492763.78.0.868052534837.issue44603@roundup.psfhosted.org> Terry J. Reedy added the comment: This has been proposed and rejected before. So I think a pydev discussion and steering council decision would be needed to change. The current rule in interactive mode is that typing an expression statement echoes the representation of the resulting object. The proposal is make a rather startling exception to the rule. The premise is that "the program knows what I meant". However, that is a too-successful illusion. 'The program' has no idea what one meant other than to print the repr(ob). Some coredevs had the idea to *guess* what was meant and to give two functions an exceptional representation with a message that would be correct when the guess is correct. In the other hand, special-casing 'quit\n' and 'exit\n' could be seen as analogous to special-casing '^Z\n'. And the patch restricts the special casing, without complicated code, to exactly those sequences of keystrokes. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:33:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:33: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: <1626492824.03.0.384873895576.issue44490@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset bf89ff96e6ba21bb52b8597b5e51e8ffc57e6589 by Yurii Karabas in branch 'main': bpo-44490: Improve typing module compatibility with types.Union (GH-27048) https://github.com/python/cpython/commit/bf89ff96e6ba21bb52b8597b5e51e8ffc57e6589 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:35:54 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 03:35:54 +0000 Subject: [issue44610] Format issue with strftime and %Y In-Reply-To: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> Message-ID: <1626492954.17.0.0087059738793.issue44610@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 Jul 16 23:38:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Jul 2021 03:38:22 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626493102.84.0.838785414278.issue44589@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is something left here? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:42:04 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:42:04 +0000 Subject: [issue44659] Remove Ivan from list of,typing experts Message-ID: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> New submission from Guido van Rossum : There is a list somewhere in bpo or GH that automatically adds Ivan to all bugs or reviews involving typing. He is no longer active. Can we remove him from those lists? And maybe add Ken Jin, who has built up a lot of expertise in this area. ---------- messages: 397688 nosy: gvanrossum, kj, levkivskyi, lukasz.langa priority: normal severity: normal status: open title: Remove Ivan from list of,typing experts _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:42:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 03:42:34 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626493354.95.0.312647159822.issue44651@roundup.psfhosted.org> Terry J. Reedy added the comment: OK with me. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:45:14 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:45:14 +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: <1626493514.19.0.565419181369.issue44490@roundup.psfhosted.org> Change by Guido van Rossum : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:49:34 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:49:34 +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: <1626493774.34.0.828061322999.issue41249@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset 889036f7ef7290ef15b6c3373023f6a35387af0c by Germ?n M?ndez Bravo in branch 'main': bpo-41249: Fix postponed annotations for TypedDict (GH-27017) https://github.com/python/cpython/commit/889036f7ef7290ef15b6c3373023f6a35387af0c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:49:43 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sat, 17 Jul 2021 03:49:43 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626493783.93.0.605057096205.issue44603@roundup.psfhosted.org> Vedran ?a?i? added the comment: > In the other hand, special-casing 'quit\n' and 'exit\n' could be seen as analogous to special-casing '^Z\n' Terry, there is a big difference between special-casing 'exit\n' and special-casing '^Z\n': 'exit' is a perfectly valid identifier (and people use it regularly), ^Z is not. Especially if 'exit\n' exited unconditionally, I think many people would be very frustrated and surprised when trying to inspect the variable called 'exit'. I'd have no objection if something like '!exit' was special-cased, but then there is not much difference between adding a bang before and adding the parentheses after. Alternatively, exit can be proclaimed a keyword, but I really think this is overkill. And please don't think this process that you're starting now will stop at these two words. Much more beginners, according to my experience, try to type `pip install something` inside Python REPL. If we do this, it will be a powerful precedent, and almost surely we will have the "magic mess" later. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:50:45 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 03:50:45 +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: <1626493844.99.0.0408919421229.issue41249@roundup.psfhosted.org> Guido van Rossum added the comment: How far can/should we backport this? ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:50:42 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 03:50:42 +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: <1626493842.22.0.185357790141.issue44490@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25737 pull_request: https://github.com/python/cpython/pull/27203 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:52:51 2021 From: report at bugs.python.org (Francis Johnson) Date: Sat, 17 Jul 2021 03:52:51 +0000 Subject: [issue44660] email.feedparser Module Lacks Support for Section 3.5 of RFC 6532: message/global Emails with non-identity Content-Transfer-Encodings Message-ID: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> New submission from Francis Johnson : Note that I have created a fix for this and am working through the Python Developer?s Guide to propose it. ---------- components: email messages: 397693 nosy: barry, f18a14c09s, r.david.murray priority: normal severity: normal status: open title: email.feedparser Module Lacks Support for Section 3.5 of RFC 6532: message/global Emails with non-identity Content-Transfer-Encodings type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 16 23:58:39 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 03:58:39 +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: <1626494319.39.0.584199403022.issue41249@roundup.psfhosted.org> Ken Jin added the comment: > How far can/should we backport this? It will work in 3.10 and 3.9 without issues. However, I don't remember if bugfixes for __future__ features require special treatment/are excluded from normal bugfix backports. I vaguely remember us not backporting from __future__ annotations very far back (since they usually broke backwards compatibility). Maybe 3.10 is enough? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:03:21 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 04:03:21 +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: <1626494601.35.0.292958014077.issue41249@roundup.psfhosted.org> Guido van Rossum added the comment: Let?s both, since this feels like a real bug fix to me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:09:57 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 04:09:57 +0000 Subject: [issue44659] Remove Ivan from list of,typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626494997.99.0.405942562551.issue44659@roundup.psfhosted.org> Ken Jin added the comment: The list for GH reviews is the CODEOWNERS file at https://github.com/python/cpython/blob/main/.github/CODEOWNERS The list for grouping bpo users is the experts index (I hope) at https://devguide.python.org/experts/ Let's wait a bit to hear what Ivan wants. I recall seeing him replying on bpo recently but not on GH. So maybe we should leave him in for bpo but remove him from the GH reviews? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:14:25 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Jul 2021 04:14:25 +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: <1626495265.8.0.549527648801.issue41249@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25738 pull_request: https://github.com/python/cpython/pull/27204 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:16:50 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 17 Jul 2021 04:16:50 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626495410.62.0.877364020162.issue44589@roundup.psfhosted.org> Jack DeVries added the comment: The PR and backport to 3.10 have both been merged, so I think this issue can be closed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:20:20 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 04:20: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: <1626495620.94.0.18928428471.issue41249@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25739 pull_request: https://github.com/python/cpython/pull/27205 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:20:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 17 Jul 2021 04:20:16 +0000 Subject: [issue44589] Pattern Matching - duplicate keys in mapping patterns In-Reply-To: <1625825814.86.0.0898667876443.issue44589@roundup.psfhosted.org> Message-ID: <1626495616.5.0.473569656588.issue44589@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 Jul 17 00:44:23 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 04:44:23 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626497063.61.0.0850282002926.issue44603@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree that turning 'exit' and 'quit' into semi-keywords is not acceptible. I added this to my PR review. >>> exit = 3 >>> exit f:\dev\3x> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 00:59:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 17 Jul 2021 04:59:21 +0000 Subject: [issue44603] REPL: exit when the user types exit instead of asking them to explicitly type exit() In-Reply-To: <1626059745.58.0.0764234383007.issue44603@roundup.psfhosted.org> Message-ID: <1626497961.64.0.934643675516.issue44603@roundup.psfhosted.org> Terry J. Reedy added the comment: Another issue: exit() and quit() work unconditionally when called, regardless of the context: "a = (3, exit(), 'abc')". The abbreviated versions will not. An alternative change is to revise the representation. Perhaps tell the truth first by giving the standard representation -- -- so that people might recognize that they are just seeing a printed string. Then add on the next line, "If you want to exit, enter 'exit' ...". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:09:54 2021 From: report at bugs.python.org (Steven Hsu) Date: Sat, 17 Jul 2021 05:09:54 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626498594.58.0.860371742147.issue44651@roundup.psfhosted.org> Steven Hsu added the comment: Thanks for your reply and suggestion. I can totally understand your explanation about the definition of coercion. In conclusion, I think this glossary entry may need some modification for better understanding, or simply be deleted. So what's the next step? Should I create a PR in GitHub? Thanks for reply again. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:19:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:19:43 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. Message-ID: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> New submission from Dong-hee Na : It shows a consistent 1-2% performance improvement. Mean +- std dev: [property_base] 40.6 ns +- 0.6 ns -> [property_vectorcall] 40.0 ns +- 0.7 ns: 1.01x faster ---------- components: Interpreter Core files: bench_property.py messages: 397701 nosy: corona10, erlendaasland, kj, pablogsal, vstinner priority: normal severity: normal status: open title: Update property_descr_set to use vectorcall if possible. type: performance versions: Python 3.11 Added file: https://bugs.python.org/file50154/bench_property.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:21:18 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:21:18 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626499278.21.0.356758431265.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25740 pull_request: https://github.com/python/cpython/pull/27206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:29:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:29:04 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626499744.35.0.212008467659.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -25740 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:29:28 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:29:28 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626499768.23.0.828481082247.issue44661@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25741 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:29:28 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:29:28 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626499768.31.0.239308491586.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25742 pull_request: https://github.com/python/cpython/pull/27206 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:29:47 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 05:29:47 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626499787.24.0.18066972263.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: -25742 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 01:43:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 05:43:29 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626500609.87.0.754093655243.issue44659@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- title: Remove Ivan from list of,typing experts -> Remove Ivan from list of typing experts _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 02:23:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 06:23:04 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626502984.83.0.436406001673.issue44661@roundup.psfhosted.org> Dong-hee Na added the comment: Oops sorry, it was the wrong benchmark, it will be faster.. ;) Mean +- std dev: [property_base] 140 ns +- 5 ns -> [property_vectorcall] 125 ns +- 2 ns: 1.12x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 02:23:33 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 06:23:33 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626503013.79.0.603467199476.issue44661@roundup.psfhosted.org> Change by Dong-hee Na : Added file: https://bugs.python.org/file50155/bench_property.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 02:23:50 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 06:23:50 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626503030.62.0.757642564878.issue44661@roundup.psfhosted.org> Change by Dong-hee Na : Removed file: https://bugs.python.org/file50154/bench_property.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 02:24:22 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sat, 17 Jul 2021 06:24:22 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626503062.12.0.0921389874373.issue44661@roundup.psfhosted.org> Dong-hee Na added the comment: I updated the benchmark, and it shows 1.12x faster ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 02:49:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 06:49:12 +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: <1626504552.58.0.95996508838.issue44490@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka nosy_count: 8.0 -> 9.0 pull_requests: +25743 pull_request: https://github.com/python/cpython/pull/27207 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:01:36 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 07:01:36 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626505296.41.0.166773454256.issue44653@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +25745 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:01:10 2021 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sat, 17 Jul 2021 07:01:10 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626505270.51.0.451553562173.issue44659@roundup.psfhosted.org> Ivan Levkivskyi added the comment: You can remove me from both. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:01:36 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 07:01:36 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626505296.3.0.85414483223.issue44633@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 3.0 -> 4.0 pull_requests: +25744 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:02:52 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 07:02:52 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626505372.94.0.975257002447.issue44653@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -25745 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:02:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 07:02:40 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626505360.32.0.884137817953.issue44633@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -25744 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 03:39:47 2021 From: report at bugs.python.org (Roundup Robot) Date: Sat, 17 Jul 2021 07:39:47 +0000 Subject: [issue44660] email.feedparser Module Lacks Support for Section 3.5 of RFC 6532: message/global Emails with non-identity Content-Transfer-Encodings In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1626507587.71.0.30302485039.issue44660@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +25746 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27208 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:04:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:04:22 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626509062.22.0.83727469875.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ed2db9b5940ccbc0bc72d01bf62d8b3095ccef21 by ?ukasz Langa in branch '3.9': bpo-40897: Partially backport GH-22583's refactor of inspect.py to allow bugfix backports (#27193) https://github.com/python/cpython/commit/ed2db9b5940ccbc0bc72d01bf62d8b3095ccef21 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:04:42 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Jul 2021 08:04:42 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626509082.34.0.0513073658924.issue40897@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25747 pull_request: https://github.com/python/cpython/pull/27209 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:14:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:14:59 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626509699.21.0.869441500248.issue44659@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +25748 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27210 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:27:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:27:32 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626510452.93.0.771476700947.issue44659@roundup.psfhosted.org> ?ukasz Langa added the comment: Related devguide PR: https://github.com/python/devguide/pull/728 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:32:51 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 17 Jul 2021 08:32:51 +0000 Subject: [issue44610] Format issue with strftime and %Y In-Reply-To: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> Message-ID: <1626510771.23.0.625076900711.issue44610@roundup.psfhosted.org> Irit Katriel added the comment: See also Issue13305. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:36:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:36:39 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626510999.57.0.492326229576.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset df7c62980d15acd3125dfbd81546dad359f7add7 by Miss Islington (bot) in branch '3.9': bpo-40897:Give priority to using the current class constructor in `inspect.signature` (GH-27177) (GH-27209) https://github.com/python/cpython/commit/df7c62980d15acd3125dfbd81546dad359f7add7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:37:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:37:04 +0000 Subject: [issue40897] Inheriting from class that defines __new__ causes inspect.signature to always return (*args, **kwargs) for constructor In-Reply-To: <1591501058.45.0.282415808867.issue40897@roundup.psfhosted.org> Message-ID: <1626511024.65.0.260842213624.issue40897@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 04:48:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 08:48:23 +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: <1626511703.8.0.948666594361.issue41249@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 480f29f913cff30329e7b425fd6669f83d6d8af8 by Miss Islington (bot) in branch '3.10': bpo-41249: Fix postponed annotations for TypedDict (GH-27017) (#27204) https://github.com/python/cpython/commit/480f29f913cff30329e7b425fd6669f83d6d8af8 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:09:32 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 09:09:32 +0000 Subject: [issue20291] Argument Clinic should understand *args and **kwargs parameters In-Reply-To: <1390010125.91.0.58212727704.issue20291@psf.upfronthosting.co.za> Message-ID: <1626512972.22.0.45236526942.issue20291@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 10.0 -> 11.0 pull_requests: +25749 pull_request: https://github.com/python/cpython/pull/27211 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:22:54 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Jul 2021 09:22:54 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626513774.3.0.833411762196.issue44659@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25750 pull_request: https://github.com/python/cpython/pull/27212 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:22:58 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Jul 2021 09:22:58 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626513779.0.0.43729745143.issue44659@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25751 pull_request: https://github.com/python/cpython/pull/27213 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:36:42 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 09:36:42 +0000 Subject: [issue41249] TypedDict inheritance doesn't work with get_type_hints and postponed evaluation of annotations across modules In-Reply-To: <1594252058.32.0.479050209218.issue41249@roundup.psfhosted.org> Message-ID: <1626514602.65.0.840565669234.issue41249@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fa674bdea3bbb20ad6ccd95b3849fc4995bc37e0 by Ken Jin in branch '3.9': [3.9] bpo-41249: Fix postponed annotations for TypedDict (GH-27017) (GH-27205) https://github.com/python/cpython/commit/fa674bdea3bbb20ad6ccd95b3849fc4995bc37e0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:37:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 09:37:32 +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: <1626514652.52.0.00525099285973.issue41249@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:42:40 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Sat, 17 Jul 2021 09:42:40 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626514960.31.0.56394019677.issue44618@roundup.psfhosted.org> Mauricio Villegas added the comment: Also happens in python 3.10. === Python 3.10.0b4 === (*args, **kwargs) (self, /, *args, **kwargs) Traceback (most recent call last): ... ValueError: no signature found for builtin type ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:48:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 09:48:55 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626515335.82.0.717572784795.issue44659@roundup.psfhosted.org> ?ukasz Langa added the comment: These were sad PRs to make. Take care, Ivan! ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 05:51:41 2021 From: report at bugs.python.org (Mauricio Villegas) Date: Sat, 17 Jul 2021 09:51:41 +0000 Subject: [issue44618] inspect.signature does not work for datetime classes In-Reply-To: <1626162078.24.0.194319586599.issue44618@roundup.psfhosted.org> Message-ID: <1626515501.73.0.156041633836.issue44618@roundup.psfhosted.org> Mauricio Villegas added the comment: I am not sure if this affects all built-in classes, assuming that by built-in it means that `SOMEOBJECT.__class__.__module__ == 'builtins'`. For example I have C++ library that is compiled into a python module using swig. It is available as a docker image `docker pull mauvilsa/pagexml:runtime-ubuntu20.04-py38`. For a class in that module it can be observed: >>> import inspect >>> import pagexml >>> pagexml.swigPageXML.PageXML.__class__.__module__ 'builtins' >>> print(inspect.signature(pagexml.swigPageXML.PageXML.__init__)) (self, pagexml_path=None, schema_path=None) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:01:56 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 10:01: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: <1626516116.86.0.259898293777.issue44490@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25752 pull_request: https://github.com/python/cpython/pull/27214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:10:46 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 10:10:46 +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: <1626516646.35.0.373309923787.issue43425@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d0b2b00c7d5ac3dc18d77bf4fcf607ee98c11650 by Dong-hee Na in branch 'main': bpo-43425: Remove test2to3 from Tools (#26981) https://github.com/python/cpython/commit/d0b2b00c7d5ac3dc18d77bf4fcf607ee98c11650 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:11:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 10:11:08 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626516668.22.0.195124418271.issue42095@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 689b05c6281ee6bafb9a0c0bf291260efa130f64 by Hasan in branch 'main': bpo-42095: plistlib: Add tests that compare with plutil(1) (#27173) https://github.com/python/cpython/commit/689b05c6281ee6bafb9a0c0bf291260efa130f64 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:11:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 17 Jul 2021 10:11:26 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626516686.53.0.27468232551.issue42095@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:17:13 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 17 Jul 2021 10:17:13 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626517033.58.0.80171728387.issue44645@roundup.psfhosted.org> Mark Shannon added the comment: Can we at least include the fix, until we can come up with a better test? That test fails on 3.9 as well as 3.10 and main. With a 3.9 build and the test in #27194: ./python -m test test_threading -R : 0:00:00 load avg: 0.95 Run tests sequentially 0:00:00 load avg: 0.95 [1/1] test_threading beginning 9 repetitions 123456789 ...test test_threading failed -- Traceback (most recent call last): File "/home/mark/repos/cpython/Lib/test/test_threading.py", line 1479, in test_can_interrupt_tight_loops self.assertNotEqual(iterations, 0) AssertionError: 0 == 0 I don't know what the underlying issue is. Can you observe a failure without the -R flag? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:23:02 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 10:23:02 +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: <1626517382.91.0.272117447748.issue44490@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25753 pull_request: https://github.com/python/cpython/pull/27215 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:33:33 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 10:33:33 +0000 Subject: [issue44662] Add ability to serialise and annotated types.Union Message-ID: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: It was discussed at https://bugs.python.org/issue44490 ---------- messages: 397720 nosy: uriyyo priority: normal severity: normal status: open title: Add ability to serialise and annotated types.Union type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:34:07 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 10:34:07 +0000 Subject: [issue44662] Add ability to serialise and annotated types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1626518047.59.0.573046747515.issue44662@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25754 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27214 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 06:38:01 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 10:38:01 +0000 Subject: [issue44662] Add ability to serialise and annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1626518281.17.0.81237654057.issue44662@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- title: Add ability to serialise and annotated types.Union -> Add ability to serialise and annotate types.Union _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 07:09:25 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 17 Jul 2021 11:09:25 +0000 Subject: [issue20291] Argument Clinic should understand *args and **kwargs parameters In-Reply-To: <1390010125.91.0.58212727704.issue20291@psf.upfronthosting.co.za> Message-ID: <1626520165.08.0.169962176936.issue20291@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c by Ken Jin in branch 'main': bpo-20291: Fix MSVC warnings in getargs.c (GH-27211) https://github.com/python/cpython/commit/f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 08:03:05 2021 From: report at bugs.python.org (Mark Shannon) Date: Sat, 17 Jul 2021 12:03:05 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626523385.06.0.605030772515.issue44645@roundup.psfhosted.org> Change by Mark Shannon : ---------- pull_requests: +25755 pull_request: https://github.com/python/cpython/pull/27216 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 08:30:39 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 17 Jul 2021 12:30:39 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626525039.92.0.923996900471.issue44659@roundup.psfhosted.org> Ken Jin added the comment: Thank you for everything you've done over the years for typing and its ecosystem Ivan. Take care, and please don't hesitate to add yourself back in the future if you feel like it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 10:15:49 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 17 Jul 2021 14:15:49 +0000 Subject: [issue42535] unittest.patch confuses modules with base modules In-Reply-To: <1606907650.68.0.627501426895.issue42535@roundup.psfhosted.org> Message-ID: <1626531349.36.0.154568339374.issue42535@roundup.psfhosted.org> Andrei Kulakov added the comment: I've tested this in both 3.7.7 and 3.9.1 and could not reproduce. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 10:22:18 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 17 Jul 2021 14:22:18 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626531738.09.0.584932272343.issue44659@roundup.psfhosted.org> Guido van Rossum added the comment: Many thanks from me too, Ivan. I have enjoyed working with you and will miss you. Come back any time! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 10:52:02 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 17 Jul 2021 14:52:02 +0000 Subject: [issue42469] Space in re's {min, max} should raise an error, rather than fail silently In-Reply-To: <1606374594.43.0.361161161946.issue42469@roundup.psfhosted.org> Message-ID: <1626533522.81.0.207609694756.issue42469@roundup.psfhosted.org> Andrei Kulakov added the comment: I think the biggest issue here is not how to explain it clearly in the docs, but that a lot of users will not confirm this in the docs based on the combination of: 1. c{1,5} is similar to slicing, also similar to python list definition, and python sets, all of which allow spaces for readability. 2. there is no error or warning 3. c{1,5} having one meaning and c{1, 5} having completely different meaning with no warning is deeply weird unless you think thoroughly through all of the implications. I would prefer a warning to be added. This leads to the question, where do you draw the line after which a warning is no longer added? I think I would allow this form as the most extreme where warning is still shown: c{ 1, 5 } For any extra commas, newlines, etc, I would not show warnings because they look/feel different enough vs. {1,5}. It seems to me that VERBOSE should have no effect inside of {1,5}. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 11:16:33 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 15:16:33 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626534993.55.0.424848969373.issue44653@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25757 pull_request: https://github.com/python/cpython/pull/26980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 11:16:33 2021 From: report at bugs.python.org (Yurii Karabas) Date: Sat, 17 Jul 2021 15:16:33 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626534993.42.0.683994791145.issue44633@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25756 pull_request: https://github.com/python/cpython/pull/26980 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 12:32:00 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 17 Jul 2021 16:32:00 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626539520.84.0.629138398014.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25758 pull_request: https://github.com/python/cpython/pull/27217 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 14:08:00 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 18:08:00 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626545280.33.0.161501476556.issue44633@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25759 pull_request: https://github.com/python/cpython/pull/27218 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 14:08:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 18:08:34 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626545314.09.0.984931867888.issue44633@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -25756 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 14:17:08 2021 From: report at bugs.python.org (Akuli) Date: Sat, 17 Jul 2021 18:17:08 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1626545828.78.0.884971145371.issue44592@roundup.psfhosted.org> Akuli added the comment: Here are the options: - Do nothing. My program will error in some corner cases. - Change it to return `None`, so `widget.focus_get() is not None` no longer means "this application doesn't have focus", but rather "this application doesn't have focus or the focused widget was not created in tkinter". Note that `focus_get()` can already return None, and we would just add one more situation where it does so. - Change tkinter so that it doesn't matter whether a widget was created in tkinter or not. This doesn't seem to be easy. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 14:19:16 2021 From: report at bugs.python.org (Akuli) Date: Sat, 17 Jul 2021 18:19:16 +0000 Subject: [issue44592] tkinter focus_get() with non-tkinter Tk widget In-Reply-To: <1625843658.56.0.054020011522.issue44592@roundup.psfhosted.org> Message-ID: <1626545956.89.0.736105453254.issue44592@roundup.psfhosted.org> Akuli added the comment: Typo in previous message: I meant `widget.focus_get() is None`. It currently means "this application doesn't have focus", while `is not None` currently means "this application has focus". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 15:15:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 19:15:26 +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: <1626549326.26.0.260267928348.issue44490@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 2d055ce13250a4074f66a945381a149a3cf8c46f by Serhiy Storchaka in branch '3.10': [3.10] bpo-44490: Add __parameters__ and __getitem__ to types.Union (GH-26980) (GH-27207) https://github.com/python/cpython/commit/2d055ce13250a4074f66a945381a149a3cf8c46f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 15:44:20 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 17 Jul 2021 19:44:20 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626551060.55.0.0909390159905.issue44654@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25760 pull_request: https://github.com/python/cpython/pull/27219 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 15:44:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 19:44:40 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626551080.45.0.269299509241.issue44654@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 0fd27375cabd12e68a2f12cfeca11a2d5043429e by Serhiy Storchaka in branch 'main': bpo-44654: Refactor and clean up the union type implementation (GH-27196) https://github.com/python/cpython/commit/0fd27375cabd12e68a2f12cfeca11a2d5043429e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 17:10:25 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 17 Jul 2021 21:10:25 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626556225.23.0.627825219952.issue44654@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 03aad3049d1591c76a219dfe089e5367f88f167e by Miss Islington (bot) in branch '3.10': [3.10] bpo-44654: Refactor and clean up the union type implementation (GH-27196) (GH-27219) https://github.com/python/cpython/commit/03aad3049d1591c76a219dfe089e5367f88f167e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 17:10:33 2021 From: report at bugs.python.org (Gregory Szorc) Date: Sat, 17 Jul 2021 21:10:33 +0000 Subject: [issue41949] Redefinition of HMAC functions prevents static linking In-Reply-To: <1601945210.71.0.233142859875.issue41949@roundup.psfhosted.org> Message-ID: <1626556233.82.0.881323569608.issue41949@roundup.psfhosted.org> Gregory Szorc added the comment: I think this was effectively fixed in 3.10 via commit 39258d3595300bc7b952854c915f63ae2d4b9c3e / bpo-43669, which removed code creating the duplicate symbols. It is still a problem in 3.9. But possibly not worth the backport. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 17:14:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 17 Jul 2021 21:14:40 +0000 Subject: [issue42478] ipaddress.IPv4network.interfaces() In-Reply-To: <1606433744.73.0.584174483264.issue42478@roundup.psfhosted.org> Message-ID: <1626556480.79.0.64779763621.issue42478@roundup.psfhosted.org> Andrei Kulakov added the comment: Related (with PR up): https://bugs.python.org/issue42861 ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 17:20:17 2021 From: report at bugs.python.org (Gabriel Costa) Date: Sat, 17 Jul 2021 21:20:17 +0000 Subject: [issue44663] Possible bug in datetime utc Message-ID: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> New submission from Gabriel Costa : >>> datetime.now(timezone.utc).timestamp() 1626556067.054988 >>> datetime.utcnow().timestamp() 1626566875.174921 Should there be a difference between the two modes? ---------- components: C API messages: 397733 nosy: gabhcosta priority: normal severity: normal status: open title: Possible bug in datetime utc type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 18:04:30 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 17 Jul 2021 22:04:30 +0000 Subject: [issue42861] ipaddress - add ability to get next closest network of any prefix size In-Reply-To: <1610065851.06.0.929191666424.issue42861@roundup.psfhosted.org> Message-ID: <1626559470.12.0.995991693151.issue42861@roundup.psfhosted.org> Change by Eric V. Smith : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 18:29:23 2021 From: report at bugs.python.org (Henk-Jaap Wagenaar) Date: Sat, 17 Jul 2021 22:29:23 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626560963.01.0.220586395298.issue44663@roundup.psfhosted.org> Henk-Jaap Wagenaar added the comment: I don't seem to be able to reproduce this by running this one-liner: from datetime import datetime, timezone; print(datetime.now(timezone.utc).timestamp()); print(datetime.u tcnow().timestamp()); on 3.9.5. How did you achieve this? It looks like the difference one would expect from (fast) human input). ---------- nosy: +cryvate _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 18:40:19 2021 From: report at bugs.python.org (Dan Snider) Date: Sat, 17 Jul 2021 22:40:19 +0000 Subject: [issue44664] builtins.chr and the 'c' format flag raise different errors Message-ID: <1626561619.16.0.845044555261.issue44664@roundup.psfhosted.org> New submission from Dan Snider : chr (or anything else which calls `PyUnicode_FromOrdinal`) raises ValueError if its argument falls outside the range of valid Unicode code points, while `PyUnicode_FromFormat` raises OverflowError. Shouldn't the latter raise ValueError as well? ---------- messages: 397735 nosy: bup priority: normal severity: normal status: open title: builtins.chr and the 'c' format flag raise different errors type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 19:41:41 2021 From: report at bugs.python.org (Tim Peters) Date: Sat, 17 Jul 2021 23:41:41 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626565301.23.0.809107631349.issue44663@roundup.psfhosted.org> Tim Peters added the comment: > It looks like the difference one would expect from (fast) human input) Nope, the timestamps in the original report are about 3 hours apart (10808+ seconds). Reports like these are often much clearer if they state the timezone of the system they're running on. Plausible here: as the docs say, `utcnow()` returns a _naive_ datetime - no timezone info is attached. But `.timestamp()`: """ Naive datetime instances are assumed to represent local time """ So I _expect_ the results to differ unless the box this is running on uses UTC as its local time. On my box, in native timezone CDT, the two ways are 5 hours apart, which is indeed CDT's offset from UTC. ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 20:48:53 2021 From: report at bugs.python.org (Ned Deily) Date: Sun, 18 Jul 2021 00:48:53 +0000 Subject: [issue42581] Docs site redirection doesn't work for 3.9 In-Reply-To: <1607267040.29.0.292241641932.issue42581@roundup.psfhosted.org> Message-ID: <1626569333.92.0.898107674251.issue42581@roundup.psfhosted.org> Change by Ned Deily : ---------- resolution: -> out of date stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 22:27:52 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Jul 2021 02:27:52 +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: <1626575272.71.0.713239025345.issue44490@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25761 pull_request: https://github.com/python/cpython/pull/27220 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 22:30:10 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Jul 2021 02:30:10 +0000 Subject: [issue43958] Importlib.metadata docs claim PackagePath is a Path subclass In-Reply-To: <1619551540.42.0.304542326488.issue43958@roundup.psfhosted.org> Message-ID: <1626575410.52.0.20109312218.issue43958@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25762 pull_request: https://github.com/python/cpython/pull/27221 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 22:53:22 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Jul 2021 02:53:22 +0000 Subject: [issue43958] Importlib.metadata docs claim PackagePath is a Path subclass In-Reply-To: <1619551540.42.0.304542326488.issue43958@roundup.psfhosted.org> Message-ID: <1626576802.13.0.7138096053.issue43958@roundup.psfhosted.org> miss-islington added the comment: New changeset 049e98b2b74cdcd462f31720c24ab6ebff599d9f by Miss Islington (bot) in branch '3.9': [3.9] bpo-43958: Document importlib.metadata.PackagePath.locate method (GH-25669) (GH-27221) https://github.com/python/cpython/commit/049e98b2b74cdcd462f31720c24ab6ebff599d9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 23:04:03 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 03:04:03 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1626577443.85.0.757958165994.issue44657@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 23:54:31 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 18 Jul 2021 03:54:31 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626580471.17.0.0964285085514.issue44600@roundup.psfhosted.org> Jack DeVries added the comment: @brandtbucher, is anyone working on this yet? I'd like to take a crack at it this week if it's still available! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 17 23:57:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 18 Jul 2021 03:57:06 +0000 Subject: [issue44664] builtins.chr and the 'c' format flag raise different errors In-Reply-To: <1626561619.16.0.845044555261.issue44664@roundup.psfhosted.org> Message-ID: <1626580626.25.0.801139068467.issue44664@roundup.psfhosted.org> Change by Jack DeVries : ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 00:02:11 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 18 Jul 2021 04:02:11 +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: <1626580931.78.0.857569284993.issue44490@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: -25752 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 00:10:39 2021 From: report at bugs.python.org (Jack DeVries) Date: Sun, 18 Jul 2021 04:10:39 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626581439.26.0.441851437178.issue44651@roundup.psfhosted.org> Jack DeVries added the comment: @StevenHsuYL yes, you can go ahead and create a PR for this if you'd like! Just follow the directions in the dev guide (link in sidebar). I can't really tell for sure because I'm on my phone right now, but it looks like this might be your first time contributing to cpython; welcome! If you have any questions about the process, feel free to put them here. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 01:34:16 2021 From: report at bugs.python.org (=?utf-8?b?VmVkcmFuIMSMYcSNacSH?=) Date: Sun, 18 Jul 2021 05:34:16 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626586456.23.0.234589889371.issue44663@roundup.psfhosted.org> Vedran ?a?i? added the comment: Would it be possible to change .utcnow to now return a datetime annotated with UTC "timezone"? After all, now we have timezone-aware datetimes and the convention that naive means local, this behavior might even be considered a bug. ---------- nosy: +veky _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 02:01:26 2021 From: report at bugs.python.org (Vincent Bernat) Date: Sun, 18 Jul 2021 06:01:26 +0000 Subject: [issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task Message-ID: <1626588086.28.0.802457585502.issue44665@roundup.psfhosted.org> New submission from Vincent Bernat : asyncio will only keep weak references to alive tasks (in `_all_tasks`). If a user does not keep a reference to a task and the task is not currently executing or sleeping, the user may get "Task was destroyed but it is pending!". I would suggest adding the following paragraph to `create_task()` documentation: Python only keeps weak references to the scheduled tasks. To avoid the task being destroyed by the garbage collector while still pending, a reference to it should be kept until the task is done. And maybe an example in case a user wants something "fire and forget"? ```python running_tasks = set() # [...] task = asyncio.create_task(some_background_function()) running_tasks.add(task) task.add_done_callback(lambda t: running_tasks.remove(t)) ``` The same applies to ensure_future as it now uses create_task, so maybe a "See create_task()". ---------- assignee: docs at python components: Documentation messages: 397741 nosy: bernat, docs at python priority: normal severity: normal status: open title: asyncio.create_task() documentation should mention user needs to keep reference to the task type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 03:15:50 2021 From: report at bugs.python.org (Ivan Levkivskyi) Date: Sun, 18 Jul 2021 07:15:50 +0000 Subject: [issue44659] Remove Ivan from list of typing experts In-Reply-To: <1626493324.95.0.344055297429.issue44659@roundup.psfhosted.org> Message-ID: <1626592550.83.0.784200808977.issue44659@roundup.psfhosted.org> Ivan Levkivskyi added the comment: Thank you everyone! I hope our paths will cross someday. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 03:18:22 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 18 Jul 2021 07:18:22 +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: <1626592702.36.0.445099105577.issue44490@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25763 pull_request: https://github.com/python/cpython/pull/27222 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 04:57:11 2021 From: report at bugs.python.org (=?utf-8?q?Stefan_H=C3=B6lzl?=) Date: Sun, 18 Jul 2021 08:57:11 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO Message-ID: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> New submission from Stefan H?lzl : compile_files tries to escape non-printable characters in error messages by using sys.stdout.encoding https://github.com/python/cpython/blob/main/Lib/compileall.py#L256 when using contextlib.redirect_stdout to redirect stdout to io.StringIO as explained in the documentation https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout compile_file fails, because io.StringIO has encoding set to None. see the attached file to reproduce the issue ---------- components: Library (Lib) files: compile_file_bug.py messages: 397743 nosy: stefanhoelzl priority: normal severity: normal status: open title: compileall.compile_file fails when sys.stdout is redirected to StringIO type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50156/compile_file_bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 05:09:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 09:09:22 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626599362.08.0.624871776052.issue44654@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25764 pull_request: https://github.com/python/cpython/pull/27223 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 05:10:23 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 09:10:23 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626599423.1.0.0947760400633.issue44633@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 3ea5332a4365bdd771286b3e9692495116e9ceef by Serhiy Storchaka in branch 'main': bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) https://github.com/python/cpython/commit/3ea5332a4365bdd771286b3e9692495116e9ceef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 05:10:28 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 18 Jul 2021 09:10:28 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626599428.71.0.475486604113.issue44633@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25765 pull_request: https://github.com/python/cpython/pull/27224 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 06:09:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 10:09:07 +0000 Subject: [issue44664] builtins.chr and the 'c' format flag raise different errors In-Reply-To: <1626561619.16.0.845044555261.issue44664@roundup.psfhosted.org> Message-ID: <1626602947.22.0.718248080223.issue44664@roundup.psfhosted.org> Serhiy Storchaka added the comment: Is there any example where it causes troubles? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 07:59:54 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 11:59:54 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626609594.85.0.244315667317.issue44633@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 85b58292cf94de74d028053ac33a65f269f305cb by Miss Islington (bot) in branch '3.10': bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) (GH-27224) https://github.com/python/cpython/commit/85b58292cf94de74d028053ac33a65f269f305cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 08:55:35 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 12:55:35 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626612935.35.0.599542567588.issue44654@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 8f50f44592190b5a8cb115f0d58d577036e68308 by Serhiy Storchaka in branch 'main': bpo-44654: Do not export the union type related symbols (GH-27223) https://github.com/python/cpython/commit/8f50f44592190b5a8cb115f0d58d577036e68308 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 08:56:13 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 18 Jul 2021 12:56:13 +0000 Subject: [issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all In-Reply-To: <1605349656.21.0.301673967264.issue42355@roundup.psfhosted.org> Message-ID: <1626612973.87.0.591277450744.issue42355@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset a045991f60b51636a784623dda7ad84b5b2c6b73 by Batuhan Taskaya in branch 'main': bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found (GH-23278) https://github.com/python/cpython/commit/a045991f60b51636a784623dda7ad84b5b2c6b73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 08:56:44 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 18 Jul 2021 12:56:44 +0000 Subject: [issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all In-Reply-To: <1605349656.21.0.301673967264.issue42355@roundup.psfhosted.org> Message-ID: <1626613004.08.0.329663443649.issue42355@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 08:57:56 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 12:57:56 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626613076.06.0.606339884372.issue44654@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25766 pull_request: https://github.com/python/cpython/pull/27225 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:01:37 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 13:01:37 +0000 Subject: [issue44633] Indexing the union type can return NotImplemented In-Reply-To: <1626241366.72.0.977588734187.issue44633@roundup.psfhosted.org> Message-ID: <1626613297.96.0.416656248241.issue44633@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:05:58 2021 From: report at bugs.python.org (Steven Hsu) Date: Sun, 18 Jul 2021 13:05:58 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626613558.91.0.668997874293.issue44651@roundup.psfhosted.org> Change by Steven Hsu : ---------- keywords: +patch pull_requests: +25767 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27226 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:38:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 18 Jul 2021 13:38:56 +0000 Subject: [issue44554] pdb.main is unnecessarily complicated In-Reply-To: <1625258822.01.0.642754622025.issue44554@roundup.psfhosted.org> Message-ID: <1626615536.63.0.000141061998967.issue44554@roundup.psfhosted.org> Jason R. Coombs added the comment: Additional problems I noticed while working on the refactor: - There is a lot of overlap in behavior between the implementations of _run_script and _run_module (initializing private variables, setting mainpyfile, resetting the __main__ namespace). - There are two block comments in _run_script whose behaviors apply to _run_module as well, but the block comments are not associated with those behaviors in _run_module. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:40:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 13:40:46 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626615646.84.0.798768795267.issue44549@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:47:56 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 18 Jul 2021 13:47:56 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1626616076.33.0.287880517335.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25768 pull_request: https://github.com/python/cpython/pull/27227 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:50:13 2021 From: report at bugs.python.org (Matthieu Dartiailh) Date: Sun, 18 Jul 2021 13:50:13 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline Message-ID: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> New submission from Matthieu Dartiailh : Using tokenize.py to tokenize the attached file yields: 0,0-0,0: ENCODING 'utf-8' 1,0-1,2: NAME 'if' 1,3-1,4: NAME 'a' 1,4-1,5: OP ':' 1,5-1,7: NEWLINE '\r\n' 2,0-2,4: INDENT ' ' 2,4-2,5: NAME 'b' 2,6-2,7: OP '=' 2,8-2,9: NUMBER '1' 2,9-2,11: NEWLINE '\r\n' 3,0-3,2: NL '\r\n' 4,0-4,6: COMMENT '# test' 4,6-4,6: NL '' 4,6-4,7: NEWLINE '' 5,0-5,0: DEDENT '' 5,0-5,0: ENDMARKER '' This output is wrong in that it adds 2 newlines one as a NL which is a correct and one as a NEWLINE which is not since there is no preceding code. If a new line is added at the end of the file, one gets: 0,0-0,0: ENCODING 'utf-8' 1,0-1,2: NAME 'if' 1,3-1,4: NAME 'a' 1,4-1,5: OP ':' 1,5-1,7: NEWLINE '\r\n' 2,0-2,4: INDENT ' ' 2,4-2,5: NAME 'b' 2,6-2,7: OP '=' 2,8-2,9: NUMBER '1' 2,9-2,11: NEWLINE '\r\n' 3,0-3,2: NL '\r\n' 4,0-4,6: COMMENT '# test' 4,6-4,8: NL '\r\n' 5,0-5,0: DEDENT '' 5,0-5,0: ENDMARKER '' Similarly if code is added before the comment, a single NEWLINE is generated (with no text since it is fake). The extra NEWLINE found when tokenizing the attached file can cause issue when parsing the file. It was found in https://github.com/we-like-parsers/pegen/pull/11#issuecomment-881926767 where a pure python parser based on pegen is being built. The extra NEWLINE is an issue since the grammar does not accept NEWLINE at the end of a block and cause parsing to fail using the same rules as the python grammar while the cpython parser can handle this file without any issue. I believe this issue stems from https://github.com/python/cpython/blob/3.9/Lib/tokenize.py#L605 where the check does not account for a last line limited to comments. Adding a check to determine if the line starts with a # should be sufficient to avoid emitting the extra NEWLINE. ---------- components: Library (Lib) files: no_newline_at_end_of_file_with_comment.py messages: 397750 nosy: mdartiailh priority: normal severity: normal status: open title: tokenize.py emits spurious NEWLINE if file ends on a comment without a newline type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50157/no_newline_at_end_of_file_with_comment.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 09:55:50 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sun, 18 Jul 2021 13:55:50 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626616550.37.0.478744212133.issue44651@roundup.psfhosted.org> Mark Dickinson added the comment: My one worry with removing the entry is that documentation of other projects may be referring to it via intersphinx. If we think this is likely to be a real problem, we could leave a stub entry, but I think it's okay to go ahead and delete. To be on the safe side, I would suggest that only make the change for Python 3.11, though, and we don't backport the change to earlier versions of Python. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 10:06:15 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 14:06:15 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626617175.4.0.984917123588.issue44549@roundup.psfhosted.org> Dong-hee Na added the comment: I request the dependency update to use bzip2 1.0.8 which is the stable version. https://github.com/python/cpython-source-deps/pull/25 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 10:27:25 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 18 Jul 2021 14:27:25 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1626618445.47.0.200754841997.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: -25553 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:11:48 2021 From: report at bugs.python.org (Paul Martin) Date: Sun, 18 Jul 2021 15:11:48 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626621108.53.0.402907248362.issue44663@roundup.psfhosted.org> Paul Martin added the comment: The difference between the two is the difference between your local time and utc. datetime.now(timezone.utc) This returns the current time in utc and is timezone aware. So the timestamp can figure out the seconds since epoch taking into account the timezone. datetime.utcnow() Returns the current utc time but is not timezone aware. When timestamp method is run, it is interpreted as a local timestamp. This is explained in the docs but perhaps it should be made clearer that datetime.utcnow().timestamp() is incorrect and would cause bugs. I'm not sure about changing the behaviour of utcnow to return a timezone-aware dt as is it could cause hard to detect bugs in existing code. But I did have issues recently where I was using utcnow until I went back and read the docs and changed to datetime.now(timezone.utc). So it's probably a common trap to fall into. >From the docs: " Naive datetime instances are assumed to represent local time # Note There is no method to obtain the POSIX timestamp directly from a naive datetime instance representing UTC time. If your application uses this convention and your system timezone is not set to UTC, you can obtain the POSIX timestamp by supplying tzinfo=timezone.utc: timestamp = dt.replace(tzinfo=timezone.utc).timestamp() or by calculating the timestamp directly: timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" Warning Because naive datetime objects are treated by many datetime methods as local times, it is preferred to use aware datetimes to represent times in UTC. As such, the recommended way to create an object representing the current time in UTC is by calling datetime.now(timezone.utc). " ---------- nosy: +primal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1626621991.49.0.803992194611.issue44025@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 7.0 -> 8.0 pull_requests: +25773 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1626621991.08.0.00389828423284.issue43822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25769 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1626621991.59.0.969935058575.issue32822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 7.0 -> 8.0 pull_requests: +25774 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1626621991.31.0.906771609988.issue44001@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 4.0 -> 5.0 pull_requests: +25771 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1626621991.79.0.428853573667.issue40297@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 5.0 -> 6.0 pull_requests: +25776 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1626621991.21.0.821035693041.issue44018@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 6.0 -> 7.0 pull_requests: +25770 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1626621991.4.0.951005753193.issue38352@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 8.0 -> 9.0 pull_requests: +25772 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1626621991.89.0.13372238286.issue44040@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 4.0 -> 5.0 pull_requests: +25777 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1626621991.69.0.613597351003.issue42686@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +pablogsal nosy_count: 10.0 -> 11.0 pull_requests: +25775 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:26:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:26:31 +0000 Subject: [issue35753] Importing call from unittest.mock directly causes ValueError In-Reply-To: <1547669844.88.0.953853980523.issue35753@roundup.psfhosted.org> Message-ID: <1626621991.96.0.895309220439.issue35753@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25778 pull_request: https://github.com/python/cpython/pull/27228 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:39 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:39 +0000 Subject: [issue44040] Update broken link in pathlib source In-Reply-To: <1620164626.76.0.31363753439.issue44040@roundup.psfhosted.org> Message-ID: <1626622239.34.0.0494162107118.issue44040@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25777 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:41 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:41 +0000 Subject: [issue35753] Importing call from unittest.mock directly causes ValueError In-Reply-To: <1547669844.88.0.953853980523.issue35753@roundup.psfhosted.org> Message-ID: <1626622241.98.0.416138036638.issue35753@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25778 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:36 +0000 Subject: [issue32822] finally block doesn't re-raise exception if return statement exists inside In-Reply-To: <1518387497.4.0.467229070634.issue32822@psf.upfronthosting.co.za> Message-ID: <1626622236.3.0.470026554212.issue32822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25774 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:48 +0000 Subject: [issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021 In-Reply-To: <1608391961.58.0.717857253057.issue42686@roundup.psfhosted.org> Message-ID: <1626622248.15.0.214487355064.issue42686@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25775 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:23 +0000 Subject: [issue40297] test_socket.CANTest is broken at HEAD on master In-Reply-To: <1587007502.68.0.180919322143.issue40297@roundup.psfhosted.org> Message-ID: <1626622223.46.0.869130877694.issue40297@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25776 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:54 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:54 +0000 Subject: [issue38352] In typing docs, note explicit import needed for IO and Pattern/Match In-Reply-To: <1570041077.58.0.399304866649.issue38352@roundup.psfhosted.org> Message-ID: <1626622254.93.0.99978995291.issue38352@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25772 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:59 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:59 +0000 Subject: [issue44001] typing.Literal: args must be hashable, not immutable In-Reply-To: <1619889322.68.0.709429587996.issue44001@roundup.psfhosted.org> Message-ID: <1626622259.02.0.909676495808.issue44001@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25771 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:45 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:45 +0000 Subject: [issue44025] Match doc: Clarify '_' as a soft keyword In-Reply-To: <1620093878.28.0.805814541074.issue44025@roundup.psfhosted.org> Message-ID: <1626622245.1.0.459078657081.issue44025@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25773 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:31:01 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:31:01 +0000 Subject: [issue43822] Improve syntax errors for missing commas In-Reply-To: <1618277443.81.0.695650412986.issue43822@roundup.psfhosted.org> Message-ID: <1626622261.86.0.0284947337477.issue43822@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25769 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:30:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 18 Jul 2021 15:30:52 +0000 Subject: [issue44018] random.seed mutates input bytearray In-Reply-To: <1620033218.62.0.404367985861.issue44018@roundup.psfhosted.org> Message-ID: <1626622252.18.0.422615796861.issue44018@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: -25770 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:37:49 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 15:37:49 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626622669.26.0.153773440004.issue44654@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset a6670cdf77aab2b1ee7be0b9df060dcac2a2dc48 by Serhiy Storchaka in branch '3.10': [3.10] bpo-44654: Do not export the union type related symbols (GH-27223). (GH-27225) https://github.com/python/cpython/commit/a6670cdf77aab2b1ee7be0b9df060dcac2a2dc48 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 11:51:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 15:51:27 +0000 Subject: [issue44654] Refactor and clean up the union type implementation In-Reply-To: <1626449087.45.0.570024736737.issue44654@roundup.psfhosted.org> Message-ID: <1626623487.49.0.302039815055.issue44654@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:09:51 2021 From: report at bugs.python.org (Ali mazloum) Date: Sun, 18 Jul 2021 16:09:51 +0000 Subject: [issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all In-Reply-To: <1605349656.21.0.301673967264.issue42355@roundup.psfhosted.org> Message-ID: <1626624591.21.0.338035343144.issue42355@roundup.psfhosted.org> Change by Ali mazloum : ---------- type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:11:03 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 16:11:03 +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: <1626624663.15.0.233925039656.issue44340@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25779 pull_request: https://github.com/python/cpython/pull/27231 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:31:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 16:31:20 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626625880.65.0.155988606533.issue44653@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: -25757 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:35:05 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sun, 18 Jul 2021 16:35:05 +0000 Subject: [issue42355] symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all In-Reply-To: <1605349656.21.0.301673967264.issue42355@roundup.psfhosted.org> Message-ID: <1626626105.38.0.166485494104.issue42355@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- type: security -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:35:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 16:35:30 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626626130.94.0.377653761658.issue44653@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25780 pull_request: https://github.com/python/cpython/pull/27232 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 12:40:36 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 16:40:36 +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: <1626626436.18.0.621000002733.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: I am now building the experiment environment to compare between thin-lto and full-lto ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 13:10:50 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 17:10:50 +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: <1626628250.67.0.612518425691.issue44340@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 13:18:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 18 Jul 2021 17:18:56 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1626628736.88.0.404812604401.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: Yeah, this is actively being worked on. Thanks for asking. If anything changes, I?ll let you know and you can pick it up then! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 13:21:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 17:21:30 +0000 Subject: [issue44668] More differences in instance and subclass checks between typing.Union and types.Union Message-ID: <1626628890.53.0.612385746945.issue44668@roundup.psfhosted.org> New submission from Serhiy Storchaka : 1. Checks for types.Union ignore any non-type args. Checks for typing.Union require fail on first checked non-type (but it can short circuit). >>> import typing >>> T = typing.TypeVar('T') >>> issubclass(int, int | T | str) True >>> issubclass(int, str | T | int) True >>> issubclass(int, typing.Union[int, T, str]) True >>> issubclass(int, typing.Union[str, T, int]) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 1208, in __subclasscheck__ if issubclass(cls, arg): ^^^^^^^^^^^^^^^^^^^^ TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union. >>> isinstance(1, int | T | str) True >>> isinstance(1, str | T | int) True >>> isinstance(1, typing.Union[int, T, str]) True >>> isinstance(1, typing.Union[str, T, int]) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 1204, in __instancecheck__ return self.__subclasscheck__(type(obj)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 1208, in __subclasscheck__ if issubclass(cls, arg): ^^^^^^^^^^^^^^^^^^^^ TypeError: issubclass() arg 2 must be a class, a tuple of classes, or a union. 2. __instancecheck__ of typing.Union uses __subclasscheck__ of args instead of __instancecheck__. In normal cases the result should be the same, but there should be a reason of having two different special methods. ---------- messages: 397757 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: More differences in instance and subclass checks between typing.Union and types.Union _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 13:21:45 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 18 Jul 2021 17:21:45 +0000 Subject: [issue44668] More differences in instance and subclass checks between typing.Union and types.Union In-Reply-To: <1626628890.53.0.612385746945.issue44668@roundup.psfhosted.org> Message-ID: <1626628905.49.0.20829898128.issue44668@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Library (Lib) type: -> behavior versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 16:25:01 2021 From: report at bugs.python.org (Michal D.) Date: Sun, 18 Jul 2021 20:25:01 +0000 Subject: [issue44669] TypeError: 'type' object is not subscriptable Message-ID: <1626639901.47.0.668651753174.issue44669@roundup.psfhosted.org> New submission from Michal D. : While attempting to run an application with was working before I had updated Python to the version 3.9, I had recieved following error message: ` Fatal Python error: init_import_size: Failed to import the site module Python runtime state: initialized Traceback (most recent call last): File "/usr/lib/python3.9/site.py", line 79, in import os File "/usr/lib/python3.9/os.py", line 29, in from _collections_abc import _check_methods File "/usr/lib/python3.9/_collections_abc.py", line 12, in GenericAlias = type(list[int]) TypeError: 'type' object is not subscriptable ` Any workarounds for this ? OS: Debian 10 (64-bit) ---------- messages: 397758 nosy: michal.dziczkowski priority: normal severity: normal status: open title: TypeError: 'type' object is not subscriptable type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 17:27:05 2021 From: report at bugs.python.org (Toby Spooner) Date: Sun, 18 Jul 2021 21:27:05 +0000 Subject: [issue44670] bug on showing tuple on console Message-ID: <1626643625.31.0.374965522349.issue44670@roundup.psfhosted.org> New submission from Toby Spooner : def func(a,b,c , *args , **kwargs): print(a) print(args) print(kwargs) func(2,3,4,5,Carlson=240,Shehroz="maladiss") # print(args) showing (5,). NEED TO FIX. python 3.9.6 ---------- components: Interpreter Core files: abc.png messages: 397759 nosy: kwutge priority: normal severity: normal status: open title: bug on showing tuple on console type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50158/abc.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 17:28:36 2021 From: report at bugs.python.org (Hasan) Date: Sun, 18 Jul 2021 21:28:36 +0000 Subject: [issue42095] plistlib: Add tests that compare with plutil(1) In-Reply-To: <1603178661.31.0.803001342032.issue42095@roundup.psfhosted.org> Message-ID: <1626643716.8.0.357694502758.issue42095@roundup.psfhosted.org> Hasan added the comment: You are welcome! Thanks for accepting ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 17:33:48 2021 From: report at bugs.python.org (Jarrod Price) Date: Sun, 18 Jul 2021 21:33:48 +0000 Subject: [issue44671] Create a built-in yaml module Message-ID: <1626644028.22.0.677421965462.issue44671@roundup.psfhosted.org> New submission from Jarrod Price : Would it be possible for someone to take the time to create a built-in yaml module based on the current spec (v1.2) ? https://yaml.org/spec/1.2/spec.html Just like how we can do `import json`, there is currently no `import yaml`. I myself (and I assume others too) would much prefer to be able to create/save/load/edit yaml as if it were a dictionary. I am one of those guys that don?t really like to install external modules and I much prefer to just use the batteries included modules. ---------- messages: 397761 nosy: jarpri08 priority: normal severity: normal status: open title: Create a built-in yaml module type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 17:36:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sun, 18 Jul 2021 21:36:41 +0000 Subject: [issue44670] bug on showing tuple on console In-Reply-To: <1626643625.31.0.374965522349.issue44670@roundup.psfhosted.org> Message-ID: <1626644201.42.0.00355661275928.issue44670@roundup.psfhosted.org> Dennis Sweeney added the comment: I don't know what behavior you were expecting, but *args means "the rest of the positional arguments", not "all of the positional arguments." See https://docs.python.org/3/tutorial/controlflow.html?highlight=variadic#arbitrary-argument-lists ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 19:03:16 2021 From: report at bugs.python.org (Zachary Ware) Date: Sun, 18 Jul 2021 23:03:16 +0000 Subject: [issue44670] bug on showing tuple on console In-Reply-To: <1626643625.31.0.374965522349.issue44670@roundup.psfhosted.org> Message-ID: <1626649396.69.0.0131110127779.issue44670@roundup.psfhosted.org> Zachary Ware added the comment: As Dennis said, this isn't a bug. Try printing `b` and `c` as well, and you'll find 3 and 4. ---------- nosy: +zach.ware resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 19:07:52 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sun, 18 Jul 2021 23:07:52 +0000 Subject: [issue22240] argparse support for "python -m module" in help In-Reply-To: <1408564751.42.0.897410433728.issue22240@psf.upfronthosting.co.za> Message-ID: <1626649672.1.0.995528283608.issue22240@roundup.psfhosted.org> Nils Kattenbeck added the comment: I am not sure if the patch correctly handles calling a nested module (e.g. `python3 -m serial.tools.miniterm`). Would it also be possible to detect if python or python3 was used for the invocation? ---------- nosy: +Nils Kattenbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 19:18:53 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 23:18:53 +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: <1626650333.75.0.665169849373.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: FYI, Thin LTO shows enhanced build time. Full LTO (./configure --with-lto=full CC=clang) real 2m33.740s user 8m25.695s sys 0m13.124s Thin LTO (./configure --with-lto=thin CC=clang) real 1m51.867s user 12m53.694s sys 0m12.786s ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 19:47:12 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 23:47:12 +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: <1626652032.92.0.574164694607.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: The test is executed under the following environments. There is no significant performance changed. MS Azure: D8s v3 CentOS Linux release 8.2.2004 (Core) [corona10 at PythonLinux cpython]$ ./python -m pyperformance compare full.json thin.json full.json ========= Performance version: 1.0.2 Report on Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28 Number of logical CPUs: 8 Start date: 2021-07-18 23:18:04.644067 End date: 2021-07-18 23:44:20.951457 thin.json ========= Performance version: 1.0.2 Report on Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.28 Number of logical CPUs: 8 Start date: 2021-07-18 22:46:00.717563 End date: 2021-07-18 23:12:19.376766 ### 2to3 ### Mean +- std dev: 570 ms +- 17 ms -> 568 ms +- 20 ms: 1.00x faster Not significant ### chameleon ### Mean +- std dev: 16.9 ms +- 0.6 ms -> 16.9 ms +- 0.9 ms: 1.00x slower Not significant ### chaos ### Mean +- std dev: 182 ms +- 7 ms -> 179 ms +- 7 ms: 1.02x faster Not significant ### crypto_pyaes ### Mean +- std dev: 198 ms +- 6 ms -> 192 ms +- 6 ms: 1.03x faster Significant (t=5.26) ### deltablue ### Mean +- std dev: 13.4 ms +- 0.5 ms -> 13.5 ms +- 0.5 ms: 1.01x slower Not significant ### django_template ### Mean +- std dev: 94.0 ms +- 3.2 ms -> 91.8 ms +- 3.7 ms: 1.02x faster Significant (t=3.53) ### dulwich_log ### Mean +- std dev: 178 ms +- 6 ms -> 176 ms +- 8 ms: 1.02x faster Not significant ### fannkuch ### Mean +- std dev: 764 ms +- 17 ms -> 755 ms +- 15 ms: 1.01x faster Not significant ### float ### Mean +- std dev: 194 ms +- 8 ms -> 187 ms +- 6 ms: 1.03x faster Significant (t=4.95) ### go ### Mean +- std dev: 388 ms +- 14 ms -> 387 ms +- 14 ms: 1.00x faster Not significant ### hexiom ### Mean +- std dev: 17.0 ms +- 0.7 ms -> 17.5 ms +- 0.8 ms: 1.03x slower Significant (t=-3.40) ### json_dumps ### Mean +- std dev: 22.5 ms +- 0.9 ms -> 22.3 ms +- 0.7 ms: 1.01x faster Not significant ### json_loads ### Mean +- std dev: 45.8 us +- 2.3 us -> 46.5 us +- 1.8 us: 1.02x slower Not significant ### logging_format ### Mean +- std dev: 19.1 us +- 0.9 us -> 18.7 us +- 0.7 us: 1.02x faster Not significant ### logging_silent ### Mean +- std dev: 336 ns +- 17 ns -> 334 ns +- 18 ns: 1.00x faster Not significant ### logging_simple ### Mean +- std dev: 17.1 us +- 0.8 us -> 16.7 us +- 0.8 us: 1.03x faster Significant (t=3.12) ### mako ### Mean +- std dev: 27.6 ms +- 1.6 ms -> 26.6 ms +- 0.9 ms: 1.04x faster Significant (t=4.11) ### meteor_contest ### Mean +- std dev: 172 ms +- 5 ms -> 169 ms +- 5 ms: 1.01x faster Not significant ### nbody ### Mean +- std dev: 232 ms +- 8 ms -> 224 ms +- 8 ms: 1.04x faster Significant (t=6.03) ### nqueens ### Mean +- std dev: 167 ms +- 7 ms -> 166 ms +- 7 ms: 1.00x faster Not significant ### pathlib ### Mean +- std dev: 38.2 ms +- 1.7 ms -> 37.4 ms +- 1.9 ms: 1.02x faster Significant (t=2.41) ### pickle ### Mean +- std dev: 19.4 us +- 0.8 us -> 19.5 us +- 0.8 us: 1.00x slower Not significant ### pickle_dict ### Mean +- std dev: 43.5 us +- 1.9 us -> 43.0 us +- 1.9 us: 1.01x faster Not significant ### pickle_list ### Mean +- std dev: 6.81 us +- 0.26 us -> 6.81 us +- 0.27 us: 1.00x slower Not significant ### pickle_pure_python ### Mean +- std dev: 840 us +- 28 us -> 825 us +- 28 us: 1.02x faster Not significant ### pidigits ### Mean +- std dev: 294 ms +- 9 ms -> 294 ms +- 9 ms: 1.00x slower Not significant ### pyflate ### Mean +- std dev: 1.17 sec +- 0.02 sec -> 1.16 sec +- 0.03 sec: 1.01x faster Not significant ### python_startup ### Mean +- std dev: 15.3 ms +- 0.6 ms -> 15.3 ms +- 0.6 ms: 1.00x faster Not significant ### python_startup_no_site ### Mean +- std dev: 10.3 ms +- 0.3 ms -> 10.2 ms +- 0.4 ms: 1.01x faster Not significant ### raytrace ### Mean +- std dev: 911 ms +- 19 ms -> 911 ms +- 21 ms: 1.00x faster Not significant ### regex_compile ### Mean +- std dev: 314 ms +- 12 ms -> 310 ms +- 10 ms: 1.01x faster Not significant ### regex_dna ### Mean +- std dev: 317 ms +- 10 ms -> 299 ms +- 9 ms: 1.06x faster Significant (t=9.99) ### regex_effbot ### Mean +- std dev: 6.20 ms +- 0.27 ms -> 5.80 ms +- 0.25 ms: 1.07x faster Significant (t=8.49) ### regex_v8 ### Mean +- std dev: 43.0 ms +- 1.3 ms -> 39.9 ms +- 1.9 ms: 1.08x faster Significant (t=10.22) ### richards ### Mean +- std dev: 158 ms +- 8 ms -> 157 ms +- 8 ms: 1.01x faster Not significant ### scimark_fft ### Mean +- std dev: 727 ms +- 18 ms -> 716 ms +- 18 ms: 1.02x faster Not significant ### scimark_lu ### Mean +- std dev: 309 ms +- 11 ms -> 304 ms +- 10 ms: 1.01x faster Not significant ### scimark_monte_carlo ### Mean +- std dev: 180 ms +- 6 ms -> 181 ms +- 8 ms: 1.00x slower Not significant ### scimark_sor ### Mean +- std dev: 355 ms +- 9 ms -> 352 ms +- 11 ms: 1.01x faster Not significant ### scimark_sparse_mat_mult ### Mean +- std dev: 9.51 ms +- 0.32 ms -> 9.19 ms +- 0.34 ms: 1.03x faster Significant (t=5.27) ### spectral_norm ### Mean +- std dev: 277 ms +- 10 ms -> 272 ms +- 9 ms: 1.02x faster Not significant ### sqlalchemy_declarative ### Mean +- std dev: 273 ms +- 10 ms -> 273 ms +- 10 ms: 1.00x faster Not significant ### sqlalchemy_imperative ### Mean +- std dev: 46.2 ms +- 2.3 ms -> 45.6 ms +- 2.1 ms: 1.01x faster Not significant ### sqlite_synth ### Mean +- std dev: 4.39 us +- 0.29 us -> 4.37 us +- 0.23 us: 1.00x faster Not significant ### sympy_expand ### Mean +- std dev: 996 ms +- 22 ms -> 993 ms +- 31 ms: 1.00x faster Not significant ### sympy_integrate ### Mean +- std dev: 42.6 ms +- 1.9 ms -> 43.5 ms +- 2.0 ms: 1.02x slower Significant (t=-2.47) ### sympy_str ### Mean +- std dev: 607 ms +- 18 ms -> 599 ms +- 15 ms: 1.01x faster Not significant ### sympy_sum ### Mean +- std dev: 350 ms +- 12 ms -> 344 ms +- 11 ms: 1.02x faster Not significant ### telco ### Mean +- std dev: 11.3 ms +- 0.6 ms -> 11.2 ms +- 0.6 ms: 1.01x faster Not significant ### tornado_http ### Mean +- std dev: 294 ms +- 11 ms -> 296 ms +- 12 ms: 1.01x slower Not significant ### unpack_sequence ### Mean +- std dev: 78.4 ns +- 7.1 ns -> 75.7 ns +- 2.5 ns: 1.04x faster Significant (t=2.86) ### unpickle ### Mean +- std dev: 26.1 us +- 1.1 us -> 27.3 us +- 1.3 us: 1.05x slower Significant (t=-5.57) ### unpickle_list ### Mean +- std dev: 6.65 us +- 0.21 us -> 6.68 us +- 0.31 us: 1.00x slower Not significant ### unpickle_pure_python ### Mean +- std dev: 567 us +- 21 us -> 572 us +- 21 us: 1.01x slower Not significant ### xml_etree_generate ### Mean +- std dev: 165 ms +- 8 ms -> 166 ms +- 8 ms: 1.00x slower Not significant ### xml_etree_iterparse ### Mean +- std dev: 187 ms +- 6 ms -> 187 ms +- 8 ms: 1.00x faster Not significant ### xml_etree_parse ### Mean +- std dev: 274 ms +- 10 ms -> 274 ms +- 11 ms: 1.00x slower Not significant ### xml_etree_process ### Mean +- std dev: 142 ms +- 6 ms -> 139 ms +- 6 ms: 1.02x faster Not significant ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 19:53:02 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 18 Jul 2021 23:53:02 +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: <1626652382.43.0.169895178136.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: clang version 11.0.0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:10:51 2021 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 19 Jul 2021 00:10:51 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626653451.59.0.672022386856.issue44561@roundup.psfhosted.org> Nick Coghlan added the comment: New changeset b494685b2548489efcc66993cc6c13b027ce3b26 by Steven Hsu in branch 'main': bpo-44561: Update hyperlinks in Doc/distributing/index.rst (#27032) https://github.com/python/cpython/commit/b494685b2548489efcc66993cc6c13b027ce3b26 ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:12:16 2021 From: report at bugs.python.org (Nick Coghlan) Date: Mon, 19 Jul 2021 00:12:16 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626653536.96.0.130431144764.issue44561@roundup.psfhosted.org> Change by Nick Coghlan : ---------- stage: patch review -> backport needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:14:00 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 00:14:00 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626653640.47.0.157261135096.issue44561@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25782 pull_request: https://github.com/python/cpython/pull/27234 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:13:54 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 00:13:54 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626653634.67.0.539324202852.issue44561@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25781 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/27233 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:16:00 2021 From: report at bugs.python.org (Tim Peters) Date: Mon, 19 Jul 2021 00:16:00 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626653760.6.0.854546545588.issue44663@roundup.psfhosted.org> Tim Peters added the comment: If you want to pursue changing what utcnow() does, python-ideas or python-dev would probably need to be involved. Backward-incompatible changes are very hard sells. As Paul Ganssle noted here, https://blog.ganssle.io/articles/2019/11/utcnow.html in Python 2, na?ve datetimes generally did _not_ get treated as "being in local time", ever. They refused to pretend they had any opinion about time zone, and operations like .timestamp() (just "like", because .timestamp() didn't exist in Python 2) raised an exception when applied to a na?ve datetime. Which, IMO, Python 3 should have stuck with. "Na?ve time" was never intended to be a synonym for "local time" - or for UTC time - or for any other timezone-aware notion of time. But as Paul also said, if Python 2 had concrete tzinfo classes to begin with, it's a pretty safe bet `utcnow()` would never have existed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:34:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 00:34:51 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626654891.21.0.138225245066.issue44561@roundup.psfhosted.org> miss-islington added the comment: New changeset bce2847169e181ae894b323b9d5c31b0a3bec621 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) (GH-27234) https://github.com/python/cpython/commit/bce2847169e181ae894b323b9d5c31b0a3bec621 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:39:08 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 00:39:08 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626655148.67.0.56763020749.issue44561@roundup.psfhosted.org> miss-islington added the comment: New changeset 2f643b1a8cd53f3c2f49f931bc98990a3b400495 by Miss Islington (bot) in branch '3.9': [3.9] bpo-44561: Update hyperlinks in Doc/distributing/index.rst (GH-27032) (GH-27233) https://github.com/python/cpython/commit/2f643b1a8cd53f3c2f49f931bc98990a3b400495 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:45:34 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 19 Jul 2021 00:45:34 +0000 Subject: [issue43086] Excess data in not handled properly in binascii.a2b_base64() In-Reply-To: <1612116712.99.0.535653486799.issue43086@roundup.psfhosted.org> Message-ID: <1626655534.14.0.566064509049.issue43086@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 35b98e38b6edd63153fc8e092f94cb20725dacc1 by Idan Moral in branch 'main': bpo-43086: Add handling for out-of-spec data in a2b_base64 (GH-24402) https://github.com/python/cpython/commit/35b98e38b6edd63153fc8e092f94cb20725dacc1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 20:56:06 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 19 Jul 2021 00:56:06 +0000 Subject: [issue43086] Excess data in not handled properly in binascii.a2b_base64() In-Reply-To: <1612116712.99.0.535653486799.issue43086@roundup.psfhosted.org> Message-ID: <1626656166.95.0.0287592840228.issue43086@roundup.psfhosted.org> Gregory P. Smith added the comment: I've merged Idan's PR adding a strict_mode parameter to a2b_base64. It defaults to False for backwards compatibility. >From a security perspective, it'd be _ideal_ if this were True. But I expect doing that would break a bunch of existing code and tests that has been relying on some of the former leniency behaviors so I recommended the conservative approach of the old-behavior default. It'd be a good thing to change it to True, but disruptive. We need motivating reason to do that. As it is a new feature due to the new parameter, this is for 3.11. Workaround for Pythons without this: do a validity check before calling a2b_base64. I suspect a regex could be constructed for that if you're careful. If you come up with one, please share it here. ---------- components: +Extension Modules resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 21:01:04 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 01:01:04 +0000 Subject: [issue44554] pdb.main is unnecessarily complicated In-Reply-To: <1625258822.01.0.642754622025.issue44554@roundup.psfhosted.org> Message-ID: <1626656464.8.0.903271119116.issue44554@roundup.psfhosted.org> miss-islington added the comment: New changeset 2c2055884420f22afb4d2045bbdab7aa1394cb63 by Jason R. Coombs in branch 'main': bpo-44554: refactor pdb targets (and internal tweaks) (GH-26992) https://github.com/python/cpython/commit/2c2055884420f22afb4d2045bbdab7aa1394cb63 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 21:05:10 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 01:05:10 +0000 Subject: [issue44668] More differences in instance and subclass checks between typing.Union and types.Union In-Reply-To: <1626628890.53.0.612385746945.issue44668@roundup.psfhosted.org> Message-ID: <1626656710.32.0.682381380208.issue44668@roundup.psfhosted.org> Guido van Rossum added the comment: This seems a low-priority issue to me. The code is invalid, but I don't think it's very important to raise an exception (typing.Union is also inconsistent). Static type checkers will flag all these as errors. (Or perhaps none of them? It may depend on the meaning of T in the current scope.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 22:48:03 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Mon, 19 Jul 2021 02:48:03 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626662883.75.0.0621557841365.issue44561@roundup.psfhosted.org> ?ric Araujo added the comment: This can be closed. Thanks for the patch! For next time, such small doc fixes don?t need a NEWS entry. ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 18 23:00:55 2021 From: report at bugs.python.org (Steven Hsu) Date: Mon, 19 Jul 2021 03:00:55 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1626663655.51.0.613723218712.issue44561@roundup.psfhosted.org> Steven Hsu added the comment: Thanks for reminding. In the beginning, I didn't add a NEWS entry in the PR (#27032). However, after 11 days when there was no progress of the PR, I doubted that maybe I missed something, so I made a NEWS entry to make sure. And soon after the NEWS entry was added, the PR was processed quickly. Anyway, it's a interesting experience for me, and thanks again! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 02:02:17 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Jul 2021 06:02:17 +0000 Subject: [issue44668] More differences in instance and subclass checks between typing.Union and types.Union In-Reply-To: <1626628890.53.0.612385746945.issue44668@roundup.psfhosted.org> Message-ID: <1626674537.9.0.427235313996.issue44668@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is easy to fix once we define the correct behavior in corner cases. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 03:20:39 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 19 Jul 2021 07:20:39 +0000 Subject: [issue44669] TypeError: 'type' object is not subscriptable In-Reply-To: <1626639901.47.0.668651753174.issue44669@roundup.psfhosted.org> Message-ID: <1626679239.61.0.62656732361.issue44669@roundup.psfhosted.org> Dennis Sweeney added the comment: > While attempting to run an application How are you starting this application? It looks like you're using Python 3.9 standard library files (like _collections_abc.py in the traceback you posted), but is it possible that you're accidentally running an older version of the interpreter? ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 03:46:48 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Mon, 19 Jul 2021 07:46:48 +0000 Subject: [issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault In-Reply-To: <1626020381.6.0.201295772935.issue44598@roundup.psfhosted.org> Message-ID: <1626680808.09.0.260553913315.issue44598@roundup.psfhosted.org> Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) added the comment: ran on 3.9.6 branch with OpenSSL 1.1.1k 25 Mar 2021. I see this warning in the console. Please also see the attached log for full details. /Users/srini/workspace/consulting/cpython/Lib/test/support/__init__.py:3105: ResourceWarning: unclosed del self.thread ResourceWarning: Enable tracemalloc to get the object allocation traceback ---------- nosy: +thatiparthy Added file: https://bugs.python.org/file50159/log _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 05:19:06 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 19 Jul 2021 09:19:06 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1626686346.48.0.582318173758.issue41546@roundup.psfhosted.org> Irit Katriel added the comment: New changeset aab1899c9d79083c1ff31d974ed8b562d3ca3b5d by Irit Katriel in branch 'main': bpo-41546: make pprint (like print) not write to stdout when it is None (GH-26810) https://github.com/python/cpython/commit/aab1899c9d79083c1ff31d974ed8b562d3ca3b5d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 05:20:09 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 19 Jul 2021 09:20:09 +0000 Subject: [issue41546] pprint() gives exception when ran from pythonw In-Reply-To: <1597363804.39.0.98824418874.issue41546@roundup.psfhosted.org> Message-ID: <1626686409.35.0.703429211508.issue41546@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:10:33 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 10:10:33 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626689433.47.0.438316616485.issue44645@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25783 pull_request: https://github.com/python/cpython/pull/27235 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:10:49 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 19 Jul 2021 10:10:49 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626689449.35.0.76443263806.issue44645@roundup.psfhosted.org> Mark Shannon added the comment: New changeset d09c13417890427f829e3df297beb0e27133f8f4 by Mark Shannon in branch 'main': bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) https://github.com/python/cpython/commit/d09c13417890427f829e3df297beb0e27133f8f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:13:31 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 10:13:31 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626689611.79.0.458281760689.issue44661@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 635bfe8162981332b36cc556bac78e869af579c2 by Dong-hee Na in branch 'main': bpo-44661: Update property_descr_set to use vectorcall if possible. (GH-27206) https://github.com/python/cpython/commit/635bfe8162981332b36cc556bac78e869af579c2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:14:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 10:14:43 +0000 Subject: [issue44661] Update property_descr_set to use vectorcall if possible. In-Reply-To: <1626499183.47.0.424501329703.issue44661@roundup.psfhosted.org> Message-ID: <1626689683.45.0.122657159798.issue44661@roundup.psfhosted.org> Dong-hee Na added the comment: class Person: def __init__(self): self.__age = 0 @property def age(self): return self.__age @age.setter def age(self, value): self.__age = value p = Person() p.age = 10 # Now become faster ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:53:01 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 10:53:01 +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: <1626691981.32.0.203289056605.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset b2cf2513f9184c850a69fab718532b4f7c6a003d by Dong-hee Na in branch 'main': bpo-44340: Add support for building with clang full/thin lto (GH-27231) https://github.com/python/cpython/commit/b2cf2513f9184c850a69fab718532b4f7c6a003d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:53:19 2021 From: report at bugs.python.org (=?utf-8?q?Stefan_H=C3=B6lzl?=) Date: Mon, 19 Jul 2021 10:53:19 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1626691999.74.0.845147232954.issue44666@roundup.psfhosted.org> Change by Stefan H?lzl : ---------- keywords: +patch pull_requests: +25784 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27236 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:55:07 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 10:55:07 +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: <1626692107.74.0.752218138188.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: Now CPython 3.11 supports the Thin LTO, Thank you for the report and contribution, Brett! And also thank you Pablo and Gregory for the reviews! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:55:14 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 10:55: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: <1626692114.36.0.631538327873.issue44340@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 Jul 19 06:57:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 10:57:33 +0000 Subject: [issue41972] bytes.find consistently hangs in a particular scenario In-Reply-To: <1602113519.53.0.297229304628.issue41972@roundup.psfhosted.org> Message-ID: <1626692253.99.0.753735526001.issue41972@roundup.psfhosted.org> ?ukasz Langa added the comment: I checked the original example in this issue and the newest change in GH-27091 makes the `data.find(base)` case 8.2% faster compared to `main` while the `data.find(longer)` case is 10.8% faster. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 06:58:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 10:58:44 +0000 Subject: [issue41972] bytes.find consistently hangs in a particular scenario In-Reply-To: <1602113519.53.0.297229304628.issue41972@roundup.psfhosted.org> Message-ID: <1626692324.83.0.907566042406.issue41972@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d01dceb88b2ca6def8a2284e4c90f89a4a27823f by Dennis Sweeney in branch 'main': bpo-41972: Tweak fastsearch.h string search algorithms (GH-27091) https://github.com/python/cpython/commit/d01dceb88b2ca6def8a2284e4c90f89a4a27823f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 07:07:07 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 11:07:07 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626692827.65.0.945358482531.issue44524@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch nosy: +uriyyo nosy_count: 5.0 -> 6.0 pull_requests: +25786 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27237 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 07:16:15 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 19 Jul 2021 11:16:15 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1626693375.0.0.788159455037.issue44645@roundup.psfhosted.org> Mark Shannon added the comment: New changeset 37bdd2221ce3607a81d5d7fafc4603d95ca3e8cb by Miss Islington (bot) in branch '3.10': bpo-44645: Check for interrupts on any potentially backwards edge (GH-27216) (GH-27235) https://github.com/python/cpython/commit/37bdd2221ce3607a81d5d7fafc4603d95ca3e8cb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 07:26:37 2021 From: report at bugs.python.org (Lars) Date: Mon, 19 Jul 2021 11:26:37 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626693997.71.0.870383859799.issue44524@roundup.psfhosted.org> Lars added the comment: Happy to see progress on this issue and I can see that adding these attributes to the ABC's in typing makes the most sense. However for my direct use-case (simplified: using Any in a type checking descriptor) it would be really practical to have the __name__ (and perhaps __qualname__ and __module__) attributes in the Any type. This is mainly for consistent logging/printing purposes. Since Any already has a _name attribute, changing this to __name__ might achieve this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 08:03:13 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 19 Jul 2021 12:03:13 +0000 Subject: [issue44672] Final "pass" is traced incorrectly in 3.9 (and before) Message-ID: <1626696193.12.0.565896913641.issue44672@roundup.psfhosted.org> New submission from Ned Batchelder : A simple function with a last "pass" statement gets traced incorrectly, attributing the return to the pass instead of the actual last statement executed: --- 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 wrong_loop(x): if x: if x: print(4) else: pass print(sys.version) sys.settrace(trace) wrong_loop(8) ---------------------------------- On 3.9 and before, this produces: 3.9.5 (default, May 5 2021, 06:50:43) [Clang 12.0.0 (clang-1200.0.32.29)] call 10: def wrong_loop(x): line 11: if x: line 12: if x: line 13: print(4) 4 line 15: pass retu 15: pass Partly I'm writing this issue to record the problem, but partly to get a decision: will there be fixes made to 3.9 (or before) for issues like this? ---------- components: Interpreter Core messages: 397791 nosy: Mark.Shannon, nedbat priority: normal severity: normal status: open title: Final "pass" is traced incorrectly in 3.9 (and before) type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 08:36:07 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 19 Jul 2021 12:36:07 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1626698167.43.0.561646061461.issue42238@roundup.psfhosted.org> Change by Julien Palard : ---------- pull_requests: +25787 pull_request: https://github.com/python/cpython/pull/27238 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 08:44:00 2021 From: report at bugs.python.org (Julien Palard) Date: Mon, 19 Jul 2021 12:44:00 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1626698640.05.0.927682968102.issue42238@roundup.psfhosted.org> Julien Palard added the comment: Another one \o/ Fix in: https://github.com/python/cpython/pull/27238 It is: :func:pdb.main Detected by make suspicious as: WARNING: [whatsnew/changelog:320] ":func" found in ": Refactor argument processing in :func:pdb.main to simplify" WARNING: [whatsnew/changelog:320] ":pdb" found in ": Refactor argument processing in :func:pdb.main to simplify" I added a test in the same PR to spot this one in rstlint. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 08:47:05 2021 From: report at bugs.python.org (Daan Luttik) Date: Mon, 19 Jul 2021 12:47:05 +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: <1626698825.29.0.840502709955.issue17088@roundup.psfhosted.org> Daan Luttik added the comment: Is there any workaround for this? this bug still seems to be present in python 3.9.6. ---------- nosy: +dtluttik versions: +Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 08:58:02 2021 From: report at bugs.python.org (Stefan Behnel) Date: Mon, 19 Jul 2021 12:58:02 +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: <1626699482.93.0.183570501553.issue17088@roundup.psfhosted.org> Stefan Behnel added the comment: The obvious work-around is to not use a default namespace. The result is just a visual difference, not a semantic one. If someone wants to continue with the existing PR, I'll try to free some time to review any improvements. ---------- versions: +Python 3.10, Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 09:19:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 13:19:32 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626700772.66.0.907337852708.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: > I think __module__ should be set to ?typing?, and __qualname__ to ?typing.WhatEver?. PEP 3155 specifies that `__qualname__` does not include the module name: https://www.python.org/dev/peps/pep-3155/#excluding-the-module-name Rather, it's for nested classes and classes created in local scopes. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 09:38:03 2021 From: report at bugs.python.org (Vinay Sajip) Date: Mon, 19 Jul 2021 13:38:03 +0000 Subject: [issue44624] Script name for venv PowerShell activate In-Reply-To: <1626188651.64.0.496215753263.issue44624@roundup.psfhosted.org> Message-ID: <1626701883.54.0.838297359472.issue44624@roundup.psfhosted.org> Vinay Sajip added the comment: In this case, there are two reasons IMO for not doing this: 1. Backward compatibility might be affected. 2. It may be more important to conform to venv conventions than Powershell conventions in this specific case. I wasn't aware that PowerShell scripts out in the wild follow these namig conventions rigidly - that hasn't been my experience. Is it the case? Who polices that? Of course, in environments that mandate this level of conformance, you can easily subclass and override the relevant functionality to have the script be named exactly how you want. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 09:42:09 2021 From: report at bugs.python.org (emve) Date: Mon, 19 Jul 2021 13:42:09 +0000 Subject: [issue44673] Embedded Python - local directories in pythonXX._pth Message-ID: <1626702129.3.0.0436089797565.issue44673@roundup.psfhosted.org> New submission from emve : When I add mylib to python39._pth, Python treats it relatively to c:\Python3 (where my embedded python resides). >>> import sys >>> print('\n'.join(sys.path)) c:\python3\python39.zip c:\python3 c:\python3\lib c:\python3\mylib c:\python3\lib\site-packages >>> However, my mylib directory is in my current project directory, which is obviously not under c:\Python3 I know that the solution is to enter full path to mylib into python39._pth, but it is quite unconvenient as I have multiple projects, each with its own local modules in mylib directory. Is there a way to simply add only one mylib entry into python39._pth? ---------- messages: 397797 nosy: emve priority: normal severity: normal status: open title: Embedded Python - local directories in pythonXX._pth type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 09:43:52 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 19 Jul 2021 13:43:52 +0000 Subject: [issue44672] Final "pass" is traced incorrectly in 3.9 (and before) In-Reply-To: <1626696193.12.0.565896913641.issue44672@roundup.psfhosted.org> Message-ID: <1626702232.56.0.0562520374728.issue44672@roundup.psfhosted.org> Mark Shannon added the comment: I say no, for a couple of reasons. 1. PEP 626 only applies to 3.10 onwards 2. The bytecode optimizer in 3.9 doesn't understand line numbers. Changing it would be a lot of effort and likely to introduce more bugs than it fixes. Ultimately it is ?ukasz's decision, though. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:06:32 2021 From: report at bugs.python.org (Gianni Mariani) Date: Mon, 19 Jul 2021 14:06:32 +0000 Subject: [issue44674] dataclasses should allow frozendict default value Message-ID: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> New submission from Gianni Mariani : Using a frozendict as a default value should not cause an error in dataclasses. The check for mutability is: isinstance(f.default, (list, dict, set)) It appears frozendict has been changed to have a dict base class and it now raises an exception. There should be a way to indicate object mutability as the purpose of the isinstance(f.default, (list, dict, set)) check is for mutable default values. Using default_factory to work around this issue is cumbersome. ---------- components: Library (Lib) messages: 397799 nosy: gianni priority: normal severity: normal status: open title: dataclasses should allow frozendict default value type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:18:38 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 19 Jul 2021 14:18:38 +0000 Subject: [issue44674] dataclasses should allow frozendict default value In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> Message-ID: <1626704318.21.0.267344061227.issue44674@roundup.psfhosted.org> Eric V. Smith added the comment: I agree that would be an improvement. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:23:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 14:23:25 +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: <1626704605.82.0.145168714426.issue44490@roundup.psfhosted.org> Guido van Rossum added the comment: New changeset a2721649598eb715304a1ac8678a409585f73b27 by Ken Jin in branch '3.10': bpo-44490: Improve typing module compatibility with types.Union (GH-27048) (#27222) https://github.com/python/cpython/commit/a2721649598eb715304a1ac8678a409585f73b27 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:34:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 14:34:56 +0000 Subject: [issue42238] Deprecate suspicious.py? In-Reply-To: <1604274563.95.0.828690163802.issue42238@roundup.psfhosted.org> Message-ID: <1626705296.96.0.554892765217.issue42238@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fbf10080bb369cfef1f230c2cd5135a558b242d5 by Julien Palard in branch 'main': bpo-42238: Fix small rst issue in NEWS.d/. (#27238) https://github.com/python/cpython/commit/fbf10080bb369cfef1f230c2cd5135a558b242d5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:56:50 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 19 Jul 2021 14:56:50 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626706610.55.0.123439603671.issue44653@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy, this doesn't just affect typing.Union, it seems that the rest of the typing types don't substitute: >>> (int | T)[typing.List[str]] Traceback (most recent call last): File "", line 1, in TypeError: Each union arg must be a type, got typing.List[str] We should probably loosen the check during the union_getitem substitution -- no need to raise the TypeError or check for is_union, just blindly replace the TypeVar. We already do this for types.GenericAlias: >>> list[T][1] list[1] Or if you want to continue checking, maybe checking for PyCallable_Check(obj) in substitution is enough - typing internally accepts callable(o) too: https://github.com/python/cpython/blob/3.10/Lib/typing.py#L146 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 10:59:22 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 19 Jul 2021 14:59:22 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626706762.84.0.805826657602.issue44524@roundup.psfhosted.org> Ken Jin added the comment: Yurii has a working PR for __name__ in _BaseGenericAlias, but not for _SpecialForm yet. Guido and/or Lukasz, do y'all think we should support __name__ and __qualname__ for special forms too? Personally I don't see how it'd hurt and I'm +1 for this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:25:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 15:25:54 +0000 Subject: [issue41972] bytes.find consistently hangs in a particular scenario In-Reply-To: <1602113519.53.0.297229304628.issue41972@roundup.psfhosted.org> Message-ID: <1626708354.67.0.847265838721.issue41972@roundup.psfhosted.org> ?ukasz Langa added the comment: Looks like this can be closed now, the original issue is fixed, the original patch is merged for 3.10, and the improved patch is merged for 3.11. Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:27:39 2021 From: report at bugs.python.org (R. David Murray) Date: Mon, 19 Jul 2021 15:27:39 +0000 Subject: [issue43124] [security] smtplib multiple CRLF injection In-Reply-To: <1612443934.09.0.696762333019.issue43124@roundup.psfhosted.org> Message-ID: <1626708459.6.0.361135296497.issue43124@roundup.psfhosted.org> R. David Murray added the comment: My apologies, I did not think about the possibility of an English issue. I was reacting to the "security report speak", which I find often makes a security issue sound worse than it is :) Thank you for reporting this problem, and I do think we should fix it. My posting was directed at the severity of the issue, since it was potentially holding up a release. My point about the example is that without an example of code that could reasonably be expected to use user input in a call that could inject newlines, we can treat this as a low priority issue. If we had a proposed example of such code, then the priority would be higher. If it was an example of such code "in the wild", then it would be quite high :) The reason I'm saying we should have an example in order to consider it higher priority is that I cannot see *any* likelihood that this would be a problem in practice. Let me explain. putcmd is an *internal* interface. If we look at the commands that call putcmd or docmd, the only ones that pass extra data that aren't pretty obviously safe (ie: not clearly sanitized data) are rcpt and mail[*]. In both cases the item of concern is optionslist. optionslist is a list of *SMTP server options*. This is not data that is reasonably taken from user input, it is data provided *by the programmer*. [*] I did double check to make sure that email.utils.parseaddr sanitizes both \r and \r, just to be sure :) Therefore this is *not* a significant security issue. But as I said, we should take the "defense in depth" approach and apply the check in putcmd as you recommend. I just don't think it needs to hold up a release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:30:40 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 15:30:40 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1626706762.84.0.805826657602.issue44524@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: I see this as part of a trend to improve runtime introspection of complex type expressions. That seems to be going ahead regardless of whether we like it or not, so let's do this. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:38:10 2021 From: report at bugs.python.org (Bartosz Kaznowski) Date: Mon, 19 Jul 2021 15:38:10 +0000 Subject: [issue44610] Format issue with strftime and %Y In-Reply-To: <1626103430.53.0.693000893049.issue44610@roundup.psfhosted.org> Message-ID: <1626709090.39.0.497620193121.issue44610@roundup.psfhosted.org> Bartosz Kaznowski added the comment: Ok, thanks @iritkatriel. I have closed it as a duplicate. I did notice after posting this that in the cpython source code people work around this issue. Now I can see why. I guess I will just have to work around this issue too. Luckily it doesn't cause too many problems for what I need. Thanks! ---------- resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:45:08 2021 From: report at bugs.python.org (hai shi) Date: Mon, 19 Jul 2021 15:45:08 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1626709508.94.0.905279373407.issue37224@roundup.psfhosted.org> hai shi added the comment: I use this add_printf_to_get_details_from_race_condition.patch to get some details of the running subinterpreter. The successful output of test_already_running: test_already_running (test.test__xxsubinterpreters.RunStringTests) ... In interp_create, the current state is: 0x23ee8f0 In interp_list_all, the current state is: 0x23ee8f0 # Entering _running(). Before interp runs, the current state is: 0x2489590 # Running the interp in thread. In interp_list_all, the current state is: 0x23ee8f0 # Running interpreters.list() in _running(). Before interp runs, the current state is: 0x23ee8f0 # Running the interp in test_already_running(). After interp runs, the current state is: 0x25cf0e0 # Running the interp in thread. In interp_list_all, the current state is: 0x23ee8f0 # Clearing the created interps. The failed output of test_already_running: test_already_running (test.test__xxsubinterpreters.RunStringTests) ... In interp_create, the current state is: 0x23e58f0 In interp_list_all, the current state is: 0x23e58f0 In interp_list_all, the current state is: 0x23e58f0 # Compared to the successful output of test_already_running, the interp doesn't run in time. Before interp runs, the current state is: 0x23e58f0 spam After interp runs, the current state is: 0x24fdfc0 In interp_list_all, the current state is: 0x23e58f0 FAIL ====================================================================== FAIL: test_already_running (test.test__xxsubinterpreters.RunStringTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/shihai/cpython/Lib/test/test__xxsubinterpreters.py", line 835, in test_already_running with self.assertRaises(RuntimeError): AssertionError: RuntimeError not raised ---------------------------------------------------------------------- Ran 123 tests in 71.968s FAILED (failures=1, skipped=6) Warning -- Uncaught thread exception: RuntimeError Exception in thread Thread-8 (run): Traceback (most recent call last): File "/home/shihai/cpython/Lib/threading.py", line 1009, in _bootstrap_inner self.run() ^^^^^^^^^^ File "/home/shihai/cpython/Lib/threading.py", line 946, in run self._target(*self._args, **self._kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/shihai/cpython/Lib/test/test__xxsubinterpreters.py", line 49, in run interpreters.run_string(interp, dedent(f""" RuntimeError: unrecognized interpreter ID 60 test test__xxsubinterpreters failed. According to above details, there are several possible explanations: 1.Some race condition break the opcode execution order. I checked the eval function. I didn't find that any condition will disrupt the execution order. 2.The running thread hasn't get the GIL in time. "RuntimeError: unrecognized interpreter ID 60" proves that the interp has been executed in _running(), but later than the test_already_running. So I creates PR 26598. But I catch the error again with PR 26598. 3.the running thread can't get the time slice of CPU. By running python with add_printf_to_get_details_from_race_condition.patch, I find that the thread created in _running() has be executed, but the interp hasn't been executed immediately in run(). At the same time, the done.set() has been executed in run(), so I guess the real reason is the thread created in _running() hasn't get the time slice of CPU to run interp in run() in multiprocess. Pls correct me if I am wrong. ---------- Added file: https://bugs.python.org/file50160/add_printf_to_get_details_from_race_condition.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:47:23 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 15:47:23 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626709643.16.0.0119717467982.issue44549@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25788 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27239 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:49:31 2021 From: report at bugs.python.org (Jeremy) Date: Mon, 19 Jul 2021 15:49:31 +0000 Subject: [issue44675] Cross-platform issues with private methods and multiprocessing Message-ID: <1626709771.89.0.929780396905.issue44675@roundup.psfhosted.org> New submission from Jeremy : While writing a program using the multiprocessing library I stumbled upon what appears to be a bug with how different platforms deal with private methods. When a class has a private method which is the target for a multiprocessing process, this name is correctly resolved on Linux (20.04.1-Ubuntu running Python 3.8.10) but fails to be resolved correctly on MacOS (Python 3.8.2 and 3.8.8) or Windows 10 (Python 3.9.6). import multiprocessing class Test(object): def __init__(self): self.a = 1 self._b = 2 self.__c = 3 self.run1() self.run2() def _test1(self, conn): conn.send(self._b) def __test2(self, conn): conn.send(self.__c) def run1(self): print("Running self._test1()") parent, child = multiprocessing.Pipe() process = multiprocessing.Process(target=self._test1, args=(child, )) process.start() print(parent.recv()) process.join() def run2(self): print("Running self.__test2()") parent, child = multiprocessing.Pipe() process = multiprocessing.Process(target=self.__test2, args=(child, )) process.start() print(parent.recv()) process.join() if __name__ == "__main__": t = Test() On Linux, this has the intended behavior of printing: Running self._test1() 2 Running self.__test2() 3 However, on Windows 10, this results in an Exception being raised: Running self._test1() 2 Running self.__test2() Traceback (most recent call last): File "", line 1, in File "C:\Users\\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "C:\Users\\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 126, in _main self = reduction.pickle.load(from_parent) AttributeError: 'Test' object has no attribute '__test2' A similar exception is also raised on MacOS for this code. It would therefore appear that there is different behavior for resolving class attributes starting with `__` on different platforms (at least within multiprocessing). It is my understanding that because multiprocessing.Process is called within the class, the private method should be within scope and so should resolve correctly. I'm aware that Python doesn't have strict private methods, and instead renames them (Test.__test2 becomes Test._Test__test2) - explaining why on Windows it cannot find the attribute with that name. My question really is, which platform is correct here, and is the inconsistency intentional? I'd suggest Linux is most correct here as the process is spawned from within the object so the method should be in scope, but either way, the inconsistency between platforms may cause some unintended issues. ---------- components: Library (Lib), Windows, macOS messages: 397810 nosy: ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden, ymerej, zach.ware priority: normal severity: normal status: open title: Cross-platform issues with private methods and multiprocessing type: behavior versions: Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 11:54:40 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 15:54:40 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626710080.33.0.109395325398.issue44549@roundup.psfhosted.org> Dong-hee Na added the comment: @ned.deily Is it possible to update bz2 to 1.0.8 on macOS distribution? I found the guide to update the library on Windows but for the macOS version, I can not find. ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:01:23 2021 From: report at bugs.python.org (hai shi) Date: Mon, 19 Jul 2021 16:01:23 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1626710483.2.0.104796467576.issue37224@roundup.psfhosted.org> Change by hai shi : ---------- pull_requests: +25789 pull_request: https://github.com/python/cpython/pull/27240 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:01:44 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 16:01:44 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626710504.28.0.463883858048.issue44549@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25790 pull_request: https://github.com/python/cpython/pull/27241 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:04:39 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 16:04:39 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626710679.5.0.768484778403.issue44549@roundup.psfhosted.org> Change by Dong-hee Na : ---------- components: +macOS nosy: +ronaldoussoren type: crash -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:08:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 16:08:01 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626710881.68.0.27480948931.issue27513@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 89f4c34797de2f0e5045da2b97c1c8cbbb42fbb2 by Zackery Spytz in branch 'main': bpo-27513: email.utils.getaddresses() now handles Header objects (#13797) https://github.com/python/cpython/commit/89f4c34797de2f0e5045da2b97c1c8cbbb42fbb2 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:08:03 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 16:08:03 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626710883.44.0.0966242287724.issue27513@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25791 pull_request: https://github.com/python/cpython/pull/27242 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:18:20 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 19 Jul 2021 16:18:20 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626711500.1.0.0299275107626.issue44549@roundup.psfhosted.org> Dong-hee Na added the comment: Hmm since I am not a distribution expert, I would like to follow other core devs opinions. Almost Linux distributions use bzip2 1.0.6 by default. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:20:13 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 16:20:13 +0000 Subject: [issue44676] Add ability to serialise types.Union Message-ID: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: It was discussed at https://bugs.python.org/issue44490 ---------- messages: 397814 nosy: uriyyo priority: normal severity: normal status: open title: Add ability to serialise types.Union _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:20:20 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 16:20:20 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1626711620.24.0.586309772903.issue44676@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:20:34 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 16:20:34 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1626711634.01.0.815307904065.issue44662@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- title: Add ability to serialise and annotate types.Union -> Add ability to annotate types.Union _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:52:48 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 16:52:48 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1626713568.59.0.270550965615.issue44676@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:55:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 16:55:03 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626713703.44.0.921427550956.issue27513@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8c43bf1a923754fa6d97772151c6ac23c48759d3 by Miss Islington (bot) in branch '3.10': bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (GH-27242) https://github.com/python/cpython/commit/8c43bf1a923754fa6d97772151c6ac23c48759d3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:55:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 16:55:54 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626713754.88.0.947070502625.issue27513@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:56:09 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 16:56:09 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1626713769.7.0.950434454397.issue44676@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25792 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27244 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 12:56:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 16:56:41 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626713801.98.0.529298883423.issue27513@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25793 pull_request: https://github.com/python/cpython/pull/27245 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:03:27 2021 From: report at bugs.python.org (Ken Jin) Date: Mon, 19 Jul 2021 17:03:27 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1626714207.64.0.461005517129.issue44662@roundup.psfhosted.org> Ken Jin added the comment: Nosied over people from issue44490. This issue addresses msg396895: Thanks to Ruben for the catch. (message copied over): ``` It also lacks the __module__ attribute, causing it to be unusable in PEP 593 typing.Annotated types: from typing import Annotated x: Annotated[int | str, 'test'] Traceback (most recent call last): File "", line 1, in File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 298, in inner return cached(*args, **kwds) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1594, in __class_getitem__ return _AnnotatedAlias(origin, metadata) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 1520, in __init__ super().__init__(origin, origin) File "/Users/ruben/.pyenv/versions/3.10.0b3/lib/python3.10/typing.py", line 976, in __init__ self.__module__ = origin.__module__ AttributeError: 'types.Union' object has no attribute '__module__'. Did you mean: '__reduce__'? ``` ---------- nosy: +ROpdebee, gvanrossum, kj, serhiy.storchaka versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:14:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:14:03 +0000 Subject: [issue44672] Final "pass" is traced incorrectly in 3.9 (and before) In-Reply-To: <1626696193.12.0.565896913641.issue44672@roundup.psfhosted.org> Message-ID: <1626714843.37.0.697249400644.issue44672@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for reporting, Ned. I agree with Mark though. We've done 7 releases of Python 3.9 already. The later in the release cycle for a given Python version, the less it's clear if it's "worth" performing complex fixes. Most importantly because introducing a large functional change at this point is risky and we try hard not to disrupt users of stable versions. Moreover, our experience shows that later bugfix releases see decreasing adoption because by default downstream distributors keep their original early bugfix versions of Python with only security- and build-related fixes ported from later releases in the same series. ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:22:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:22:32 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626715352.07.0.262803209365.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset bce1418541a64a793960182772f985f64afbfa1a by Yurii Karabas in branch 'main': bpo-44524: Add missed __name__ and __qualname__ to typing module objects (#27237) https://github.com/python/cpython/commit/bce1418541a64a793960182772f985f64afbfa1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:24:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:24:08 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626715448.2.0.587853227036.issue44524@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10, Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:23:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:23:59 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626715439.01.0.0555950866362.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:24:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 19 Jul 2021 17:24:29 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626715469.25.0.689710275286.issue44524@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25794 pull_request: https://github.com/python/cpython/pull/27246 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:28:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:28:59 +0000 Subject: [issue27513] email.utils.getaddresses does not handle Header objects In-Reply-To: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> Message-ID: <1626715739.78.0.938472225693.issue27513@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9ee12cf325d4da2c07919e5e56545feb7e005e08 by Miss Islington (bot) in branch '3.9': bpo-27513: email.utils.getaddresses() now handles Header objects (GH-13797) (#27245) https://github.com/python/cpython/commit/9ee12cf325d4da2c07919e5e56545feb7e005e08 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:40:33 2021 From: report at bugs.python.org (Piotr Tokarski) Date: Mon, 19 Jul 2021 17:40:33 +0000 Subject: [issue44677] CSV sniffing falsely detects space as a delimiter Message-ID: <1626716433.69.0.308565611704.issue44677@roundup.psfhosted.org> New submission from Piotr Tokarski : Let's consider the following CSV content: "a|b\nc| 'd\ne|' f". The real delimiter in this case is '|' character while ' ' is sniffed. Find verbose example attached. Problem lays in csv.py file in the following code: ``` matches = [] for restr in (r'(?P[^\w\n"\'])(?P ?)(?P["\']).*?(?P=quote)(?P=delim)', # ,".*?", r'(?:^|\n)(?P["\']).*?(?P=quote)(?P[^\w\n"\'])(?P ?)', # ".*?", r'(?P[^\w\n"\'])(?P ?)(?P["\']).*?(?P=quote)(?:$|\n)', # ,".*?" r'(?:^|\n)(?P["\']).*?(?P=quote)(?:$|\n)'): # ".*?" (no delim, no space) regexp = re.compile(restr, re.DOTALL | re.MULTILINE) matches = regexp.findall(data) if matches: break ``` What makes matches non-empty and farther processing happens with delimiter falsely set to ' '. ---------- components: Library (Lib) messages: 397821 nosy: pt12lol priority: normal severity: normal status: open title: CSV sniffing falsely detects space as a delimiter type: behavior versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:50:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Jul 2021 17:50:08 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626717008.59.0.280307496006.issue44653@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25795 pull_request: https://github.com/python/cpython/pull/27247 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:56:02 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Mon, 19 Jul 2021 17:56:02 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626717362.96.0.467020458478.issue42854@roundup.psfhosted.org> Geoffrey Thomas added the comment: I am still seeing failures to read responses over 2 GB in Python 3.10b1. I'm working on a reproducer, but I'm getting the same "OverflowError: signed integer is greater than maximum" that I get in 3.9. ---------- nosy: +geofft _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:57:02 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 17:57:02 +0000 Subject: [issue44668] More differences in instance and subclass checks between typing.Union and types.Union In-Reply-To: <1626628890.53.0.612385746945.issue44668@roundup.psfhosted.org> Message-ID: <1626717422.93.0.317548313609.issue44668@roundup.psfhosted.org> Guido van Rossum added the comment: Sure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 13:57:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 19 Jul 2021 17:57:34 +0000 Subject: [issue44524] __name__ attribute in typing module In-Reply-To: <1624889733.91.0.716738825713.issue44524@roundup.psfhosted.org> Message-ID: <1626717454.7.0.076166603144.issue44524@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c895f2bc4f270efce30fe3687ce85095418175f4 by Miss Islington (bot) in branch '3.10': bpo-44524: Add missed __name__ and __qualname__ to typing module objects (GH-27237) (#27246) https://github.com/python/cpython/commit/c895f2bc4f270efce30fe3687ce85095418175f4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:07:58 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 18:07:58 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626718078.29.0.626241339076.issue44353@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: @Ken thanks for pointing this out. The only solution which I see is to convert NewType into callable class but it will lead to performance degradation. @Ken what do you think about that? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:11:25 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 18:11:25 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626718285.49.0.264746086529.issue44353@roundup.psfhosted.org> Guido van Rossum added the comment: Do we have to solve it? Using `from __future__ import annotations` it should work, at least when used as an annotation. Or is that too inconvenient or inconsistent? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:15:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Mon, 19 Jul 2021 18:15:58 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626718558.46.0.93600914261.issue44653@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is also problem with other typing types: >>> (int | T)[typing.List] Traceback (most recent call last): File "", line 1, in TypeError: Each union argument must be a type, got typing.List >>> (int | T)[typing.List[int]] Traceback (most recent call last): File "", line 1, in TypeError: Each union argument must be a type, got typing.List[int] >>> (int | T)[typing.Hashable] Traceback (most recent call last): File "", line 1, in TypeError: Each union argument must be a type, got typing.Hashable >>> (int | T)[typing.Callable[[int], str]] Traceback (most recent call last): File "", line 1, in TypeError: Each union argument must be a type, got typing.Callable[[int], str] >>> (int | T)[typing.ParamSpec('P')] Traceback (most recent call last): File "", line 1, in TypeError: Each union argument must be a type, got ~P Despite the fact that they support the | operator. We can add one by one special support of different types supporting the | operator (ParamSpec, _GenericAlias, _CallableGenericAlias, _UnionGenericAlias, _LiteralGenericAlias, _ConcatenateGenericAlias, _AnnotatedAlias, _SpecialGenericAlias, _CallableType, _TupleType), but it is cumbersome and errorprone. We will need to synchronize code of unionobject.c with typing every time we add new kind of types. PR 27247 uses more general approach. It calls the | operator for arguments after substitution. So all types which support the | operator are now automatically supported. But the result of parameter substitution can now be typing.Union instead of types.Union. >>> import typing >>> import collections.abc >>> T = typing.TypeVar('T') >>> (int | T)[list] int | list >>> (int | T)[typing.List] typing.Union[int, typing.List] >>> (int | T)[list[int]] int | list[int] >>> (int | T)[typing.List[int]] typing.Union[int, typing.List[int]] >>> (int | T)[collections.abc.Hashable] int | collections.abc.Hashable >>> (int | T)[typing.Hashable] typing.Union[int, typing.Hashable] >>> (int | T)[collections.abc.Sequence[int]] int | collections.abc.Sequence[int] >>> (int | T)[typing.Sequence[int]] typing.Union[int, typing.Sequence[int]] >>> (int | T)[collections.abc.Callable[[int], str]] int | collections.abc.Callable[[int], str] >>> (int | T)[typing.Callable[[int], str]] typing.Union[int, typing.Callable[[int], str]] >>> (int | T)[typing.TypeVar('S')] int | ~S >>> (int | T)[typing.ParamSpec('P')] typing.Union[int, ~P] >>> (int | T)[str | list] int | str | list >>> (int | T)[typing.Union[str, list]] typing.Union[int, str, list] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:20:39 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 18:20:39 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626718839.67.0.0500731309713.issue44653@roundup.psfhosted.org> Guido van Rossum added the comment: I need someone else to own this, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:24:00 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 19 Jul 2021 18:24:00 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626719040.7.0.199223939798.issue43950@roundup.psfhosted.org> Ammar Askar added the comment: Had some time to look into this. Just to summarize this problem, it deals with unicode points that are single characters but take up more than the width of a single character, even with a monospace font [1]. In the examples from above, the Chinese character itself counts as one character in a Python string. However, notice that it needs two carets: >>> x = "?" >>> print(x) ? >>> len(x) 1 >>> print(x + '\n' + '^^') ? ^^ This issue is somewhat font dependent, in the case of the emoji I know that windows sometimes renders emojis as single-character wide black-and-white glyphs or colorful ones depending on the program. As Pablo alluded to, unicodedata.east_asian_width is probably the best solution we can implement. For these wide characters it provides: >>> unicodedata.east_asian_width('?') 'W' >>> unicodedata.east_asian_width('?') 'W' W corresponding to Wide. Whereas for regular width characters: >>> unicodedata.east_asian_width('b') 'Na' >>> unicodedata.east_asian_width('=') 'Na' we get Neutral (Not East Asian). This can be used to count the "displayed width" of the characters and hence the carets. However, organization is going to be a bit tricky since we're currently using _PyPegen_byte_offset_to_character_offset to get offsets to use for string slicing in the ast segment parsing code. We might have to make a separate function that gets the font display-width. ------------- [1] Way more details on this issue here: https://denisbider.blogspot.com/2015/09/when-monospace-fonts-arent-unicode.html and an example of a Python library that tries to deal with this issue here: https://github.com/jquast/wcwidth ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:24:26 2021 From: report at bugs.python.org (Ned Batchelder) Date: Mon, 19 Jul 2021 18:24:26 +0000 Subject: [issue44672] Final "pass" is traced incorrectly in 3.9 (and before) In-Reply-To: <1626696193.12.0.565896913641.issue44672@roundup.psfhosted.org> Message-ID: <1626719066.24.0.992230738082.issue44672@roundup.psfhosted.org> Ned Batchelder added the comment: This is the right call. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:32:54 2021 From: report at bugs.python.org (Idan Moral) Date: Mon, 19 Jul 2021 18:32:54 +0000 Subject: [issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode Message-ID: <1626719574.0.0.378248242955.issue44678@roundup.psfhosted.org> New submission from Idan Moral : This is a follow-up PR to #24402. It should address @gpshead's last comment on the subject: https://github.com/python/cpython/pull/24402#issuecomment-882699002 Original issue: https://bugs.python.org/issue43086 Original PR: https://github.com/python/cpython/pull/24402 ---------- components: Extension Modules, Library (Lib) messages: 397831 nosy: gregory.p.smith, idan22moral priority: normal severity: normal status: open title: Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:33:16 2021 From: report at bugs.python.org (Idan Moral) Date: Mon, 19 Jul 2021 18:33:16 +0000 Subject: [issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode In-Reply-To: <1626719574.0.0.378248242955.issue44678@roundup.psfhosted.org> Message-ID: <1626719596.92.0.174055761185.issue44678@roundup.psfhosted.org> Change by Idan Moral : ---------- type: -> enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:34:52 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Mon, 19 Jul 2021 18:34:52 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626719692.21.0.612441564272.issue42854@roundup.psfhosted.org> Geoffrey Thomas added the comment: Christian mentioned on Twitter that this is probably due to a missing argument clinic change from "int" to "Py_ssize_t". I can confirm that fixing that and rerunning argument clinic makes things start to work. I don't have the ability to reopen this bug (I think), can someone reopen it please? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:37:26 2021 From: report at bugs.python.org (Idan Moral) Date: Mon, 19 Jul 2021 18:37:26 +0000 Subject: [issue43086] Excess data in not handled properly in binascii.a2b_base64() In-Reply-To: <1612116712.99.0.535653486799.issue43086@roundup.psfhosted.org> Message-ID: <1626719846.49.0.2388497827.issue43086@roundup.psfhosted.org> Change by Idan Moral : ---------- pull_requests: +25796 pull_request: https://github.com/python/cpython/pull/27249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:40:14 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Mon, 19 Jul 2021 18:40:14 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626720014.66.0.237078560017.issue42854@roundup.psfhosted.org> Filipe La?ns added the comment: https://twitter.com/geofft/status/1417167982665551877 ---------- nosy: +FFY00 resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:42:11 2021 From: report at bugs.python.org (Idan Moral) Date: Mon, 19 Jul 2021 18:42:11 +0000 Subject: [issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode In-Reply-To: <1626719574.0.0.378248242955.issue44678@roundup.psfhosted.org> Message-ID: <1626720131.81.0.272605731473.issue44678@roundup.psfhosted.org> Change by Idan Moral : ---------- keywords: +patch pull_requests: +25797 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27249 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 14:47:24 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 19 Jul 2021 18:47:24 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626720444.36.0.142663134941.issue44353@roundup.psfhosted.org> Jelle Zijlstra added the comment: > Using `from __future__ import annotations` it should work Not in type aliases or generic bases. (And if Larry's co_annotations PEP is accepted, it would break in normal annotations too.) I'd prefer to get rid of this sort of subtle difference where the obvious way to write a type only works in some contexts, though I realize that's not possible in all cases. That means I think we should move forward with making NewTypes into instances with __call__ instead of functions, though according to my benchmarks in the typing issue that will incur a small performance penalty. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 15:45:52 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 19:45:52 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626723952.55.0.23509577288.issue44353@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25798 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27250 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 15:51:34 2021 From: report at bugs.python.org (Yurii Karabas) Date: Mon, 19 Jul 2021 19:51:34 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626724294.28.0.975549921464.issue44353@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: I opened PR with refactored `typing.NewType` into callable class. Also I have added `__module__` attr to typing.NewType so it will become pickable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 16:27:00 2021 From: report at bugs.python.org (Jacob Walls) Date: Mon, 19 Jul 2021 20:27:00 +0000 Subject: [issue31162] urllib.request.urlopen CERTIFICATE_VERIFY_FAILED error In-Reply-To: <1502290158.78.0.927502362928.issue31162@psf.upfronthosting.co.za> Message-ID: <1626726420.21.0.20430679929.issue31162@roundup.psfhosted.org> Jacob Walls added the comment: Third voice chiming in to say not a bug, also. I think the last two messages inadvertently moved to pending and then back to open. I suggest closing. ---------- nosy: +jacobtylerwalls _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:03:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 19 Jul 2021 21:03:10 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626728590.5.0.25618739735.issue43950@roundup.psfhosted.org> Terry J. Reedy added the comment: The effort to match caret lines to general unicode is similar to a previous issue that was closed as futile. (But I could not find it.) It has a downside that should be considered. The fundamental problem is that there is no fixed pitch font for unicode. (Let alone any font covering all of unicode.) Nor is there a single-double width definition, or font, for all of unicode. Some character sets are not amenable to such treatment. To see the problem easier, open, for instance, IDLE's option/settings dialog, showing the fonts tab and a multi-script sample. On Windows, select what I believe is the most 'fixed' font -- Courier New. ASCII, Latin1, IPA, Greek, Cyrillic, Hebrew, and Arabic are all rendered in the same fixed pitch. But the last 4 Cyrillic characters of "...????????" are extremely cramped and may be rendered differently from the rest. The East Asian characters are in a different fixed pitch, about 1.6 times the Ascii, etc. fixed pitch. (So the double-wide 2 is 1.6 rounded up. And with some fonts, the East Asian scripts are not all the same pitch.) The South Asian script are variable pitch and for the sample chars, average wider than 1 (they have 20 chars, like the Ascii, etc, lines). Tamil, especially, has a wide range of widths, with the widest as wide as the East Asian chars. On Windows, on my machine, pasting the sample text between quotes results in the Greek chars, the last 4 Cyrillic chars, and all Asian chars (including Hebrew and Arabic) being replaced by replacement chars. (I thought that this was better once, but maybe I mis-remember.) While one can get script-specific fonts, the fixed-pitch South Asian fonts I tried on Mac were hardly readable. My conclusion is that people using certain scripts and anyone wanting a wide variety of scripts needs to use a GUI-based editor and shell rather than a fixed-pitch terminal/console. As long as the caret line has 1 char per code char, a GUI program can use it to mark code characters, and do so differently for '~' and '^'. If some of these chars are doubled, exact character information is lost. If you go ahead with this, please use a third character, such as '-', for additions. GUI programs could then ignore these, given that they can otherwise can get the start character information. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:06:53 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 21:06:53 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626728813.22.0.165632832574.issue44353@roundup.psfhosted.org> Guido van Rossum added the comment: Jelle, can you post more details about your benchmark? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:15:28 2021 From: report at bugs.python.org (Andrii Haidai) Date: Mon, 19 Jul 2021 21:15:28 +0000 Subject: [issue44679] unittest.mock.sentinel documentation typo Message-ID: <1626729328.44.0.624843688761.issue44679@roundup.psfhosted.org> New submission from Andrii Haidai : here: https://docs.python.org/3.3/library/unittest.mock.html#sentinel in code example block in last command line >>> sentinel.some_object according to the above 26.4.5.1 article context it looks like the other commad is expected: >>> result To ensure that at the end "result" equals sentinel.some_object we probably should print the "result" value to check, not the "sentinel.some_object" itself. ---------- assignee: docs at python components: Documentation messages: 397839 nosy: docs at python, gaydayav priority: normal severity: normal status: open title: unittest.mock.sentinel documentation typo versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:16:51 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 19 Jul 2021 21:16:51 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626729411.06.0.584775376483.issue44353@roundup.psfhosted.org> Jelle Zijlstra added the comment: This is what I got last year (copied from the typing issues): In [83]: from typing import NewType In [84]: nt = NewType("nt", int) In [85]: class NewTypeClass: ...: def __init__(self, name, supertype): ...: self.name = name ...: self.supertype = supertype ...: def __call__(self, obj): ...: return obj ...: def __repr__(self): ...: return f"" ...: In [86]: ntc = NewTypeClass("ntc", int) In [87]: ntc Out[87]: In [88]: %timeit nt(3) 211 ns ? 2.27 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) In [89]: %timeit ntc(3) 253 ns ? 5.35 ns per loop (mean ? std. dev. of 7 runs, 1000000 loops each) Not sure what version of Python I used at the time. I just repeated it on 3.9.4 MacOS and got much faster time but a similar ~20% slowdown: In [6]: %timeit nt(3) 112 ns ? 5.11 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) In [7]: %timeit ntc(3) 136 ns ? 2.36 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:19:19 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 19 Jul 2021 21:19:19 +0000 Subject: [issue44554] pdb.main is unnecessarily complicated In-Reply-To: <1625258822.01.0.642754622025.issue44554@roundup.psfhosted.org> Message-ID: <1626729559.15.0.315690674158.issue44554@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:23:17 2021 From: report at bugs.python.org (Anders Kaseorg) Date: Mon, 19 Jul 2021 21:23:17 +0000 Subject: =?utf-8?q?=5Bissue44680=5D_Reference_cycles_from_a_WeakKeyDictionary_valu?= =?utf-8?q?e_to_its_key_aren=E2=80=99t_collected?= Message-ID: <1626729797.43.0.421968257502.issue44680@roundup.psfhosted.org> New submission from Anders Kaseorg : Because WeakKeyDictionary unconditionally maintains strong references to its values, the garbage collector fails to collect a reference cycle from a WeakKeyDictionary value to its key. For example, the following program unexpectedly leaks memory: from weakref import WeakKeyDictionary class C: pass d = WeakKeyDictionary() while True: c = C() d[c] = [c] I would expect a WeakKeyDictionary value to be marked live _if_ its key is marked live, not unconditionally. This could be implemented with garbage collector support for ephemerons (https://www.researchgate.net/publication/221320677_Ephemerons_A_New_Finalization_Mechanism). To motivate this issue, a typical use of WeakKeyDictionary is as a hygienic replacement for patching extra properties into third-party objects: # before: obj._extra_state = ExtraState(obj) # after: extra_states = WeakKeyDictionary() extra_states[o] = ExtraState(obj) However, such a conversion will introduce this memory leak if ExtraState(obj) has any transitive references to obj. This leak does not occur in JavaScript: class C {} const d = new WeakMap(); while (true) { const c = new C(); d[c] = [c]; } ---------- components: Library (Lib) messages: 397841 nosy: andersk priority: normal severity: normal status: open title: Reference cycles from a WeakKeyDictionary value to its key aren?t collected type: resource usage versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 17:27:23 2021 From: report at bugs.python.org (Guido van Rossum) Date: Mon, 19 Jul 2021 21:27:23 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626730043.72.0.132248825169.issue44353@roundup.psfhosted.org> Guido van Rossum added the comment: Hm, 20% isn't so bad, but one of the arguments for NewType was that it "disappears" at runtime -- which the current version does, but the class-based version doesn't quite. Right now I don't have the cycles to think about this deeply. Maybe a few weeks after I'm back from vacation (~August 8) I will have more time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 18:42:31 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Mon, 19 Jul 2021 22:42:31 +0000 Subject: [issue44678] Seperate error message for discontinuous padding in binascii.a2b_base64 strict mode In-Reply-To: <1626719574.0.0.378248242955.issue44678@roundup.psfhosted.org> Message-ID: <1626734551.01.0.655217472212.issue44678@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 366fcbac18e3adc41e3901580dbedb6a91e41a10 by Idan Moral in branch 'main': bpo-44678: Separate error message for discontinuous padding in binascii.a2b_base64 strict mode (GH-27249) https://github.com/python/cpython/commit/366fcbac18e3adc41e3901580dbedb6a91e41a10 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 18:47:07 2021 From: report at bugs.python.org (Ammar Askar) Date: Mon, 19 Jul 2021 22:47:07 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626734827.26.0.276304383311.issue43950@roundup.psfhosted.org> Ammar Askar added the comment: I think this is the previous issue you are talking about Terry. https://bugs.python.org/issue24665 The correct algorithm is a little more complex than just using east_asian_widths. Ideally we would like to use the wcwidth function (https://man7.org/linux/man-pages/man3/wcwidth.3.html) which implements all the logic to somewhat properly figure out widths. Given Terry's comments from above and the previous issues I'm starting to think the fix for this issue might not be worth the added complexity. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 19:06:04 2021 From: report at bugs.python.org (Anders Kaseorg) Date: Mon, 19 Jul 2021 23:06:04 +0000 Subject: =?utf-8?q?=5Bissue44680=5D_Reference_cycles_from_a_WeakKeyDictionary_valu?= =?utf-8?q?e_to_its_key_aren=E2=80=99t_collected?= In-Reply-To: <1626729797.43.0.421968257502.issue44680@roundup.psfhosted.org> Message-ID: <1626735964.95.0.568683516572.issue44680@roundup.psfhosted.org> Anders Kaseorg added the comment: > extra_states[o] = ExtraState(obj) (Typo for extra_states[obj] = ExtraState(obj), obviously.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 20:14:54 2021 From: report at bugs.python.org (Ned Batchelder) Date: Tue, 20 Jul 2021 00:14:54 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626740094.74.0.0897021537681.issue44621@roundup.psfhosted.org> Ned Batchelder added the comment: @lukasz.langa, I guess this 3.9 tracing bug should also be closed as wont-fix? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 21:32:57 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 20 Jul 2021 01:32:57 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626744777.52.0.911067950993.issue44353@roundup.psfhosted.org> Ken Jin added the comment: This issue is now out of date on. After Serhiy's refactoring, any function types can be unioned. >>> NewType('x', int) >>> int | NewType('x', int) int | typing.NewType..new_type The only problem now is that the repr is weird, but Serhiy also has a fix for that in issue34963 (PR 9951) without converting to a class. Thus, I am closing the issue. Please go to issue44642 for a general discussion on whether union should support arbitrary functions at all, or issue34963 for the repr problem. Thanks all! ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed superseder: -> Union of a type and the typing module function _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 21:55:36 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 20 Jul 2021 01:55:36 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626746136.0.0.482310718491.issue44353@roundup.psfhosted.org> Jelle Zijlstra added the comment: Does that work if you try to union two NewTypes? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 21:59:14 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 20 Jul 2021 01:59:14 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626746354.42.0.839620937716.issue44353@roundup.psfhosted.org> Ken Jin added the comment: > Does that work if you try to union two NewTypes? Oh woops I was too eager in closing this issue -- it doesn't work. Sorry, please disregard my previous message. I'm reopening this. Thanks for the reminder Jelle. ---------- resolution: out of date -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 23:04:39 2021 From: report at bugs.python.org (Thereisfood) Date: Tue, 20 Jul 2021 03:04:39 +0000 Subject: [issue44681] time.sleep(0.001) not working properly Message-ID: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> New submission from Thereisfood : time.sleep(0.001) sleeps for 0.014 - 0.016 instead of 0.001. ---------- components: Windows files: Capture.PNG messages: 397850 nosy: paul.moore, steve.dower, therenoisfood, tim.golden, zach.ware priority: normal severity: normal status: open title: time.sleep(0.001) not working properly versions: Python 3.9 Added file: https://bugs.python.org/file50161/Capture.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 23:06:47 2021 From: report at bugs.python.org (Thereisfood) Date: Tue, 20 Jul 2021 03:06:47 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626750407.48.0.451245255606.issue44681@roundup.psfhosted.org> Change by Thereisfood : Removed file: https://bugs.python.org/file50161/Capture.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 23:08:26 2021 From: report at bugs.python.org (Thereisfood) Date: Tue, 20 Jul 2021 03:08:26 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626750506.07.0.242676565388.issue44681@roundup.psfhosted.org> Change by Thereisfood : Added file: https://bugs.python.org/file50162/Capture.PNG _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 23:14:35 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 20 Jul 2021 03:14:35 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626750875.06.0.611994446887.issue44681@roundup.psfhosted.org> Jack DeVries added the comment: This is not a bug. See the docs: The precision of the various real-time functions may be less than suggested by the units in which their value or argument is expressed. E.g. on most Unix systems, the clock ?ticks? only 50 or 100 times a second. On the other hand, the precision of time() and sleep() is better than their Unix equivalents: times are expressed as floating point numbers, time() returns the most accurate time available (using Unix gettimeofday() where available), and sleep() will accept a time with a nonzero fraction (Unix select() is used to implement this, where available). Assuming a clock speed of 50x/second as the documentation names, the cpu only cycles every 0.02 seconds. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 19 23:29:40 2021 From: report at bugs.python.org (Thereisfood) Date: Tue, 20 Jul 2021 03:29:40 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626751780.81.0.440622419366.issue44681@roundup.psfhosted.org> Change by Thereisfood : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 00:09:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 04:09:05 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint Message-ID: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> New submission from Andrei Kulakov : breakpoint 5 does not exist: (Pdb) commands 5 (com) p x (com) (com) end ---------- components: Library (Lib) messages: 397852 nosy: andrei.avk priority: normal severity: normal status: open title: Pdb commands allows to add commands to invalid breakpoint versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 00:14:03 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 04:14:03 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint In-Reply-To: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> Message-ID: <1626754443.98.0.84874971233.issue44682@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25799 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27252 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 02:31:09 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 20 Jul 2021 06:31:09 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626762669.76.0.160441399789.issue44549@roundup.psfhosted.org> Ned Deily added the comment: > Is it possible to update bz2 to 1.0.8 on macOS distribution? Thanks for looking into this. As I commented on PR 27241, this change is not needed because current macOS python.org installers dynamically link to the system-provided copies of Bzip2; the code to build a private copy of BZip2 in build-installer.py was only used when building on very old versions of macOS, 10.4 and earlier, versions for which we no longer support building installers. I've submitted another PR to remove that unused code to avoid future confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 02:35:45 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 20 Jul 2021 06:35:45 +0000 Subject: [issue44549] BZip 1.0.6 Critical Vulnerability In-Reply-To: <1625222767.58.0.244231438459.issue44549@roundup.psfhosted.org> Message-ID: <1626762945.51.0.534804731829.issue44549@roundup.psfhosted.org> Dong-hee Na added the comment: > current macOS python.org installers dynamically link to the system-provided copies of Bzip2 Okay, so this issue looks out of scope to the CPython team if the Windows distribution follows the same policy. @steve.dowe Can you check about this issue? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 02:51:58 2021 From: report at bugs.python.org (Dong-hee Na) Date: Tue, 20 Jul 2021 06:51:58 +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: <1626763918.94.0.113172435328.issue44340@roundup.psfhosted.org> Dong-hee Na added the comment: @ned.deily Can we use the thin-lto option for next macOS Python distribution? In my local environment, it passes all tests :) https://github.com/python/cpython/blob/366fcbac18e3adc41e3901580dbedb6a91e41a10/Mac/BuildScript/build-installer.py#L1199 FYI, Gentoo already recommends using the thin LTO instead of the full LTO. https://wiki.gentoo.org/wiki/Clang#Link-time_optimizations_with_Clang ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 02:52:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 20 Jul 2021 06:52:25 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626763945.78.0.0493324742836.issue44681@roundup.psfhosted.org> Steven D'Aprano added the comment: Jack, Thereisfood is using Windows, which I understand has a clock with millisecond accuracy. So a sleep of a millisecond should, I think, work on Windows even if it doesn't work on Linux. Could a Windows expert clarify please? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:07:56 2021 From: report at bugs.python.org (Thereisfood) Date: Tue, 20 Jul 2021 07:07:56 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626764876.43.0.54204542652.issue44681@roundup.psfhosted.org> Thereisfood added the comment: I think this is Windows 10 issue after build 1909. Because I tested on Windows 10 build 1909 is about 0.001 - 0.002 and tested on 20H2 is the attached results. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:35:00 2021 From: report at bugs.python.org (Victor Zhestkov) Date: Tue, 20 Jul 2021 07:35:00 +0000 Subject: [issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection In-Reply-To: <1505205309.2.0.369809964342.issue31426@psf.upfronthosting.co.za> Message-ID: <1626766500.61.0.428790867336.issue31426@roundup.psfhosted.org> Victor Zhestkov added the comment: It seems I have the same segfault, but with 3.6.13 python shipped with SLE15SP2. It's salt-api process under intensive usage. I'm able to reproduce it, but can't isolate due to the service complexity. In some cases it takes about 5 minutes to be crashed, but in others it could run with no crash for about an hour or more (I keep the workload on this service with a kind of stress test). ---------- nosy: +vzhestkov Added file: https://bugs.python.org/file50163/gdb-bt-full.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:35:18 2021 From: report at bugs.python.org (Victor Zhestkov) Date: Tue, 20 Jul 2021 07:35:18 +0000 Subject: [issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection In-Reply-To: <1505205309.2.0.369809964342.issue31426@psf.upfronthosting.co.za> Message-ID: <1626766518.16.0.360290493328.issue31426@roundup.psfhosted.org> Change by Victor Zhestkov : Added file: https://bugs.python.org/file50164/py-bt.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:35:35 2021 From: report at bugs.python.org (Victor Zhestkov) Date: Tue, 20 Jul 2021 07:35:35 +0000 Subject: [issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection In-Reply-To: <1505205309.2.0.369809964342.issue31426@psf.upfronthosting.co.za> Message-ID: <1626766535.83.0.479108231962.issue31426@roundup.psfhosted.org> Change by Victor Zhestkov : Added file: https://bugs.python.org/file50165/gbd-bt-brief.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:36:23 2021 From: report at bugs.python.org (Piotr Tokarski) Date: Tue, 20 Jul 2021 07:36:23 +0000 Subject: [issue44677] CSV sniffing falsely detects space as a delimiter In-Reply-To: <1626716433.69.0.308565611704.issue44677@roundup.psfhosted.org> Message-ID: <1626766583.9.0.796790901287.issue44677@roundup.psfhosted.org> Piotr Tokarski added the comment: Test sample: ``` import csv from io import StringIO def csv_text(): return StringIO("a|b\nc| 'd\ne|' f") with csv_text() as input_file: print('The following text is going to be parsed:') print(input_file.read()) print() with csv_text() as input_file: dialect_params = [ 'delimiter', 'quotechar', 'escapechar', 'lineterminator', 'quoting', 'doublequote', 'skipinitialspace' ] dialect = csv.Sniffer().sniff(input_file.read()) print('The following dialect has been detected:') for dialect_param in dialect_params: print(f'- {dialect_param}: {repr(getattr(dialect, dialect_param))}') print() with csv_text() as input_file: print('Parsed csv text:') for entry in csv.reader(input_file, dialect=dialect): print(f'- {entry}') print() ``` Actual output: ``` The following text is going to be parsed: a|b c| 'd e|' f The following dialect has been detected: - delimiter: ' ' - quotechar: "'" - escapechar: None - lineterminator: '\r\n' - quoting: 0 - doublequote: False - skipinitialspace: False Parsed csv text: - ['a|b'] - ['c|', 'd\ne|', 'f'] ``` Expected output: ``` The following text is going to be parsed: a|b c| 'd e|' f The following dialect has been detected: - delimiter: '|' - quotechar: '"' - escapechar: None - lineterminator: '\r\n' - quoting: 0 - doublequote: False - skipinitialspace: False Parsed csv text: - ['a', 'b'] - ['c', " 'd"] - ['e', "' f"] ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 03:42:40 2021 From: report at bugs.python.org (Piotr Tokarski) Date: Tue, 20 Jul 2021 07:42:40 +0000 Subject: [issue44677] CSV sniffing falsely detects space as a delimiter In-Reply-To: <1626716433.69.0.308565611704.issue44677@roundup.psfhosted.org> Message-ID: <1626766960.27.0.648884834897.issue44677@roundup.psfhosted.org> Piotr Tokarski added the comment: I think changing `(?P["\']).*?(?P=quote)` to `(?P["\'])[^\n]*?(?P=quote)` in all regexes does the trick, doesn't it? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 04:13:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Tue, 20 Jul 2021 08:13:30 +0000 Subject: [issue14739] Add PyArg_Parse format unit like O& but providing context In-Reply-To: <1336383309.79.0.581336532675.issue14739@psf.upfronthosting.co.za> Message-ID: <1626768810.24.0.0670569355337.issue14739@roundup.psfhosted.org> Irit Katriel added the comment: Now we have exception chaining, so Serhiy's pattern is even simpler to implement than with exception wrappers. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 04:23:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 20 Jul 2021 08:23:57 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626769437.79.0.583013175451.issue44621@roundup.psfhosted.org> Mark Shannon added the comment: We can fix this for 3.9. The fix to 3.10 was trivial and should port easily. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 04:50:43 2021 From: report at bugs.python.org (Matej Cepl) Date: Tue, 20 Jul 2021 08:50:43 +0000 Subject: [issue31426] [3.5] crash in gen_traverse(): gi_frame.ob_type=NULL, called by subtract_refs() during a GC collection In-Reply-To: <1505205309.2.0.369809964342.issue31426@psf.upfronthosting.co.za> Message-ID: <1626771043.3.0.504213377255.issue31426@roundup.psfhosted.org> Change by Matej Cepl : ---------- nosy: +mcepl versions: +Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 04:56:58 2021 From: report at bugs.python.org (Eryk Sun) Date: Tue, 20 Jul 2021 08:56:58 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1626771418.42.0.88180445877.issue44681@roundup.psfhosted.org> Eryk Sun added the comment: The implementation of time.sleep() uses WaitForSingleObjectEx() on the main thread. It waits for an event object that gets signaled by Ctrl+C. On other threads it simply calls Sleep(). Thread wait functions such as WaitForSingleObjectEx() and Sleep() are based on the system interrupt time. By default the clock interrupt runs at 64 cycles per second, i.e. the interrupt time is about 15.6 ms. The interrupt time can be programmatically lowered to about 0.5 ms, but this should only be changed temporarily for timing critical applications. Lowering the interrupt time for general use can shorten the battery life on portable devices, since servicing the interrupt prevents the CPU from entering a low-power state. Even with a lowered interrupt time, in my experience thread dispatching in Windows simply is not implemented to support precise timing. If the wait time needs to be precise, I suggest using a loop based on time.perf_counter_ns(). Calculate a deadline based on the current counter value plus the desired wait time in nanoseconds, and loop until the current value equals or exceeds the deadline. Maybe it would be useful to implement something like this in time.sleep() itself, but I don't know whether the need in a few cases warrants the increased complexity and cost in general. ---------- nosy: +eryksun resolution: -> third party type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 05:06:57 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 20 Jul 2021 09:06:57 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626772017.55.0.587745857747.issue44621@roundup.psfhosted.org> Change by Mark Shannon : ---------- keywords: +patch pull_requests: +25800 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27255 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 05:07:51 2021 From: report at bugs.python.org (Mark Shannon) Date: Tue, 20 Jul 2021 09:07:51 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626772071.2.0.990352596148.issue44621@roundup.psfhosted.org> Mark Shannon added the comment: Not quite trivial, but simple enough :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 05:27:36 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 20 Jul 2021 09:27:36 +0000 Subject: [issue44677] CSV sniffing falsely detects space as a delimiter In-Reply-To: <1626716433.69.0.308565611704.issue44677@roundup.psfhosted.org> Message-ID: <1626773256.19.0.107681139275.issue44677@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 1.0 -> 2.0 pull_requests: +25801 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27256 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 06:13:36 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 10:13:36 +0000 Subject: [issue44621] Python 3.9 traces async for/else incorrectly In-Reply-To: <1626175762.98.0.836185243325.issue44621@roundup.psfhosted.org> Message-ID: <1626776016.27.0.335339249206.issue44621@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 06:17:57 2021 From: report at bugs.python.org (Jakub Kulik) Date: Tue, 20 Jul 2021 10:17:57 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626776277.0.0.292837040088.issue43219@roundup.psfhosted.org> Jakub Kulik added the comment: On Solaris (I checked this on Oracle and SmartOS), the error is: NotADirectoryError: [Errno 20] Not a directory: 'not_a_dir/' which I think belongs to the 'errors are not confusing' category with Windows and macOS. ---------- nosy: +kulikjak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 06:18:58 2021 From: report at bugs.python.org (Jakub Kulik) Date: Tue, 20 Jul 2021 10:18:58 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626776338.18.0.939482317743.issue43219@roundup.psfhosted.org> Change by Jakub Kulik : ---------- pull_requests: +25802 pull_request: https://github.com/python/cpython/pull/27257 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 06:59:48 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 10:59:48 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1626778788.08.0.937852064119.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 4c0deb25ac899fbe4da626ce3cb21f204cdd3aa9 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Finalise establishing sqlite3 global state (GH-27155) https://github.com/python/cpython/commit/4c0deb25ac899fbe4da626ce3cb21f204cdd3aa9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 08:58:24 2021 From: report at bugs.python.org (Mykyta) Date: Tue, 20 Jul 2021 12:58:24 +0000 Subject: [issue44683] String formatting Message-ID: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> New submission from Mykyta : The formatting does not work correctly. I have a dict with string representations of integers as keys, such as {'1': 'a'} and trying to format it this way: '{0[1]}' and KeyError occurs. But I think it should not as '{0[a]}'.format(a) works properly with a = {'a': '1'} and '{0[1]}'.format(a) works properly with a = {1: 'a'}. Adding quotation marks does not help, KeyError occurs with '"1"'. ---------- components: Unicode files: 1.png messages: 397867 nosy: NickP, ezio.melotti, vstinner priority: normal severity: normal status: open title: String formatting type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50166/1.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:07:41 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 13:07:41 +0000 Subject: [issue43629] fix _PyRun_SimpleFileObject create __main__ module and cache. Call this function multiple times, the attributes stored in the module dict will affect eachother. In-Reply-To: <1616731031.99.0.476866477615.issue43629@roundup.psfhosted.org> Message-ID: <1626786461.62.0.376624878264.issue43629@roundup.psfhosted.org> Petr Viktorin added the comment: The public function that calls _PyRun_SimpleFileObject is PyRun_SimpleStringFlags, and the behavior is as specified in its documentation: "Executes the Python source code from command in the __main__ module according to the flags argument. If __main__ does not already exist, it is created." https://docs.python.org/3.8/c-api/veryhigh.html?highlight=pyrun_simplefileexflags#c.PyRun_SimpleStringFlags ---------- nosy: +petr.viktorin stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:10:42 2021 From: report at bugs.python.org (Mykyta) Date: Tue, 20 Jul 2021 13:10:42 +0000 Subject: [issue44683] String formatting In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1626786642.38.0.609371920575.issue44683@roundup.psfhosted.org> Change by Mykyta : Removed file: https://bugs.python.org/file50166/1.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:21:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 13:21:09 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626787269.22.0.285301575245.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 965dd76e9060e27e2253ba8c8d21a142b178720d by Yurii Karabas in branch 'main': bpo-44353: Refactor typing.NewType into callable class (GH-27250) https://github.com/python/cpython/commit/965dd76e9060e27e2253ba8c8d21a142b178720d ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:21:16 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 13:21:16 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626787276.71.0.0749118415652.issue44353@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25803 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27258 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:26:30 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 13:26:30 +0000 Subject: [issue43334] venv does not install libpython In-Reply-To: <1614379216.7.0.137032053148.issue43334@roundup.psfhosted.org> Message-ID: <1626787590.82.0.559620640376.issue43334@roundup.psfhosted.org> Petr Viktorin added the comment: A venv does *not* create a replica of a python installation directory. Files shared with the main Python installation are not copied nor linked. This goes for the standard library, as well as the libraries and headers. (*Executables* are an exception; they're copied, since a venv needs them on the PATH.) Copies would take up unnecessary space, and not all operating systems support symbolic links (and we don't want another platform-specific difference), so the shared files are only referenced using pyvenv.cfg If you point to the macros you're using, I can take a look at how they could be improved. ---------- nosy: +petr.viktorin status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:31:15 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 13:31:15 +0000 Subject: [issue44663] Possible bug in datetime utc In-Reply-To: <1626556817.96.0.446467622076.issue44663@roundup.psfhosted.org> Message-ID: <1626787875.57.0.304946560382.issue44663@roundup.psfhosted.org> Change by Petr Viktorin : ---------- components: +Library (Lib) -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:34:52 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 20 Jul 2021 13:34:52 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626788092.94.0.485794858441.issue44353@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25804 pull_request: https://github.com/python/cpython/pull/27259 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 09:52:24 2021 From: report at bugs.python.org (Christian Fersch) Date: Tue, 20 Jul 2021 13:52:24 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1626789144.69.0.676339451146.issue40263@roundup.psfhosted.org> Christian Fersch added the comment: This is still an issue in python3.9. It just hit us while using the default config on a Threadripper 3990X that has 128 logical cores: with concurrent.futures.ProcessPoolExecutor() as executor: ---------- nosy: +Chronial versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:09:33 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 14:09:33 +0000 Subject: [issue42085] Add dedicated slot for sending values In-Reply-To: <1603136296.98.0.312180912341.issue42085@roundup.psfhosted.org> Message-ID: <1626790173.0.0.226788254265.issue42085@roundup.psfhosted.org> Petr Viktorin added the comment: Py_TPFLAGS_HAVE_AM_SEND is unnecessary and I'd like to remove it. It is not possible for type objects to have a different layout than the interpreter: - extensions using the regular ABI must be recompiled for each feature version of Python - extensions using the stable ABI can only create types dynamically Or is there a different reason for Py_TPFLAGS_HAVE_AM_SEND? Checking it may be faster than ((Py_TYPE(x)->tp_as_async != NULL) && (Py_TYPE(x)->tp_as_async->am_send != NULL)), but I don't think the speedup is relevant. See bpo-42747 ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:25:29 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 14:25:29 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1626791129.01.0.165384697986.issue42747@roundup.psfhosted.org> Petr Viktorin added the comment: The bit cannot be repurposed, since older extensions using the stable ABI might set it. It doesn't make much sense to remove the Py_TPFLAGS_HAVE_VERSION_TAG or Py_TPFLAGS_HAVE_FINALIZE defines; I'd let them stay to document that the bits are reserved. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:38:46 2021 From: report at bugs.python.org (Thomas Guettler) Date: Tue, 20 Jul 2021 14:38:46 +0000 Subject: [issue44684] Docs for mock.call Message-ID: <1626791926.02.0.184089521055.issue44684@roundup.psfhosted.org> New submission from Thomas Guettler : The docs for `mock.call` could get improved: https://docs.python.org/3/library/unittest.mock.html#call Up to now it is not clear how to access individual members of the call. Example: I want to check if the call used the kwarg "foo" with the value of "bar". Usually you don't need this, since you check for the whole call (all args and all kwargs). But sometimes you jus twant to check for a single arg/kwarg. Then it would be nice to have more detailed docs for the class "call". BTW: Why has this class a lower-case name? Looks a bit strange. ---------- assignee: docs at python components: Documentation messages: 397874 nosy: docs at python, guettli priority: normal severity: normal status: open title: Docs for mock.call versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:40:48 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 14:40:48 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1626792048.5.0.57684951881.issue42747@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +25805 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:43:57 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 14:43:57 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1626792237.06.0.450890713812.issue44588@roundup.psfhosted.org> Petr Viktorin added the comment: Please use Py_TPFLAGS_DEFAULT when creating objects. Do you have a reason to not do it? The flag Py_TPFLAGS_HAVE_VERSION_TAG is unneeded and Python should not check for it. There's bpo-42747 open for that already; I sent a PR for it. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:48:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 14:48:09 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626792489.38.0.22682953346.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4868b94c6089d457673b1ba5b5b64c2f38c435af by Yurii Karabas in branch 'main': bpo-44353: Add test to cover __or__ of two NewType (#27259) https://github.com/python/cpython/commit/4868b94c6089d457673b1ba5b5b64c2f38c435af ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 10:52:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 14:52:33 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626792753.11.0.854400663889.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: > Hm, 20% isn't so bad, but one of the arguments for NewType was that it "disappears" at runtime -- which the current version does, but the class-based version doesn't quite. NewType was described originally in https://github.com/python/typing/issues/189 and the resulting PEP text landed in https://github.com/python/typing/pull/226/files. I find the 20% performance impact non-ideal but ultimately worth it because: - it solves the issue described in this bug; - it allows us to implement issubclass/isinstance in the future if we so choose; - it also potentially allows us to chain NewType. Since we can't fully rely on `from __future__ import annotations` to side-step the performance cost, we don't really have a different option than to change it. The alternative is to leave it as is which makes it a non-composable pseudo-type unlike the others. Currently adoption of NewType is relatively low, in part due to the feature's obscurity and partially because of its limits. Slower instantiation performance will at worst keep the adoption low, but it can potentially bring more users to NewType since it becomes less hacky. I'm +1 to converting to a class as done by the PR. > Right now I don't have the cycles to think about this deeply. Maybe a few weeks after I'm back from vacation (~August 8) I will have more time. Sorry, I overeagerly already merged the change to `main`. Let's hold off with the 3.10 backport until you had time to think about it. If we decide against the change after all, reverting on `main` should have no negative impact since we're pre-alpha 1. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:00:44 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 20 Jul 2021 15:00:44 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626793244.51.0.367478337929.issue44353@roundup.psfhosted.org> Guido van Rossum added the comment: OTOH, for 3.10 the clock is ticking. Let's go for it. (If it's deemed too slow, we could eventually add an accelerator just for this.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:09:02 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Tue, 20 Jul 2021 15:09:02 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626793742.57.0.0770832303809.issue44353@roundup.psfhosted.org> Jelle Zijlstra added the comment: I found that replacing __call__ on the NewType class with an identity function written in C makes things faster instead: In [54]: %timeit ntc2(1) 79 ns ? 0.37 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) In [55]: %timeit ntc(1) 126 ns ? 0.315 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) In [56]: %timeit nt(1) 103 ns ? 4.23 ns per loop (mean ? std. dev. of 7 runs, 10000000 loops each) Here ntc2 has __call__ implemented in C, ntc is the previous class-based version and nt is the current function-based version. So perhaps we could just stick a private `._idfunc` in some C-implemented module (functools? types?) and use it as the __call__ for our NewType class. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:17:12 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 20 Jul 2021 15:17:12 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626794232.51.0.722645925051.issue44353@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: Jelle thanks for pointing this out, I will implement helper function in C and use it as a __call__ method for NewType ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:25:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 15:25:05 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626794705.28.0.143072283963.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c2f33dfc83ab270412bf243fb21f724037effa1a by Miss Islington (bot) in branch '3.10': bpo-44353: Refactor typing.NewType into callable class (GH-27250) (#27258) https://github.com/python/cpython/commit/c2f33dfc83ab270412bf243fb21f724037effa1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:26:18 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 15:26:18 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626794778.19.0.134581689659.issue44353@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25806 pull_request: https://github.com/python/cpython/pull/27261 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:42:22 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 15:42:22 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626795742.74.0.073956178302.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset fbc349ff790c21f1a59af939d42033470790c530 by Batuhan Taskaya in branch 'main': bpo-43950: Distinguish errors happening on character offset decoding (GH-27217) https://github.com/python/cpython/commit/fbc349ff790c21f1a59af939d42033470790c530 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:45:26 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 20 Jul 2021 15:45:26 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626795926.02.0.458950697584.issue44353@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25807 pull_request: https://github.com/python/cpython/pull/27262 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:47:33 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 20 Jul 2021 15:47:33 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1626796053.1.0.303361813288.issue44588@roundup.psfhosted.org> Change by Petr Viktorin : ---------- keywords: +patch pull_requests: +25808 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27260 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 11:59:56 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 20 Jul 2021 15:59:56 +0000 Subject: [issue44683] String formatting In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1626796796.45.0.016850534994.issue44683@roundup.psfhosted.org> Dennis Sweeney added the comment: If I understand correctly, this shows the behavior you're objecting to: >>> class A: ... def __getitem__(self, key): ... print(f"{key = }") ... return "apple" ... ... >>> '{0[1]}'.format(A()) # passes an integer key = 1 'apple' >>> '{0[apple]}'.format(A()) # passes a string key = 'apple' 'apple' >>> '{0["1"]}'.format(A()) # passes the length-3 string including double-quotes key = '"1"' 'apple' There's no clear way to use str.format() to get the value for the string key "1". However, I don't think it makes sense to backwards-incompatibly change the behavior to pass the string "1" instead of the integer 1, since a common use is indexing with integers like >>> "{0[0]}{0[2]}{0[4]}".format(("a", "b", "c, "d", "e")) 'ace' This is an edge case, but it is aligned with the specification: according to https://docs.python.org/3/library/string.html#format-string-syntax, """Because arg_name is not quote-delimited, it is not possible to specify arbitrary dictionary keys (e.g., the strings '10' or ':-]') within a format string.""" ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 12:00:14 2021 From: report at bugs.python.org (Victor Zhestkov) Date: Tue, 20 Jul 2021 16:00:14 +0000 Subject: [issue38091] Import deadlock detection causes deadlock In-Reply-To: <1568122000.74.0.240735069302.issue38091@roundup.psfhosted.org> Message-ID: <1626796814.8.0.780945919291.issue38091@roundup.psfhosted.org> Victor Zhestkov added the comment: I ported the fix from https://github.com/python/cpython/commit/6daa37fd42c5d5300172728e8b4de74fe0b319fc for 3.6 and 3.8 shipped with SLE 15SP2 and openSUSE Tumbleweed, but it seems that this fix doesn't help. I have a deadlocks on running `salt-api` process managing `salt-ssh` systems with high workload. The service can get the deadlock in first 5 minutes or after 3-60 minutes of running the service with the same workload with almost equal chances. Here is the part of py-bt I see each time: (gdb) py-bt Traceback (most recent call first): File "", line 107, in acquire File "", line 158, in __enter__ File "", line 595, in _exec File "", line 271, in _load_module_shim File "", line 852, in load_module File "", line 1027, in load_module File "", line 1034, in _check_name_wrapper File "/usr/lib/python3.8/site-packages/salt/loader.py", line 4779, in _load_module File "/usr/lib/python3.8/site-packages/salt/loader.py", line 1926, in _inner_load if self._load_module(name) and key in self._dict: File "/usr/lib/python3.8/site-packages/salt/loader.py", line 2193, in _load File "/usr/lib/python3.8/site-packages/salt/utils/lazy.py", line 99, in __getitem__ if self._load(key): File "/usr/lib/python3.8/site-packages/salt/loader.py", line 1283, in __getitem__ func = super().__getitem__(item) File "/usr/lib/python3.8/site-packages/salt/loader.py", line 1139, in __getitem__ return self._dict[key + self.suffix] File "/usr/lib/python3.8/site-packages/salt/template.py", line 495, in check_render_pipe_str File "/usr/lib/python3.8/site-packages/salt/loader.py", line 1428, in render f_noext, File "/usr/lib/python3.8/site-packages/salt/pillar/__init__.py", line 781, in __init__ ... ---------- nosy: +vzhestkov _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 12:02:15 2021 From: report at bugs.python.org (Heghine) Date: Tue, 20 Jul 2021 16:02:15 +0000 Subject: [issue44685] Email package issue with Outlook msg files Message-ID: <1626796935.18.0.522723051399.issue44685@roundup.psfhosted.org> New submission from Heghine : The email package has an issue with extracting the attachments from the email if the email is sent with the Outlook application with .msg files. When I'm sending an email from the Outlook app by attaching .msg files to the email, the recipient receives the email but instead of .msg files, the email contains .eml files. So Outlook auto transforms the attached .msg to .eml. When I'm trying to read and extract attachments with the email package by using the Message class "get_payload" method, the extracted data for the mentioned attachment doesn't contain necessary information like "content-disposition" or "filename", so working with that attachment is impossible. For all other .eml files everything works fine. The issue exists only in the case of transformed .eml files. However, that .eml looks like any other eml file in the received mail. ---------- components: email files: msg file.msg messages: 397885 nosy: barry, heghine, r.david.murray priority: normal severity: normal status: open title: Email package issue with Outlook msg files versions: Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50167/msg file.msg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 12:04:44 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 20 Jul 2021 16:04:44 +0000 Subject: [issue44683] Can't subscript objects with the string "1" using str.format() In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1626797084.56.0.726634273838.issue44683@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- title: String formatting -> Can't subscript objects with the string "1" using str.format() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 12:06:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 16:06:44 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626797204.82.0.17634538421.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9ae5ba7dbf08d56a1b30d67fcde75532fe136d77 by Miss Islington (bot) in branch '3.10': bpo-44353: Add test to cover __or__ of two NewType (GH-27259) (#27261) https://github.com/python/cpython/commit/9ae5ba7dbf08d56a1b30d67fcde75532fe136d77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 12:10:03 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Tue, 20 Jul 2021 16:10:03 +0000 Subject: [issue44684] Docs for mock.call In-Reply-To: <1626791926.02.0.184089521055.issue44684@roundup.psfhosted.org> Message-ID: <1626797403.59.0.402786269233.issue44684@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: > A call object is either a tuple of (positional args, keyword args) or (name, positional args, keyword args) depending on how it was constructed https://github.com/python/cpython/pull/11807 added support for args and kwargs from python 3.9. So I guess you want to do call_object.kwargs["foo"] == "bar" ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 13:15:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 17:15:49 +0000 Subject: [issue44631] Refactoring the repr() of the _Environ class (os module) In-Reply-To: <1626213867.27.0.881981550683.issue44631@roundup.psfhosted.org> Message-ID: <1626801349.52.0.517374997324.issue44631@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 85fa3b6b7c11897732fedc443db0e4e8e380c8f8 by Leonardo Freua in branch 'main': bpo-44631: Make the repr() of the _Environ class more readable. (#27128) https://github.com/python/cpython/commit/85fa3b6b7c11897732fedc443db0e4e8e380c8f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 13:16:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 17:16:06 +0000 Subject: [issue44631] Refactoring the repr() of the _Environ class (os module) In-Reply-To: <1626213867.27.0.881981550683.issue44631@roundup.psfhosted.org> Message-ID: <1626801366.49.0.998547816185.issue44631@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 13:23:27 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 17:23:27 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626801807.98.0.81616845469.issue42414@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 4.0 -> 5.0 pull_requests: +25809 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/27265 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 13:27:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 17:27:47 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626802067.99.0.797883837008.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up a simple PoC PR adding a __field_doc__ optional dict attr to dataclass, which would add the docs to class docstring: @dataclass class A: __field_doc__ = dict(num='number of widgets', total='total widgets') total: int num: int = 5 print(A.__doc__) OUTPUT --- A(total: int, num: int = 5) num: int [5] -- number of widgets total: int -- total widgets ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:02:14 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 20 Jul 2021 18:02:14 +0000 Subject: [issue44683] Can't subscript objects with the string "1" using str.format() In-Reply-To: <1626785904.54.0.269807586162.issue44683@roundup.psfhosted.org> Message-ID: <1626804134.25.0.499979665609.issue44683@roundup.psfhosted.org> Eric V. Smith added the comment: Yes, this is a "feature" of str.format. If it looks like a number, it's converted to a number, else it's used as a string. It's generally the most useful way to interpret subscripts, but as you note it doesn't handle all cases. ---------- nosy: +eric.smith resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:13:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:13:04 +0000 Subject: [issue44539] Support recognizing JPEG files without JFIF or Exif markers In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1626804784.41.0.187395699716.issue44539@roundup.psfhosted.org> ?ukasz Langa added the comment: When JFIF and Exif markers are removed, what we're left with is a "raw" JPEG file. I added a raw equivalent of Lib/test/imghdrdata/python.jpg by running: $ exiftool -all= python.jpg -o python-raw.jpg Mohamad's patch correctly adds support for such files. In fact, browsing through how other languages do this, it seems like the FF D8 FF DB sequence is a relatively popular "magic sequence". It's even listed in this Wikipedia page: https://en.wikipedia.org/wiki/List_of_file_signatures ---------- nosy: +lukasz.langa title: Imghdr JPG Quantized -> Support recognizing JPEG files without JFIF or Exif markers _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:15:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:15:14 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626804914.53.0.900179423244.issue44566@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7f1c330da31c54e028dceaf3610877914c2a4497 by Thomas Grainger in branch 'main': bpo-44566: resolve differences between asynccontextmanager and contextmanager (#27024) https://github.com/python/cpython/commit/7f1c330da31c54e028dceaf3610877914c2a4497 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:16:09 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 18:16:09 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626804969.21.0.369251750945.issue44566@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25810 pull_request: https://github.com/python/cpython/pull/27266 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:16:35 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 18:16:35 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626804995.84.0.245998965736.issue43219@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25811 pull_request: https://github.com/python/cpython/pull/27267 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:16:28 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Tue, 20 Jul 2021 18:16:28 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626804988.72.0.760951609557.issue43219@roundup.psfhosted.org> Gregory P. Smith added the comment: New changeset 6564656495d456a1bcc1aaa06abfc696209f37b2 by Jakub Kul?k in branch 'main': bpo-43219: skip Solaris in the test as well (GH-27257) https://github.com/python/cpython/commit/6564656495d456a1bcc1aaa06abfc696209f37b2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:16:59 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 18:16:59 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626805019.81.0.904292965251.issue43219@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25812 pull_request: https://github.com/python/cpython/pull/27268 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:20:03 2021 From: report at bugs.python.org (John-Mark Gurney) Date: Tue, 20 Jul 2021 18:20:03 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626805203.01.0.506493151889.issue42414@roundup.psfhosted.org> John-Mark Gurney added the comment: Though this suggestion does work, I am not a fan of this solution. The issue is that it separates the doc from the definition. This works well if you have only a field fields in the class, But if you get 10-20+ fields, it moves away the docs and makes it easier for people to forget to add documentation to the field when they add additional fields, where w/ my suggestion, it's less likely that it will be forgotten. Note: I would look at making a patch, but as I don't plan on signing the contributor's agreement, any patch I make will not be usable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:25:18 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 18:25:18 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1626805203.01.0.506493151889.issue42414@roundup.psfhosted.org> Message-ID: Andrei Kulakov added the comment: John-Mark: each fields doc can be added to the dictionary separately though.. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:42:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:42:16 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626806536.75.0.639599502082.issue44566@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25813 pull_request: https://github.com/python/cpython/pull/27269 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:44:46 2021 From: report at bugs.python.org (John-Mark Gurney) Date: Tue, 20 Jul 2021 18:44:46 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626806686.25.0.548197459623.issue42414@roundup.psfhosted.org> John-Mark Gurney added the comment: So, just looked at the patch, but it's missing the documentation part of it. Also, yes, you can add the doc as another line, but now that's two lines (yes, you can add semicolons to make it one line, but that might surprise some people). I do request that any examples USE this approach (multiline) and not the example that was provided here which will lead the issues. Note: These are only suggestions, and as with all free software, you're free to take them or leave them. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:45:11 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 18:45:11 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626806711.76.0.227586580043.issue43219@roundup.psfhosted.org> miss-islington added the comment: New changeset dae4928dd07109db69e090b1c8193a023ce695cd by Miss Islington (bot) in branch '3.9': [3.9] bpo-43219: skip Solaris in the test as well (GH-27257) (GH-27267) https://github.com/python/cpython/commit/dae4928dd07109db69e090b1c8193a023ce695cd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:53:47 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 20 Jul 2021 18:53:47 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1613279788.4.0.734801709372.issue43219@roundup.psfhosted.org> Message-ID: <1626807227.75.0.237675533938.issue43219@roundup.psfhosted.org> miss-islington added the comment: New changeset 574da4633b44b4048f74c93da496ed2a3ead99dd by Miss Islington (bot) in branch '3.10': [3.10] bpo-43219: skip Solaris in the test as well (GH-27257) (GH-27268) https://github.com/python/cpython/commit/574da4633b44b4048f74c93da496ed2a3ead99dd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:57:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:57:04 +0000 Subject: [issue44539] Support recognizing JPEG files without JFIF or Exif markers In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1626807424.44.0.932915321267.issue44539@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3b56b3b97d91e2b412ce1b2bcaddcd43ef3d223b by Mohamad Mansour in branch 'main': bpo-44539: Support recognizing JPEG files without JFIF or Exif markers (GH-26964) https://github.com/python/cpython/commit/3b56b3b97d91e2b412ce1b2bcaddcd43ef3d223b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:57:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:57:30 +0000 Subject: [issue44539] Support recognizing JPEG files without JFIF or Exif markers In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1626807450.3.0.886440069043.issue44539@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 14:58:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 18:58:16 +0000 Subject: [issue44539] Support recognizing JPEG files without JFIF or Exif markers In-Reply-To: <1625040766.45.0.209799652803.issue44539@roundup.psfhosted.org> Message-ID: <1626807496.52.0.543842465441.issue44539@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Mohamad! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:03:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 19:03:44 +0000 Subject: [issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist In-Reply-To: <1626807227.75.0.237675533938.issue43219@roundup.psfhosted.org> Message-ID: Andrei Kulakov added the comment: Thanks for reporting Jakub, and for patching Gregory! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:12:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 19:12:54 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626808374.76.0.995974278763.issue44566@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 68b4690b010d0006e9b0235903afd367191f3c51 by Miss Islington (bot) in branch '3.10': bpo-44566: resolve differences between asynccontextmanager and contextmanager (GH-27024) (#27266) https://github.com/python/cpython/commit/68b4690b010d0006e9b0235903afd367191f3c51 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:13:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 19:13:02 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626808382.45.0.647178423171.issue44566@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf by ?ukasz Langa in branch '3.9': [3.9] bpo-44566: resolve differences between asynccontextmanager and contextmanager (GH-27024). (#27269) https://github.com/python/cpython/commit/1c5c9c89ffc36875afaf4c3cc6a716d4bd089bbf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:13:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 20 Jul 2021 19:13:37 +0000 Subject: [issue44566] StopIteration subclass suppressed by contextlib.contextmanager In-Reply-To: <1625478340.34.0.529262409181.issue44566@roundup.psfhosted.org> Message-ID: <1626808417.11.0.513071940269.issue44566@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:29:08 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 20 Jul 2021 19:29:08 +0000 Subject: [issue44686] use pkgutil.resolve_name in unittest.mock Message-ID: <1626809348.44.0.635818901045.issue44686@roundup.psfhosted.org> New submission from Thomas Grainger : per https://bugs.python.org/issue12915 pkgutil.resolve_name was added for use in mock and other stdlib modules: > pydoc has locate and resolve, packaging has util.resolve_name, unittest has something else, etc. ---------- messages: 397905 nosy: graingert priority: normal pull_requests: 25814 severity: normal status: open title: use pkgutil.resolve_name in unittest.mock versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 15:41:52 2021 From: report at bugs.python.org (Ned Deily) Date: Tue, 20 Jul 2021 19:41:52 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626810112.46.0.255357975458.issue42854@roundup.psfhosted.org> Change by Ned Deily : ---------- nosy: +pablogsal stage: resolved -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 16:39:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 20:39:25 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626813565.53.0.908157721652.issue42854@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I will push a fix today ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 16:42:34 2021 From: report at bugs.python.org (liquidpele) Date: Tue, 20 Jul 2021 20:42:34 +0000 Subject: [issue44687] io.BufferedReader:peek() closes underlying file, breaking peek/read expectations Message-ID: <1626813754.71.0.447249212898.issue44687@roundup.psfhosted.org> New submission from liquidpele : reecepeg at 3c22fb7d6b37 Pulpmill % python3 --version Python 3.9.1 When buffering a small file, calling peek() can read in the entire underlying thing and close it, so then following with a read() throws an error about the file being closed already even though peek should not have that effect. Reproducible Steps: >>> r = BufferedReader(requests.get("https://google.com", stream=True).raw) >>> r.peek(2)[:2] b'\x1f\x8b' >>> r.peek() Traceback (most recent call last): File "", line 1, in ValueError: peek of closed file >>> r.read() Traceback (most recent call last): File "", line 1, in ValueError: read of closed file However, in the case of a larger stream it appears to work since the underlying stream isn't closed yet: >>> r = BufferedReader(requests.get("https://amazon.com", stream=True).raw) >>> r.peek(2)[:2] b'\x1f\x8b' >>> r.peek(2)[:2] b'\x1f\x8b' This seems inconsistent at best. Best I can tell, the issue is here and needs to take the current buffer offset into account. https://github.com/python/cpython/blob/main/Modules/_io/bufferedio.c#L845 ---------- components: IO messages: 397907 nosy: liquidpele priority: normal severity: normal status: open title: io.BufferedReader:peek() closes underlying file, breaking peek/read expectations versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 16:51:09 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 20 Jul 2021 20:51:09 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626814269.39.0.507369023238.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: John-Mark: yep, it's just a draft patch for now. It doesn't need to be two lines; it can be updated to start with an empty dict and perhaps use a shorter special name for the doc dict and then you can do: f1:int = 1 FDOC['f1'] = 'foo' f2:str = 'a' FDOC['f2'] = 'bar' ... the nice thing is that you have the flexibility to either group all docs into one place or set them after each field, I can imagine many users will prefer the former. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 16:52:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 20:52:14 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1626814334.03.0.339237628579.issue42854@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25815 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27271 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:06:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 21:06:28 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626815188.59.0.876559813225.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't know, seems that rust can deal with this just fine: ? cargo run Compiling rtest v0.1.0 (/home/pablogsal/rtest) error[E0308]: mismatched types --> src/main.rs:7:10 | 7 | test("hellooooooo: ? ? ? ? ? some emojis"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | expected struct `String`, found `&str` | help: try using a conversion method: `"hellooooooo: ? ? ? ? ? some emojis".to_string()` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:07:08 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 21:07:08 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626815228.69.0.705389799702.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In bpo this looks bad, but test this small program yourself and check the error in your terminal: fn test(number: String) -> () { println!("Hello, world: {}", number); } fn main() { test("hellooooooo: ? ? ? ? ? some emojis"); } ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:09:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 21:09:52 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626815392.96.0.965275668641.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: They seem to be checking the unicode width as we are proposing here. Check the calls to unicode_width::UnicodeWidthChar::width: https://github.com/rust-lang/rust/blob/master/compiler/rustc_errors/src/emitter.rs#L729-L733 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:13:59 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 20 Jul 2021 21:13:59 +0000 Subject: [issue44688] [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation() Message-ID: <1626815639.0.0.124949004074.issue44688@roundup.psfhosted.org> New submission from Erlend E. Aasland : The sqlite3.Connection.create_collation() function limits collation names to ASCII characters only. As sqlite3_create_collation_v2() (and sqlite3_create_collation()) support UTF8, there is no need for this limitation anymore. See https://github.com/python/cpython/pull/27156#issuecomment-883694653 ---------- assignee: erlendaasland components: Extension Modules messages: 397912 nosy: erlendaasland, petr.viktorin priority: normal severity: normal status: open title: [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation() type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:44:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Tue, 20 Jul 2021 21:44:25 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626817465.38.0.940287954857.issue42414@roundup.psfhosted.org> Eric V. Smith added the comment: I think we'd be better off adding a doc parameter to dataclasses.field, and then as @terry.reedy says, modify inspect.getdoc and maybe_finddoc to look in __dataclass_fields__, if it exists. ---------- versions: +Python 3.11 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:45:09 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 20 Jul 2021 21:45:09 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626817509.75.0.374800812589.issue43950@roundup.psfhosted.org> Ammar Askar added the comment: Indeed, and the unicode_width package seems to implement the wcwidth algorithm: * https://github.com/unicode-rs/unicode-width/blob/master/src/tables.rs#L39-L48 * https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c https://bugs.python.org/issue12568 is an issue from the past that proposed adding wcwidth to the standard library. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:51:09 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 20 Jul 2021 21:51:09 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1626817869.74.0.96626911523.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Even if this doesn't cover all cases it seems that everyone else is going with this solution for what I can see, and currently this looks suboptimal on python because we get this wrong on the vast majority of cases so my suggestion is to try to fix this the same way rust on others are doing it even if there is some subset of cases where it won't fully work ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:56:46 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Tue, 20 Jul 2021 21:56:46 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur Message-ID: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> New submission from Tobias Bergkvist : Python-binaries compiled on either Big Sur or Catalina - and moved to the other MacOS-version will not work as expected when code depends on ctypes.util.find_library. Example symptom of this issue: https://github.com/jupyterlab/jupyterlab/issues/9863 I have personally faced this when using Python from nixpkgs - since nixpkgs Python has been built on Catalina - and I'm using Big Sur. Scenario 1: Compile on Catalina, copy binaries to BigSur, and call ctypes.util.find_library('c') Python 3.11.0a0 (heads/main:635bfe8162, Jul 19 2021, 08:09:05) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes.util import find_library; print(find_library('c')) None Scenario 2: Compile on Big Sur, copy binaries to Catalina, and call ctypes.util.find_library('c'): Python 3.11.0a0 (heads/main:635bfe8162, Jul 19 2021, 08:28:48) [Clang 12.0.5 (clang-1205.0.22.11)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes.util import find_library; print(find_library('c')) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.11/ctypes/__init__.py", line 8, in from _ctypes import Union, Structure, Array ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: dlopen(/usr/local/lib/python3.11/lib-dynload/_ctypes.cpython-311-darwin.so, 2): Symbol not found: __dyld_shared_cache_contains_path Referenced from: /usr/local/lib/python3.11/lib-dynload/_ctypes.cpython-311-darwin.so (which was built for Mac OS X 11.4) Expected in: /usr/lib/libSystem.B.dylib in /usr/local/lib/python3.11/lib-dynload/_ctypes.cpython-311-darwin.so ---------- components: ctypes messages: 397916 nosy: bergkvist priority: normal pull_requests: 25816 severity: normal status: open title: MacOS: Python binaries not portable between Catalina and Big Sur type: behavior versions: Python 3.10, Python 3.11, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:57:36 2021 From: report at bugs.python.org (Idan Moral) Date: Tue, 20 Jul 2021 21:57:36 +0000 Subject: [issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode Message-ID: <1626818256.45.0.373140812425.issue44690@roundup.psfhosted.org> New submission from Idan Moral : This is a follow-up PR to GH-24402. Currently, *base64.b64decode* uses a generic regex to validate *s* (when *validate* is true), which sometimes results in unexpected behavior and exception messages. Example: (1) base64.b64decode('ab==', validate=True) # b'i' (2) base64.b64decode('ab3==', validate=True) # b'i\xbd' (3) base64.b64decode('ab=3=', validate=True) # raises binascii.Error: Non-base64 digit found (4) base64.b64decode('ab==3', validate=True) # raises binascii.Error: Non-base64 digit found (5) base64.b64decode('ab===', validate=True) # raises binascii.Error: Non-base64 digit found (6) base64.b64decode('=ab==', validate=True) # raises binascii.Error: Non-base64 digit found The only strict-base64 valid example here is (1). (2), (4) and (5) should raise 'Excess data after padding', (3) should raise 'Discontinuous padding not allowed', and (6) should raise 'Leading padding not allowed'. To get this behavior, we can use the new (at the time of creating this PR) *binascii.a2b_base64* functionality of strict mode. I have one (not so big) concern - efficiency. I'm not that experienced with how fast regex-es are (in Python or in general) compared to the implementation of *binascii.a2b_base64* in C. So, I've no idea what would be the impact of migrating from regex pre-validation to input parsing. Let me know if you find it inefficient. ----- Referenced issue (GH-24402): https://bugs.python.org/issue43086 ---------- components: Library (Lib) messages: 397917 nosy: idan22moral priority: normal severity: normal status: open title: Adopt binacii.a2b_base64's strict mode in base64.b64decode type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 17:59:55 2021 From: report at bugs.python.org (Zachary Ware) Date: Tue, 20 Jul 2021 21:59:55 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626818395.22.0.973824682444.issue44689@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: +macOS nosy: +ned.deily, ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 18:01:11 2021 From: report at bugs.python.org (Idan Moral) Date: Tue, 20 Jul 2021 22:01:11 +0000 Subject: [issue44690] Adopt binacii.a2b_base64's strict mode in base64.b64decode In-Reply-To: <1626818256.45.0.373140812425.issue44690@roundup.psfhosted.org> Message-ID: <1626818471.01.0.248393037276.issue44690@roundup.psfhosted.org> Change by Idan Moral : ---------- keywords: +patch pull_requests: +25817 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27272 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 18:03:33 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 20 Jul 2021 22:03:33 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1626818613.1.0.471385429109.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25818 pull_request: https://github.com/python/cpython/pull/27273 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 19:01:09 2021 From: report at bugs.python.org (pierpaolo paolucci) Date: Tue, 20 Jul 2021 23:01:09 +0000 Subject: [issue44691] bug in interactions between argparse and random Message-ID: <1626822069.01.0.152185691675.issue44691@roundup.psfhosted.org> New submission from pierpaolo paolucci : Python 3.9.6 (default, Jun 28 2021, 11:30:47) [GCC 10.3.0] on linux I tried to run the first time a prg and successively reproduce eventals error see the attachment ---------- components: Library (Lib) files: testRandom.py messages: 397918 nosy: peeble111 priority: normal severity: normal status: open title: bug in interactions between argparse and random type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50168/testRandom.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 19:26:27 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 20 Jul 2021 23:26:27 +0000 Subject: [issue44691] bug in interactions between argparse and random In-Reply-To: <1626822069.01.0.152185691675.issue44691@roundup.psfhosted.org> Message-ID: <1626823587.04.0.289237428758.issue44691@roundup.psfhosted.org> Steven D'Aprano added the comment: args.seed if args.seed else SEED is not doing what you think it is doing. SEED is an *int* but args.seed is a *str*: >>> random.seed(6385845682483836956) >>> random.randint(10, 500) 92 >>> random.seed('6385845682483836956') >>> random.randint(10, 500) 347 ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 20:21:04 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 21 Jul 2021 00:21:04 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1626826864.05.0.71481521292.issue44611@roundup.psfhosted.org> Dong-hee Na added the comment: @tim.peters Can you please take a look at GH-27168? I would like to get your review before merging this PR :) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 20 22:41:27 2021 From: report at bugs.python.org (Ziyue Jiang) Date: Wed, 21 Jul 2021 02:41:27 +0000 Subject: [issue44588] Possible double Py_XDECREF in cpython typeobject.c In-Reply-To: <1625816576.72.0.961811325194.issue44588@roundup.psfhosted.org> Message-ID: <1626835287.61.0.797868889541.issue44588@roundup.psfhosted.org> Ziyue Jiang added the comment: Thanks for replying. I did fix my code by adding Py_TPFLAGS_DEFAULT. It's okay. I just think the behavior is a little strange when I don't set the default flag, thus adding this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 01:18:16 2021 From: report at bugs.python.org (anthony shaw) Date: Wed, 21 Jul 2021 05:18:16 +0000 Subject: [issue44692] Const unfolding in parser with negative numbers doesn't match float/int behaviour Message-ID: <1626844696.89.0.509830033076.issue44692@roundup.psfhosted.org> New submission from anthony shaw : Powers with negative bases do not observe the same rules that float_pow/long_pow do when it comes to returning negative results/ Example: > -2 ** 2 -4 >>> x = -2 >>> y = 2 >>> x ** y 4 >>> -2. ** 2. -4.0 >>> x = -2. >>> y = 2. >>> x ** y 4.0 Tested on 3.8, 3.9 and 3.10, they all have the same bug. ---------- components: Parser messages: 397922 nosy: anthonypjshaw, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: Const unfolding in parser with negative numbers doesn't match float/int behaviour type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 01:24:49 2021 From: report at bugs.python.org (anthony shaw) Date: Wed, 21 Jul 2021 05:24:49 +0000 Subject: [issue44692] Const folding in parser with negative numbers doesn't match float/int behaviour In-Reply-To: <1626844696.89.0.509830033076.issue44692@roundup.psfhosted.org> Message-ID: <1626845089.9.0.846337455801.issue44692@roundup.psfhosted.org> Change by anthony shaw : ---------- title: Const unfolding in parser with negative numbers doesn't match float/int behaviour -> Const folding in parser with negative numbers doesn't match float/int behaviour _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 01:25:37 2021 From: report at bugs.python.org (Tim Peters) Date: Wed, 21 Jul 2021 05:25:37 +0000 Subject: [issue44692] Const folding in parser with negative numbers doesn't match float/int behaviour In-Reply-To: <1626844696.89.0.509830033076.issue44692@roundup.psfhosted.org> Message-ID: <1626845137.28.0.136820069346.issue44692@roundup.psfhosted.org> Tim Peters added the comment: The binary power operator (`**`) has higher precedence than the unary negation operator (`-`). That is, -x**y groups as -(x**y). Not a bug - that's how it was designed and how it's documented. Note that this isn't novel, either. For example, to give just one example of many, that's how Maxima does it too: (%i1) -2**3; (%o1) -8 ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 01:26:37 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Jul 2021 05:26:37 +0000 Subject: [issue44692] Const folding in parser with negative numbers doesn't match float/int behaviour In-Reply-To: <1626844696.89.0.509830033076.issue44692@roundup.psfhosted.org> Message-ID: <1626845197.24.0.498211167089.issue44692@roundup.psfhosted.org> Steven D'Aprano added the comment: Not a bug, this is due to operator precedence. It is documented under the power operator: https://docs.python.org/3/reference/expressions.html#the-power-operator and in the operator precedence table: https://docs.python.org/3/reference/expressions.html#operator-precedence If you want to raise a negative literal to a power, you need parentheses: (-2)**2 ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 01:31:43 2021 From: report at bugs.python.org (anthony shaw) Date: Wed, 21 Jul 2021 05:31:43 +0000 Subject: [issue44692] Const folding in parser with negative numbers doesn't match float/int behaviour In-Reply-To: <1626844696.89.0.509830033076.issue44692@roundup.psfhosted.org> Message-ID: <1626845503.11.0.91379577205.issue44692@roundup.psfhosted.org> anthony shaw added the comment: Thanks! I didn't realise it applied the negative operator instead of loading the constant value. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 03:07:25 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 21 Jul 2021 07:07:25 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626851245.54.0.172211119118.issue44689@roundup.psfhosted.org> Ronald Oussoren added the comment: The problem with moving from Catalina to Big Sur is a known issue, AFAIK there's an open issue for this. The problem is that Big Sur moved system libraries into a big blob (which Apple calls the shared library cache). Ctypes uses an API that's new in macOS 11 to check if a library is in that cache, but only when compiled with the the macOS 11 SDK or later as the API is not available in earlier SDKs. Moving from Big Sur to earlier version should work fine, but only if you set the deployment target correctly during the build. This is how the "universal2" installers on python.org are build. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 03:55:26 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Wed, 21 Jul 2021 07:55:26 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626854126.0.0.194123780738.issue44689@roundup.psfhosted.org> Ronald Oussoren added the comment: Anyways, the solution for "build on older macOS version, deploy to Big Sur" is to dynamically look for the relevant API (``_dyld_shared_cache_contains_path``) and use it when available. But only in that scenario, the current code path using explicit weak linking should be kept for those building using a recent SDK (cleaner code, better error reporting). This should be a fairly easy patch, but I don't know when I'll get around to looking into this further. Alternatively we could require that Python is build using the macOS 11 SDK (or later) when targeting Big Sur. I'm dropping 3.8 from the list of versions because it is in "bug fix only" mode and won't receive a patch for this. IIRC 3.8 also doesn't support Big Sur in the first place, we've only back ported Big Sur support to 3.9. ---------- stage: -> needs patch versions: -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:33:15 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 21 Jul 2021 08:33:15 +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: <1626856395.21.0.764683638123.issue30511@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 64f54b7ccd49764b0304e076bfd79b5482988f53 by andrei kulakov in branch 'main': bpo-30511: Add note on thread safety to shutil.make_archive() (#26933) https://github.com/python/cpython/commit/64f54b7ccd49764b0304e076bfd79b5482988f53 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:33:36 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 08:33: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: <1626856416.18.0.614155877977.issue30511@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25819 pull_request: https://github.com/python/cpython/pull/27274 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:33:41 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 08:33:41 +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: <1626856421.6.0.607394081491.issue30511@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25820 pull_request: https://github.com/python/cpython/pull/27275 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:33:47 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 08:33:47 +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: <1626856427.71.0.235014640331.issue30511@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25821 pull_request: https://github.com/python/cpython/pull/27276 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:38:50 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Wed, 21 Jul 2021 08:38:50 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626856730.88.0.61992072251.issue44689@roundup.psfhosted.org> Tobias Bergkvist added the comment: An alternative to using _dyld_shared_cache_contains_path is to use dlopen to check for library existence (which is what Apple recommends in their change notes: https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes). > New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286) I have created a PR which modifies the current find_library from using _dyld_shared_cache_contains_path to dlopen. It passes all of the existing find_library-tests: https://github.com/python/cpython/pull/27251 There might be downsides to using dlopen (performance?) or something else I haven't considered. The huge upside however, is that the function is basically available on all Unix-systems. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:45:17 2021 From: report at bugs.python.org (Steven Hsu) Date: Wed, 21 Jul 2021 08:45:17 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs Message-ID: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> New submission from Steven Hsu : In Doc/glossary.rst, the first sentence of the entry "__future__" is that "A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter." However, in Doc/library/__future__.rst, the first sentence is that ":mod:`__future__` is a real module, and serves three purposes:" Is there any contradiction of these two descriptions, that "pseuso-module" and "real module" refer to the same module? And if so, should we fix one of them? Thanks for review! ---------- assignee: docs at python components: Documentation messages: 397931 nosy: StevenHsuYL, docs at python priority: normal severity: normal status: open title: Unclear definition of the "__future__" module in Docs type: enhancement versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:55:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 21 Jul 2021 08:55:47 +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: <1626857747.81.0.347231800016.issue30511@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d17449f31d4af7a735e81b587bb329481764412f by Miss Islington (bot) in branch '3.10': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27274) https://github.com/python/cpython/commit/d17449f31d4af7a735e81b587bb329481764412f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 04:55:50 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Jul 2021 08:55:50 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1626857750.13.0.677736036197.issue44693@roundup.psfhosted.org> Steven D'Aprano added the comment: I agree that the contradiction should be resolved. There is an actual `__future__.py` module, which on my system it is at /usr/local/lib/python3.9/__future__.py But when we use the special syntax: from __future__ import it doesn't do a normal import of the `__future__.py` module, it is actually a compiler directive. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 05:04:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 21 Jul 2021 09:04:56 +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: <1626858296.02.0.837487125805.issue30511@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 54d387105a5f0c3825a0f4fa607b58d55d05e572 by Miss Islington (bot) in branch '3.8': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (#27276) https://github.com/python/cpython/commit/54d387105a5f0c3825a0f4fa607b58d55d05e572 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 05:04:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 21 Jul 2021 09:04:56 +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: <1626858295.88.0.326378695471.issue30511@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c8e35abfe304eb052a5220974006072c37d4b06a by Miss Islington (bot) in branch '3.9': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27275) https://github.com/python/cpython/commit/c8e35abfe304eb052a5220974006072c37d4b06a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 05:04:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 21 Jul 2021 09:04:55 +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: <1626858295.88.0.326378695471.issue30511@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c8e35abfe304eb052a5220974006072c37d4b06a by Miss Islington (bot) in branch '3.9': bpo-30511: Add note on thread safety to shutil.make_archive() (GH-26933) (GH-27275) https://github.com/python/cpython/commit/c8e35abfe304eb052a5220974006072c37d4b06a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 05:18:15 2021 From: report at bugs.python.org (Jurj Andrei George) Date: Wed, 21 Jul 2021 09:18:15 +0000 Subject: [issue44671] Create a built-in yaml module In-Reply-To: <1626644028.22.0.677421965462.issue44671@roundup.psfhosted.org> Message-ID: <1626859095.99.0.450356897778.issue44671@roundup.psfhosted.org> Jurj Andrei George added the comment: I would also like to have yaml in the stdlib. I reckon it would make sense to at least discuss yaml given that toml is on its way in the stdlib. By the time a toml parser gets added, yaml will be the only major data serialization language to not be included in the stdlib. ---------- nosy: +TheOneTheOnlyJJ _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 07:06:27 2021 From: report at bugs.python.org (Vitas Ivanoff) Date: Wed, 21 Jul 2021 11:06:27 +0000 Subject: [issue44694] Message from BytesParser cannot be flattened immediately Message-ID: <1626865587.67.0.966185604714.issue44694@roundup.psfhosted.org> New submission from Vitas Ivanoff : Hello. Here is my code: #Parse message from file and immediately flatten it cur_policy = email.policy.SMTPUTF8 with open("/tmp/0.tmp", "rb") as orig_message_file: message_bytes = orig_message_file.read() message_parser = BytesParser(policy=cur_policy) msg = message_parser.parsebytes(message_bytes) with open("/tmp/1.tmp", "wb") as new_message_file: message_gen = BytesGenerator(new_message_file, policy=cur_policy) message_gen.flatten(msg) On some messages script raises the following error: Traceback (most recent call last): File "/misc/parsemail/./1.py", line 34, in message_gen.flatten(msg) File "/usr/lib/python3.9/email/generator.py", line 116, in flatten self._write(msg) File "/usr/lib/python3.9/email/generator.py", line 199, in _write self._write_headers(msg) File "/usr/lib/python3.9/email/generator.py", line 422, in _write_headers self._fp.write(self.policy.fold_binary(h, v)) File "/usr/lib/python3.9/email/policy.py", line 200, in fold_binary folded = self._fold(name, value, refold_binary=self.cte_type=='7bit') File "/usr/lib/python3.9/email/policy.py", line 214, in _fold return self.header_factory(name, ''.join(lines)).fold(policy=self) File "/usr/lib/python3.9/email/headerregistry.py", line 257, in fold return header.fold(policy=policy) File "/usr/lib/python3.9/email/_header_value_parser.py", line 156, in fold return _refold_parse_tree(self, policy=policy) File "/usr/lib/python3.9/email/_header_value_parser.py", line 2825, in _refold_parse_tree last_ew = _fold_as_ew(tstr, lines, maxlen, last_ew, File "/usr/lib/python3.9/email/_header_value_parser.py", line 2913, in _fold_as_ew encoded_word = _ew.encode(to_encode_word, charset=encode_as) File "/usr/lib/python3.9/email/_encoded_words.py", line 222, in encode bstring = string.encode('ascii', 'surrogateescape') UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-7: ordinal not in range(128) Policies 'default' and 'SMTP' are also affected. How to fix: #For broken messages message_gen = BytesGenerator(new_message_file, policy=cur_policy, maxheaderlen=0) Well, but parsing and flattening the same *unmodified* message should be completed without using any additional parameters, isn't it? Thanks. ---------- components: email messages: 397937 nosy: barry, r.david.murray, vitas1 priority: normal severity: normal status: open title: Message from BytesParser cannot be flattened immediately type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 07:29:22 2021 From: report at bugs.python.org (Itay azolay) Date: Wed, 21 Jul 2021 11:29:22 +0000 Subject: [issue44695] asdict use deep copy to dataclass instances Message-ID: <1626866962.24.0.087690350539.issue44695@roundup.psfhosted.org> New submission from Itay azolay : Hi, I noticed that 'asdict' use 'deepcopy' on all fields of the dataclass recursively. I believe this behavior can become optional with an argument, and shouldn't be decided for the user as the deepcopy takes significant amount of cpu and can have unexpected consequences on memory. I don't mind taking this PR if you agree. Thanks ---------- components: Library (Lib) messages: 397938 nosy: Itayazolay priority: normal severity: normal status: open title: asdict use deep copy to dataclass instances type: behavior versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 07:39:14 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 21 Jul 2021 11:39:14 +0000 Subject: [issue44695] asdict use deep copy to dataclass instances In-Reply-To: <1626866962.24.0.087690350539.issue44695@roundup.psfhosted.org> Message-ID: <1626867554.81.0.214973125902.issue44695@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 07:45:02 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Wed, 21 Jul 2021 11:45:02 +0000 Subject: [issue44671] Create a built-in yaml module In-Reply-To: <1626644028.22.0.677421965462.issue44671@roundup.psfhosted.org> Message-ID: <1626867902.51.0.462885380275.issue44671@roundup.psfhosted.org> Karthikeyan Singaravelan added the comment: There was some discussion in 2013 : https://mail.python.org/archives/list/python-ideas at python.org/thread/Y3Y5T54S2RSR6QW3HSEQV77EZPP7PWCX/#7H72ZRMSX74453GGURV26242UYM75VOW . This has to go through python-ideas and probably might need a PEP. There is also a request to add toml https://bugs.python.org/issue40059 ---------- nosy: +xtreak _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 07:48:13 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 11:48:13 +0000 Subject: [issue44686] use pkgutil.resolve_name in unittest.mock In-Reply-To: <1626809348.44.0.635818901045.issue44686@roundup.psfhosted.org> Message-ID: <1626868093.77.0.137282689583.issue44686@roundup.psfhosted.org> miss-islington added the comment: New changeset ab7fcc8fbdc11091370deeb000a787fb02f9b13d by Thomas Grainger in branch 'main': bpo-44686 replace unittest.mock._importer with pkgutil.resolve_name (GH-18544) https://github.com/python/cpython/commit/ab7fcc8fbdc11091370deeb000a787fb02f9b13d ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 08:21:46 2021 From: report at bugs.python.org (chen-y0y0) Date: Wed, 21 Jul 2021 12:21:46 +0000 Subject: [issue44696] Python 2.0.1 Installation: Message-ID: <1626870106.9.0.48016161015.issue44696@roundup.psfhosted.org> New submission from chen-y0y0 : # I tried to install Python 2.0.1 onto my virtual machine(Windows 3.1) for low-version developing, but an error occurred while the installation: # Error # Could not load the DLL library # C:\TEMP\~GLF256B.TMP. ---------- components: IO, Installation, Library (Lib), Windows messages: 397941 nosy: paul.moore, prasechen, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python 2.0.1 Installation: type: crash _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 08:34:09 2021 From: report at bugs.python.org (Denis Laxalde) Date: Wed, 21 Jul 2021 12:34:09 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626870849.45.0.816024168193.issue44353@roundup.psfhosted.org> Change by Denis Laxalde : ---------- nosy: +dlax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 08:46:09 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Jul 2021 12:46:09 +0000 Subject: [issue44696] Python 2.0.1 Installation: In-Reply-To: <1626870106.9.0.48016161015.issue44696@roundup.psfhosted.org> Message-ID: <1626871569.88.0.452030795242.issue44696@roundup.psfhosted.org> Steven D'Aprano added the comment: Python 2.0.1 is 20 years old and not supported. I don't think that installing Python on Windows 3.1 has ever been supported. But even if it was, we're certainly not supporting it now. ---------- nosy: +steven.daprano resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 08:51:57 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 21 Jul 2021 12:51:57 +0000 Subject: [issue44696] Python 2.0.1 Installation: In-Reply-To: <1626870106.9.0.48016161015.issue44696@roundup.psfhosted.org> Message-ID: <1626871917.82.0.697260655358.issue44696@roundup.psfhosted.org> Steven D'Aprano added the comment: If you really need to get Python 2.0.1 working on Windows 3.1 for some reason, you might find somebody interested in the problem on one of the various Python forums. You could try the Python-Dev mailing list, or Python-List mailing list, or Reddit's r/python, or on IRC: https://www.python.org/community/irc/ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 08:54:45 2021 From: report at bugs.python.org (Steven Hsu) Date: Wed, 21 Jul 2021 12:54:45 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1626872085.0.0.446291454941.issue44693@roundup.psfhosted.org> Steven Hsu added the comment: It sounds like that both descriptions (pseudo- and real) are true in different points of view on the __future__ module. I have no idea how to resolve this contradiction of the original design of the module. Any suggestion? Thanks for reply. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 09:46:19 2021 From: report at bugs.python.org (Artem) Date: Wed, 21 Jul 2021 13:46:19 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise Message-ID: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> New submission from Artem : I write some short example. import resource import asyncio class B: def __init__(self, loop): self.loop = loop self.some_big_data = bytearray(1024 * 1024) # 1Mb for memory bloating async def doStuff(self): if not await self.connect(): return print('Stuff done') async def connect(self) -> bool: try: _, writer = await asyncio.open_connection('127.0.0.1', 12345, loop=self.loop) writer.close() return True except OSError as e: pass return False class A: def __init__(self, loop): self.loop = loop async def doBStuff(self): b = B(self.loop) await b.doStuff() async def work(self): print('Working...') for _ in range(1000): await self.loop.create_task(self.doBStuff()) print('Done.') print( 'Memory usage {}kb'.format( resource.getrusage( resource.RUSAGE_SELF).ru_maxrss)) async def amain(loop): a = A(loop) await a.work() if __name__ == "__main__": loop = asyncio.get_event_loop() loop.run_until_complete(amain(loop)) 100 cycles "Memory usage 41980kb" 1000 cycles "Memory usage 55412kb" 10000 cycles "Memory usage 82880kb" And so on... Does anyone know workaround? ---------- components: asyncio messages: 397945 nosy: aeros, asvetlov, seer, yselivanov priority: normal severity: normal status: open title: Memory leak when asyncio.open_connection raise type: resource usage versions: Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 10:09:15 2021 From: report at bugs.python.org (Jake Stockwin) Date: Wed, 21 Jul 2021 14:09:15 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1626876555.76.0.251314674029.issue35183@roundup.psfhosted.org> Jake Stockwin added the comment: Hello, I would like to submit a PR for this. It'll be my first contribution to cPython and I am slightly unclear if this suggestion has been "accepted" in some sense (i.e. do the Devs agree it should be fixed as suggested)? If so, I will go ahead and create PR (and credit shaungriffith for his provided examples). ---------- nosy: +jstockwin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:06:49 2021 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 21 Jul 2021 15:06:49 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow Message-ID: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> New submission from Thomas Wouters : Objects/complexobject.c's complex_pow uses undefined behaviour, by casting a float of unknown magnitude to a long: int_exponent = (long)exponent.real; At Google we build with clang and -fsanitize=float-cast-overflow by default, which catches this particular kind of undefined behaviour. We didn't notice, however, because the only code we've come across that exercises this behaviour was a commented-out test in test_complex, which was uncommented in 3.8. Running the test, or just '1e19+1j ** 1e19', is enough to trigger the undefined behaviour. I'll prepare a PR to fix it. ---------- assignee: twouters messages: 397947 nosy: gregory.p.smith, twouters priority: normal severity: normal status: open title: Undefined behaviour in Objects/complexobject.c's complex_pow type: behavior versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:21:57 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A1nos_Brezniczky?=) Date: Wed, 21 Jul 2021 15:21:57 +0000 Subject: [issue44699] Simple regex appears to take exponential time in length of input Message-ID: <1626880917.83.0.0892531059117.issue44699@roundup.psfhosted.org> New submission from J?nos Brezniczky : I don't know if it's normal, but it's impractical. I seem to have come by an expression consuming o(c^n) CPU cycles with c around 2. Regex: \*([^*]+)*\* Resulted in times (in seconds) of 0.17 (* is there anybody out?) 0.34 1 0.69 12 1.36 123 2.73 1234 5.44 12345 11.1 123456 (* is there anybody123456 out?) Please see the source for more details/repro. ---------- components: Regular Expressions files: regex_test.py messages: 397948 nosy: brezniczky, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: Simple regex appears to take exponential time in length of input type: performance versions: Python 3.8 Added file: https://bugs.python.org/file50169/regex_test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:25:52 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A1nos_Brezniczky?=) Date: Wed, 21 Jul 2021 15:25:52 +0000 Subject: [issue44699] Simple regex appears to take exponential time in length of input In-Reply-To: <1626880917.83.0.0892531059117.issue44699@roundup.psfhosted.org> Message-ID: <1626881152.1.0.0687476568051.issue44699@roundup.psfhosted.org> J?nos Brezniczky added the comment: Might be related to https://bugs.python.org/issue43075, as in would trigger ReDOSability had my syntax highlighting-related changes (which eventually broke golden master tests, fortunately :) ) hit the public. (Meaning my reduced - possibly minimal - corner case stems from a practical scenario as well.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:26:21 2021 From: report at bugs.python.org (Thomas Wouters) Date: Wed, 21 Jul 2021 15:26:21 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1626881181.04.0.619164397964.issue44698@roundup.psfhosted.org> Change by Thomas Wouters : ---------- keywords: +patch pull_requests: +25823 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27278 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:50:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 21 Jul 2021 15:50:34 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626882634.21.0.507087053099.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: Eric: makes sense, I'll go with that. John-Mark: I will go ahead and work on a PR along the lines Terry suggested, let us know if you have any objections or if you would prefer to work on a PR by yourself instead. P.S. I understand now what you meant by 1 line vs. 2 lines in my first PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 11:58:05 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A1nos_Brezniczky?=) Date: Wed, 21 Jul 2021 15:58:05 +0000 Subject: [issue44699] Simple regex appears to take exponential time in length of input In-Reply-To: <1626880917.83.0.0892531059117.issue44699@roundup.psfhosted.org> Message-ID: <1626883085.39.0.741009380181.issue44699@roundup.psfhosted.org> J?nos Brezniczky added the comment: I'd also raise for consideration the introduction a (default?) timeout on regexes, similarly to how such a feature seems available in .NET. Given the DOS vector vs. occasionally non-trivially complex expressions, this could draw developer attention to this security aspect and stimulate the evolution of a more secure ecosystem. https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.matchtimeout?view=net-5.0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 12:03:33 2021 From: report at bugs.python.org (Matthew Barnett) Date: Wed, 21 Jul 2021 16:03:33 +0000 Subject: [issue44699] Simple regex appears to take exponential time in length of input In-Reply-To: <1626880917.83.0.0892531059117.issue44699@roundup.psfhosted.org> Message-ID: <1626883413.53.0.189144168508.issue44699@roundup.psfhosted.org> Matthew Barnett added the comment: It's called "catastrophic backtracking". Think of the number of ways it could match, say, 4 characters: 4, 3+1, 2+2, 2+1+1, 1+3, 1+2+1, 1+1+2, 1+1+1+1. Now try 5 characters... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 12:17:46 2021 From: report at bugs.python.org (=?utf-8?q?J=C3=A1nos_Brezniczky?=) Date: Wed, 21 Jul 2021 16:17:46 +0000 Subject: [issue44699] Simple regex appears to take exponential time in length of input In-Reply-To: <1626880917.83.0.0892531059117.issue44699@roundup.psfhosted.org> Message-ID: <1626884266.12.0.332312716564.issue44699@roundup.psfhosted.org> J?nos Brezniczky added the comment: Hello! Thanks for the reply - you are probably right, and I accept that it's normal. However, there may be numerous frameworks getting built on the concept of collaboratively contributed regexes. (Python likes prototyping, prototyping likes portable programming constructs, regular expressions are portable, for this and other factors and as past practice suggests, these will be a temptingly plausible choice as a basis for frameworks, etc.) So I do accept it's normal (I haven't been deeply into regexes for cca 10 years, but I vaguely recall what's complex depends a lot on the type of engine, maybe A or B? pass on that one). However people make mistakes that attackers seek... (Not to lose that point, I am otherwise okay to let it go as "not a bug" if you're certain! I guess something should be done though.) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 12:33:55 2021 From: report at bugs.python.org (Eric Snow) Date: Wed, 21 Jul 2021 16:33: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: <1626885235.85.0.436090089763.issue43693@roundup.psfhosted.org> Change by Eric Snow : ---------- assignee: eric.snow -> stage: patch review -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 13:08:05 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 21 Jul 2021 17:08:05 +0000 Subject: [issue44634] Version is duplicated in name of app in list of installed apps In-Reply-To: <1626259883.91.0.0747783095776.issue44634@roundup.psfhosted.org> Message-ID: <1626887285.82.0.714034407628.issue44634@roundup.psfhosted.org> Zachary Ware added the comment: Agreed with Paul, it's more useful than confusing to have the version in the name. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 13:59:39 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 21 Jul 2021 17:59:39 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626890379.06.0.56123146308.issue42414@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- pull_requests: +25824 pull_request: https://github.com/python/cpython/pull/27279 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 14:04:34 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 21 Jul 2021 18:04:34 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626890674.67.0.177100707746.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: I've added a new PR: https://github.com/python/cpython/pull/27279 (note it's a rough PoC draft at this point) The output of inspect.getdoc() is the same: A(total: int, num: int = 5) total: int -- number of widgets num: int [5] -- total widgets ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 14:07:49 2021 From: report at bugs.python.org (Guido van Rossum) Date: Wed, 21 Jul 2021 18:07:49 +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: <1626890869.04.0.910734650894.issue43693@roundup.psfhosted.org> Guido van Rossum added the comment: Another task seems to have appeared, Nick Coghlan would like the typedef to be renamed to PyLocal_VarKind, and the getter/setter similarly. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 14:09:03 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 18:09:03 +0000 Subject: [issue44700] Python fails to build (aarch64-apple-darwin20.5.0) Message-ID: <1626890943.41.0.549645989366.issue44700@roundup.psfhosted.org> New submission from Jack DeVries : I believe this is a problem with my machine because I've tried checking out to known good commits (which worked on my machine before) and have the same issue, but I've tried everything and don't really know what to do next. I'm hoping someone can help me, and who knows ??maybe it is a bug! This is the command that fails:: gcc -Wl,-stack_size,1000000 -framework CoreFoundation \ -o Programs/_testembed Programs/_testembed.o libpython3.11d.a -ldl \ -framework CoreFoundation The linker is ignoring `libpython3.11d.a`, providing the following warning:: ignoring file libpython3.11d.a, building for macOS-arm64 but attempting to link with file built for macOS-arm64 Of course, what follows is a ton of undefined symbol errors; no surprises there. I don't understand how to fix the error, why it is happening, or how this issue could have possibly cropped up overnight. These are the things I've tried to fix it: 1. Run autoconf to regenerate the configure script. 2. Delete everything. Reconfigure and rebuild from a clean slate. 3. Comment out `.zshenv`, `.zshrc`, and `.zprofile` 4. Try configuring and compiling on bash and sh instead of zsh ---------- components: Build messages: 397957 nosy: jack__d priority: normal severity: normal status: open title: Python fails to build (aarch64-apple-darwin20.5.0) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 14:09:17 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 18:09:17 +0000 Subject: [issue44700] Python fails to build (aarch64-apple-darwin20.5.0) In-Reply-To: <1626890943.41.0.549645989366.issue44700@roundup.psfhosted.org> Message-ID: <1626890957.48.0.188071110929.issue44700@roundup.psfhosted.org> Change by Jack DeVries : ---------- type: -> compile error versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 14:38:42 2021 From: report at bugs.python.org (Ben Avrahami) Date: Wed, 21 Jul 2021 18:38:42 +0000 Subject: [issue44695] asdict use deep copy to dataclass instances In-Reply-To: <1626866962.24.0.087690350539.issue44695@roundup.psfhosted.org> Message-ID: <1626892722.55.0.0795299255311.issue44695@roundup.psfhosted.org> Change by Ben Avrahami : ---------- nosy: +avrahami.ben _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 15:07:38 2021 From: report at bugs.python.org (Leonardo Freua) Date: Wed, 21 Jul 2021 19:07:38 +0000 Subject: [issue44701] Create a @deprecated decorator (annotation) Message-ID: <1626894458.82.0.833124063655.issue44701@roundup.psfhosted.org> New submission from Leonardo Freua : Would it be interesting to create a @deprecated decorator to avoid adding warnings.warn("deprecation message", DeprecationWarning, stacklevel=2) in methods body? Using the decorator approach to indicate depreciation would make the methods cleaner (leaving only their responsibilities in the body) and would be easier to identify, as the cue would be close to the method signature and not mixed with the logic inside the body. If everyone agrees, I could submit a PR (as a draft) for us to evaluate this functionality. ---------- components: Library (Lib) messages: 397958 nosy: Leonardofreua priority: normal severity: normal status: open title: Create a @deprecated decorator (annotation) type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 15:09:02 2021 From: report at bugs.python.org (Itay azolay) Date: Wed, 21 Jul 2021 19:09:02 +0000 Subject: [issue44695] asdict use deep copy to dataclass instances In-Reply-To: <1626866962.24.0.087690350539.issue44695@roundup.psfhosted.org> Message-ID: <1626894542.28.0.447225800236.issue44695@roundup.psfhosted.org> Change by Itay azolay : ---------- versions: +Python 3.10, Python 3.11 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 15:14:19 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Wed, 21 Jul 2021 19:14:19 +0000 Subject: [issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt In-Reply-To: <1516702927.0.0.467229070634.issue32635@psf.upfronthosting.co.za> Message-ID: <1626894859.59.0.386962213215.issue32635@roundup.psfhosted.org> Geoffrey Thomas added the comment: Sorry to bump an old thread, but - does need to be in the public Python.h header? Or would it be enough to be in _cryptmodule.c, which is the code that uses crypt_r()? I can provide a quick patch to change that if that seems sound. ---------- nosy: +geofft _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 16:30:57 2021 From: report at bugs.python.org (Svyatoslav) Date: Wed, 21 Jul 2021 20:30:57 +0000 Subject: [issue44702] Fix weakref doc Message-ID: <1626899456.99.0.316409007045.issue44702@roundup.psfhosted.org> New submission from Svyatoslav : >From https://docs.python.org/3/library/weakref.html: "" Not all objects can be weakly referenced; those objects which can include class instances, functions written in Python (but not in C), instance methods, sets, frozensets, some file objects, generators, type objects, sockets, arrays, deques, regular expression pattern objects, and code objects. "" My first perception was that this is the list of objects without weakref support. Actually, the sentence lists objects which do support weakref. While writing this report I understood: "can" does not relate to "include" at all. The correct way of reading is "those objects | which can | include ...". Previously I had read it as "those objects | which can include ...". Even Google translates in such manner, commas do not help. To remove ambguity, I suggest such fix: "" Not all objects can be weakly referenced. Objects which support weak references include class instances, functions written in Python (but not in C), instance methods, sets, frozensets, some file objects, generators, type objects, sockets, arrays, deques, regular expression pattern objects, and code objects. "" or "" Not all objects can be weakly referenced. ?lass instances, functions written in Python (but not in C), instance methods, sets, frozensets, some file objects, generators, type objects, sockets, arrays, deques, regular expression pattern objects, and code objects support weak references. "" ---------- assignee: docs at python components: Documentation messages: 397960 nosy: Prometheus3375, docs at python priority: normal severity: normal status: open title: Fix weakref doc type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 17:20:08 2021 From: report at bugs.python.org (Svyatoslav) Date: Wed, 21 Jul 2021 21:20:08 +0000 Subject: [issue44703] deepcopy(frozenset()) returns a new object Message-ID: <1626902408.34.0.16297036439.issue44703@roundup.psfhosted.org> New submission from Svyatoslav : from copy import copy, deepcopy t = 1, 2 t1 = t, 3 t2 = t1, 4 t3 = t2, 5 assert copy(t3) is t3 assert deepcopy(t3) is t3 s = frozenset({1, 2}) assert s.copy() is s # method .copy() always returns self, what its purpose? assert copy(s) is s assert deepcopy(s) is s # raises AssertionError Even a deepcopy of a tuple with many nested tuples is the the tuple itself, while a deepcopy of a frozenset which by definition cannot contain mutable objects is a new frozenset. I think it is an error. A new frozenset is created because deepcopy() fallbacks to pickling. ---------- components: Library (Lib) messages: 397961 nosy: Prometheus3375 priority: normal severity: normal status: open title: deepcopy(frozenset()) returns a new object versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 17:21:44 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 21:21:44 +0000 Subject: [issue44700] Python fails to build (aarch64-apple-darwin20.5.0) In-Reply-To: <1626890943.41.0.549645989366.issue44700@roundup.psfhosted.org> Message-ID: <1626902504.24.0.0182886074774.issue44700@roundup.psfhosted.org> Jack DeVries added the comment: I'm also getting this warning: ld: warning: object file (Programs/python.o) was built for newer macOS version (11.5) than being linked (11.0) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 17:32:14 2021 From: report at bugs.python.org (Svyatoslav) Date: Wed, 21 Jul 2021 21:32:14 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash Message-ID: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> New submission from Svyatoslav : In docstring of Set._hash in _collections_abc.py is written: "We match the algorithm used by the built-in frozenset type." But >>> s = frozenset({i for i in range(10)}) >>> hash(s) 3895031357313128696 >>> Set._hash(s) 3914343279946282847 Looks like Set._hash is different. ---------- components: Library (Lib) messages: 397963 nosy: Prometheus3375 priority: normal severity: normal status: open title: frozenset.__hash__ vs. Set._hash type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 17:32:29 2021 From: report at bugs.python.org (Svyatoslav) Date: Wed, 21 Jul 2021 21:32:29 +0000 Subject: [issue44703] deepcopy(frozenset()) returns a new object In-Reply-To: <1626902408.34.0.16297036439.issue44703@roundup.psfhosted.org> Message-ID: <1626903149.76.0.940880848624.issue44703@roundup.psfhosted.org> Change by Svyatoslav : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 17:58:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 21:58:33 +0000 Subject: [issue44700] Python fails to build (aarch64-apple-darwin20.5.0) In-Reply-To: <1626890943.41.0.549645989366.issue44700@roundup.psfhosted.org> Message-ID: <1626904713.94.0.156795645849.issue44700@roundup.psfhosted.org> Jack DeVries added the comment: UGH I was experimenting with installing / compilingi gdb and had accidentally installed a different version of `ar` :/ ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 18:35:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 22:35:07 +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: <1626906907.68.0.705578296337.issue44435@roundup.psfhosted.org> Jack DeVries added the comment: Looking back at this issue, I can see that there is documentation for this in the 'note' block. I'm just going to close this issue. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:08:12 2021 From: report at bugs.python.org (Jarrod Price) Date: Wed, 21 Jul 2021 23:08:12 +0000 Subject: [issue44671] Create a built-in yaml module In-Reply-To: <1626644028.22.0.677421965462.issue44671@roundup.psfhosted.org> Message-ID: <1626908892.17.0.509982703581.issue44671@roundup.psfhosted.org> Jarrod Price added the comment: Could you please assist me with creating a PEP? I?ve not done it before and I?m not sure where to begin. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:14:58 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 21 Jul 2021 23:14:58 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626909298.17.0.745228703794.issue44704@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +25825 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27281 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:21:07 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 21 Jul 2021 23:21:07 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1626909667.69.0.974545316932.issue35183@roundup.psfhosted.org> Jack DeVries added the comment: @jstockwin, the process usually goes like this: 1. You open a PR 2. The discussion continues over there. non-core-dev volunteers review your PR and get it into a polished state. 3. A core dev will quickly take a look, provide feedback if necessary, or just merge if not. There's no need to credit anyone ??if Shaun wanted credit, he could have included a PR with his bug report! Plus, the commit will include this bpo#, so future onlookers can always trace the commit back to this thread. Follow the dev guide as you go and don't hesitate to post any questions you have right here! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:21:27 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 21 Jul 2021 23:21:27 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626909687.61.0.922280417865.issue44704@roundup.psfhosted.org> Dennis Sweeney added the comment: I opened a PR. It looks like frozenset.__hash__ changed in GH-5194 and GH-5235, but Set._hash wasn't updated accordingly. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:44:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Jul 2021 23:44:16 +0000 Subject: [issue44703] deepcopy(frozenset()) returns a new object In-Reply-To: <1626902408.34.0.16297036439.issue44703@roundup.psfhosted.org> Message-ID: <1626911056.96.0.131447906117.issue44703@roundup.psfhosted.org> Raymond Hettinger added the comment: Returning the same object is just a micro-optimization and we've decided that it isn't worth it. In bpo-40521, frozenset() stop being a singleton. This costs a small bit of space but saves code complexity and a bit of execution time (especially given that we no longer have cheap access to global state). Thanks for the suggestion, but we'll pass. ---------- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:46:07 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Jul 2021 23:46:07 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1626911167.14.0.380878639104.issue44698@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:49:12 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Jul 2021 23:49:12 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626911352.38.0.0446347762484.issue44704@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset c878f5d81772dc6f718d6608c78baa4be9a4f176 by Dennis Sweeney in branch 'main': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) https://github.com/python/cpython/commit/c878f5d81772dc6f718d6608c78baa4be9a4f176 ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:49:36 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 23:49:36 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626911376.15.0.179342961539.issue44704@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25827 pull_request: https://github.com/python/cpython/pull/27283 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:49:30 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 21 Jul 2021 23:49:30 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626911370.15.0.0305153115096.issue44704@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25826 pull_request: https://github.com/python/cpython/pull/27282 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:59:02 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Jul 2021 23:59:02 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1626911942.23.0.335425962733.issue44698@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +tim.peters _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 19:59:44 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Wed, 21 Jul 2021 23:59:44 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626911984.97.0.557893560889.issue44704@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 20:15:18 2021 From: report at bugs.python.org (Luke Deller) Date: Thu, 22 Jul 2021 00:15:18 +0000 Subject: [issue44705] Support Windows file open modes for `open` built-in function Message-ID: <1626912918.78.0.0995473135794.issue44705@roundup.psfhosted.org> New submission from Luke Deller : Microsoft Windows supports some extra file open modes including: "S" Specifies that caching is optimized for, but not restricted to, sequential access from disk. "T" Specifies a file as temporary. If possible, it is not flushed to disk. "D" Specifies a file as temporary. It is deleted when the last file pointer is closed Python 2 used to allow "T" and "D" flags in the built-in `open` function (though this was not documented): https://github.com/python/cpython/blob/2.7/Objects/fileobject.c#L214 It would be great if these flags were allowed in Python 3. I see that Python3 implementation uses `open`/`_wopen` rather than `fopen` now. The mapping to numeric flags for `_wopen` is shown in the documentation here: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen (search for "Equivalent oflag value") ---------- components: IO messages: 397971 nosy: lukedeller1 priority: normal severity: normal status: open title: Support Windows file open modes for `open` built-in function 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 Jul 21 20:23:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Jul 2021 00:23:47 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626913427.84.0.510385907851.issue44704@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e0ef81600f4331299f61bbe3f7f08bb21d90315b by Miss Islington (bot) in branch '3.9': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27283) https://github.com/python/cpython/commit/e0ef81600f4331299f61bbe3f7f08bb21d90315b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 20:23:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Jul 2021 00:23:47 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626913427.84.0.510385907851.issue44704@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset e0ef81600f4331299f61bbe3f7f08bb21d90315b by Miss Islington (bot) in branch '3.9': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27283) https://github.com/python/cpython/commit/e0ef81600f4331299f61bbe3f7f08bb21d90315b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 20:23:47 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Jul 2021 00:23:47 +0000 Subject: [issue44704] frozenset.__hash__ vs. Set._hash In-Reply-To: <1626903134.43.0.638660457215.issue44704@roundup.psfhosted.org> Message-ID: <1626913427.98.0.72333229711.issue44704@roundup.psfhosted.org> Raymond Hettinger added the comment: New changeset 4194f1465fa85371dcbead57a54bb06d1f0b97d9 by Miss Islington (bot) in branch '3.10': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282) https://github.com/python/cpython/commit/4194f1465fa85371dcbead57a54bb06d1f0b97d9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 21:28:01 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Jul 2021 01:28:01 +0000 Subject: [issue44705] Support Windows file open modes for `open` built-in function In-Reply-To: <1626912918.78.0.0995473135794.issue44705@roundup.psfhosted.org> Message-ID: <1626917281.61.0.0281819781495.issue44705@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 21:28:08 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Jul 2021 01:28:08 +0000 Subject: [issue44705] Support Windows file open modes for `open` built-in function In-Reply-To: <1626912918.78.0.0995473135794.issue44705@roundup.psfhosted.org> Message-ID: <1626917288.39.0.887818055157.issue44705@roundup.psfhosted.org> Change by Dong-hee Na : ---------- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 21:28:21 2021 From: report at bugs.python.org (Dong-hee Na) Date: Thu, 22 Jul 2021 01:28:21 +0000 Subject: [issue44705] Support Windows file open modes for `open` built-in function In-Reply-To: <1626912918.78.0.0995473135794.issue44705@roundup.psfhosted.org> Message-ID: <1626917301.64.0.503578618619.issue44705@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 21 22:15:15 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 22 Jul 2021 02:15:15 +0000 Subject: [issue44677] CSV sniffing falsely detects space as a delimiter In-Reply-To: <1626716433.69.0.308565611704.issue44677@roundup.psfhosted.org> Message-ID: <1626920115.35.0.271412428254.issue44677@roundup.psfhosted.org> Raymond Hettinger added the comment: Changing sniffer logic is risky because it risks breaking existing code that relies on the current predictions. FWIW, in your example, the sniffer gets the desired result if given a delimiter hint: >>> s = "a|b\nc| 'd\ne|' f" >>> pprint.pp(dict(vars(Sniffer().sniff(s, '|')))) {'__module__': 'csv', '_name': 'sniffed', 'lineterminator': '\r\n', 'quoting': 0, '__doc__': None, 'doublequote': False, 'delimiter': '|', 'quotechar': "'", 'skipinitialspace': False} ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 01:15:06 2021 From: report at bugs.python.org (Josh Meranda) Date: Thu, 22 Jul 2021 05:15:06 +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: <1626930906.3.0.896065511059.issue41255@roundup.psfhosted.org> Josh Meranda added the comment: I agree with Bigbird and paul.j3. > But I think this is a real bug in argparse, not a documentation problem. > Off hand I can't think of clean way of refining the description without getting overly technical about the error handling. It seems like a reasonable conclusion to make that, "If the user would like to catch errors manually, the feature can be enabled by setting exit_on_error to False" indicates that wrapping any call to parser.parse_args() or parser.parse_known_args() will catch any known error that may raised. So outside of adding the workaround of subclassing ArgumentParser to the documentation, this probably needs a patch to the code. Any solution will probably also need to implement a new error type to be able to handle these cases since they can be caused by multiple arguments being included / excluded, which is not something that ArgumentError can adequately describe by referencing only a single argument. Something like: class MultipleArgumentError(ArgumentError): def __init__(self, arguments, message): self.argument_names = filter([_get_action_name(arg) for arg in arguments], lambda name: name) self.message = message def __str__(self): if self.argument_names is None: format = '%(message)s' else: format = 'argument %(argument_names): %(message)s' return format % dict(message=self.message, argument_names=', '.join(self.argument_name)) I'm not sure I like the idea of changing the exit or error methods since they have a a clear purpose and don't need to be repurposed to also include error handling. It seems to me that adding checks to self.exit_on_error in _parse_known_args to handle the missing required arguments and in parse_args to handle unknown arguments is probably a quick and clean solution. ---------- nosy: +joshmeranda versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 02:06:33 2021 From: report at bugs.python.org (Tzach Yarimi) Date: Thu, 22 Jul 2021 06:06:33 +0000 Subject: [issue44706] UUID constructor should accept another UUID instance Message-ID: <1626933993.3.0.670473519068.issue44706@roundup.psfhosted.org> Change by Tzach Yarimi : ---------- components: Library (Lib) nosy: tzach priority: normal severity: normal status: open title: UUID constructor should accept another UUID instance type: behavior versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 02:08:23 2021 From: report at bugs.python.org (Tzach Yarimi) Date: Thu, 22 Jul 2021 06:08:23 +0000 Subject: [issue44706] UUID constructor should accept another UUID instance Message-ID: <1626934103.22.0.511029110243.issue44706@roundup.psfhosted.org> New submission from Tzach Yarimi : Primitives usually accept an instance of their own type in the constructor, for example: int(5) str("a") tuple((1,2,3)) This is not the case for UUID: >>> from uuid import uuid4, UUID >>> x = uuid4() >>> UUID(x) Traceback (most recent call last): File "", line 1, in File "/usr/local/Cellar/python at 3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/uuid.py", line 168, in __init__ hex = hex.replace('urn:', '').replace('uuid:', '') AttributeError: 'UUID' object has no attribute 'replace' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 02:09:01 2021 From: report at bugs.python.org (Tzach Yarimi) Date: Thu, 22 Jul 2021 06:09:01 +0000 Subject: [issue44706] UUID constructor should accept another UUID instance In-Reply-To: <1626934103.22.0.511029110243.issue44706@roundup.psfhosted.org> Message-ID: <1626934141.12.0.892564551479.issue44706@roundup.psfhosted.org> Change by Tzach Yarimi : ---------- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 03:07:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 07:07:02 +0000 Subject: [issue44706] UUID constructor should accept another UUID instance In-Reply-To: <1626934103.22.0.511029110243.issue44706@roundup.psfhosted.org> Message-ID: <1626937622.74.0.812592792746.issue44706@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is a duplicate of issue32112. ---------- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Should uuid.UUID() accept another UUID() instance? _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 03:16:09 2021 From: report at bugs.python.org (=?utf-8?b?U3Jpbml2YXMgIFJlZGR5IFRoYXRpcGFydGh5KOCwtuCxjeCwsOCxgOCwqA==?= =?utf-8?b?4LC/4LC14LC+4LC44LGNIOCwsOCxhuCwoeCxjeCwoeCwvyDgsKTgsL7gsJ8=?= =?utf-8?b?4LC/4LCq4LCw4LGN4LCk4LC/KQ==?=) Date: Thu, 22 Jul 2021 07:16:09 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c Message-ID: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> New submission from Srinivas Reddy Thatiparthy(?????????? ?????? ?????????) : After seeing this issue https://bugs.python.org/issue44698, I wanted to run clang on the main branch (c878f5d81772dc6f718d6608c78baa4be9a4f176) with an undefined option enabled. Is the following a bug or false positive? Objects/listobject.c:527:24: runtime error: applying zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/listobject.c:527:24 in Steps to reproduce. 1. export CC="/usr/bin/clang -fsanitize=undefined" 2. ./configure --with-pydebug --with-openssl=$(brew --prefix openssl) 3. make -j Meta : ? clang --version Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin ? uname -a Darwin Srinivass-MBP.Dlink 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64 ---------- messages: 397978 nosy: thatiparthy priority: normal severity: normal status: open title: runtime error: applying zero offset to null pointer in Objects/listobject.c _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 03:20:01 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Thu, 22 Jul 2021 07:20:01 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626938401.33.0.233387531357.issue44689@roundup.psfhosted.org> Ronald Oussoren added the comment: The disadvantage of using dlopen is that this function has side effects, and those can affect program behaviour. Because of this I'm against switching to using dlopen to probe for libraries. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 04:21:36 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 22 Jul 2021 08:21:36 +0000 Subject: [issue44705] Support Windows file open modes for `open` built-in function In-Reply-To: <1626912918.78.0.0995473135794.issue44705@roundup.psfhosted.org> Message-ID: <1626942096.22.0.661953501823.issue44705@roundup.psfhosted.org> Eryk Sun added the comment: Currently you can use os.open() if you need platform-specific open flags such as Windows O_RANDOM, O_SEQUENTIAL, O_SHORT_LIVED, and O_TEMPORARY. The file descriptor can be passed to builtin open() to get a file object that owns the fd. It might be more convenient if the os module had a function to translate an open() mode string into a combination of the flags O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC, O_EXCL, and O_APPEND. Plus O_BINARY in Windows. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 04:27:24 2021 From: report at bugs.python.org (Jake Stockwin) Date: Thu, 22 Jul 2021 08:27: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: <1626942444.73.0.777363975937.issue35183@roundup.psfhosted.org> Change by Jake Stockwin : ---------- keywords: +patch pull_requests: +25828 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27286 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 05:15:13 2021 From: report at bugs.python.org (Jake Stockwin) Date: Thu, 22 Jul 2021 09:15:13 +0000 Subject: [issue35183] os.path.splitext documentation needs typical example In-Reply-To: <1541591353.01.0.788709270274.issue35183@psf.upfronthosting.co.za> Message-ID: <1626945313.6.0.141833840338.issue35183@roundup.psfhosted.org> Jake Stockwin added the comment: Thanks for the info, @jack__d - very helpful. I have now submitted a PR for this and will await a review. Let me know if anything else is needed. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 06:24:17 2021 From: report at bugs.python.org (Andrey) Date: Thu, 22 Jul 2021 10:24:17 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1626949457.3.0.0416003330359.issue44697@roundup.psfhosted.org> Andrey added the comment: Confirmed. I have the same problem. I suspect this is related to https://bugs.python.org/issue41699. ---------- nosy: +whoKilledLora _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 08:10:08 2021 From: report at bugs.python.org (Denis Laxalde) Date: Thu, 22 Jul 2021 12:10:08 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1626955808.7.0.824088508271.issue42414@roundup.psfhosted.org> Change by Denis Laxalde : ---------- nosy: +dlax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 08:18:35 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Jul 2021 12:18:35 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626956315.33.0.522239865539.issue44651@roundup.psfhosted.org> Mark Dickinson added the comment: New changeset c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a by Steven Hsu in branch 'main': bpo-44651: delete entry of "coercion" in Doc/glossary.rst (GH-27226) https://github.com/python/cpython/commit/c05a790693b3b00ac7cb5b96ad416ca9d8ecb14a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 08:43:27 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Thu, 22 Jul 2021 12:43:27 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626957807.83.0.0968111027152.issue44689@roundup.psfhosted.org> Tobias Bergkvist added the comment: You are absolutely right! From the manpage of dlopen(3) on MacOS Big Sur: > dlopen() examines the mach-o file specified by path. If the file is compatible with the current process and has not already been loaded into the current process, it is loaded and linked. After being linked, if it contains any initializer functions, they are called, before dlopen() returns. dlopen() can load dynamic libraries and bundles. It returns a handle that can be used with dlsym() and dlclose(). A second call to dlopen() with the same path will return the same handle, but the internal reference count for the handle will be incremented. Therefore all dlopen() calls should be balanced with a dlclose() call. Essentially, if the shared library contains initializer functions that have some kind of side-effects, dlopen will also trigger these side-effects. Basic example: ``` // mylib.c #include void myinit(void) { printf("Hello from mylib\n"); } __attribute__((section("__DATA,__mod_init_func"))) typeof(myinit) *__init = myinit; ``` --- ``` // main.c #include #include int main(void) { void* handle = dlopen("./mylib.dyld", RTLD_LAZY); if (handle == NULL) printf("Failed to load"); } ``` $ clang mylib.c -shared -o mylib.dyld $ clang main.c -o main $?./main Hello from mylib ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 09:48:35 2021 From: report at bugs.python.org (Artem) Date: Thu, 22 Jul 2021 13:48:35 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1626961715.01.0.365168208529.issue44697@roundup.psfhosted.org> Change by Artem : ---------- nosy: +bquinlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 09:52:07 2021 From: report at bugs.python.org (Devin Bayer) Date: Thu, 22 Jul 2021 13:52:07 +0000 Subject: [issue41556] hostname verification fails if hostname starts with literal IPv4 In-Reply-To: <1597483503.9.0.826978747102.issue41556@roundup.psfhosted.org> Message-ID: <1626961927.89.0.574095933258.issue41556@roundup.psfhosted.org> Change by Devin Bayer : ---------- nosy: +akvadrako _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 10:32:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 14:32:29 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file Message-ID: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> New submission from ?ukasz Langa : When the CPython test suite re-runs a flaky failed test, it doesn?t actually re-run just that failed test but the entire test file. The most common case for flaky tests is when networking, threading, or multiprocessing is involved. Frustratingly those are some of the largest test files we have. Re-running them takes a lot of time. Instead of re-running the entire file, regrtest should only re-run what actually failed. NOTE: I added 3.10 and 3.9 to this issue even though it's not a pure bugfix. The reason is that this can visibly speed up CI for open pull requests. (Of course, it would be best to avoid flaky tests altogether and we?re working on that, but re-running what failed is a pragmatic stopgap that is necessary in times of distributed CI that we don?t fully control.) ---------- assignee: lukasz.langa components: Tests messages: 397985 nosy: lukasz.langa, pablogsal priority: normal severity: normal stage: patch review status: open title: Regression tests with -w should only re-run affected test methods, not the entire file type: resource usage versions: Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 10:36:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 14:36:54 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626964614.89.0.283415341644.issue44708@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- keywords: +patch pull_requests: +25829 pull_request: https://github.com/python/cpython/pull/27287 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 12:00:26 2021 From: report at bugs.python.org (San) Date: Thu, 22 Jul 2021 16:00:26 +0000 Subject: [issue44709] [3.7] Popen Control Characters in stdout affect shell session Message-ID: <1626969626.94.0.722055319986.issue44709@roundup.psfhosted.org> New submission from San : I was trying to wrap an old game server executable with a built-in console using Popen. class ServerWrapper(Thread): def __init__(self, pathToExecutable: str, statusMonitor: Popen = None, active: bool = False): super().__init__() self.pathToExecutable = pathToExecutable self.statusMonitor = statusMonitor self.active = active def run(self): self.statusMonitor = Popen(['./bf1942_lnxded', "+statusMonitor", '1'], encoding='latin_1', stdout=PIPE, stdin=PIPE, cwd=self.pathToExecutable) while self.active: currentLine = self.statusMonitor.stdout.readline() if currentLine: print(currentLine) input('') def start(self): self.active = True super().start() def stop(self): self.active = False I expected to be able to read the output line-by-line using enter, in a 'normal fashion'. After importing this from a terminal and setting it up somewhat like so: wrapper = ServerWrapper('bf1942') wrapper.start() However, once the server process started and thereby started writing to stdout, weird stuff started to happen to my shell with the python interpreter. Apparently, there are control characters and ansi-escape codes sent from the process, that somehow manage to manipulate my shell if I specify an encoding. Consequentially the lines output with 'print(currentLine)' are reduced by these chars. Is this the desired behaviour of the decoder? If so then I think this should potentially be further clarified in the documentation of Popen. I would have expected the chars to be escaped because the worst thing is, this happens even if you don't actually read from stdout at all. Seemingly the decoder executes incoming control sequences immediately (probably for the buffer?), regardless of if you actually bother to read the stdout or not. The paragraph in https://docs.python.org/3.7/library/subprocess.html#security-considerations sounds like this shouldn't be happening if 'shell' is not set to 'True' at least. ---------- files: shell.png messages: 397986 nosy: San priority: normal severity: normal status: open title: [3.7] Popen Control Characters in stdout affect shell session versions: Python 3.7 Added file: https://bugs.python.org/file50170/shell.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 12:29:31 2021 From: report at bugs.python.org (Mark Dickinson) Date: Thu, 22 Jul 2021 16:29:31 +0000 Subject: [issue44651] An unclear definition in Doc/glossary.rst In-Reply-To: <1626412286.45.0.614621510926.issue44651@roundup.psfhosted.org> Message-ID: <1626971371.51.0.496708444658.issue44651@roundup.psfhosted.org> Mark Dickinson added the comment: Closing. @StevenHsuYL: Thank you for the contribution! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 12:35:42 2021 From: report at bugs.python.org (Cheuk Ting Ho) Date: Thu, 22 Jul 2021 16:35:42 +0000 Subject: [issue44710] Unexpected behavior in empty class with pass (Python 3.7.3) Message-ID: <1626971742.78.0.379614893398.issue44710@roundup.psfhosted.org> New submission from Cheuk Ting Ho : Demo example: =================== class MyType(type): def __init__(cls, name, bases, nmspc): if "__annotations__" in nmspc: annotations = nmspc["__annotations__"] else: nmspc["__annotations__"] = {} annotations = nmspc["__annotations__"] for parent in bases: base_annotations = ( parent.__annotations__ if hasattr(parent, "__annotations__") else {} ) annotations.update(base_annotations) super().__init__(name, bases, nmspc) class Coordinate(metaclass=MyType): x: float y: float class Address(metaclass=MyType): street: str country: str class Location(Address, Coordinate): pass class Location2(Address, Coordinate): name: str print(Location.__annotations__) print(Location2.__annotations__) ================ Output: {'street': , 'country': } {'name': , 'street': , 'country': , 'x': , 'y': } Was expecting the two print to be only different by 'name': but the `Location fails to inherit the attribute from `Coordinate`. Not the case for `Location2` *it's my first time submitting an issue, please kindly tell me what to do if I am not doing the right thing. ---------- components: C API messages: 397988 nosy: Cheukting priority: normal severity: normal status: open title: Unexpected behavior in empty class with pass (Python 3.7.3) type: behavior versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:00:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 18:00:18 +0000 Subject: [issue44710] Unexpected behavior in empty class with pass (Python 3.7.3) In-Reply-To: <1626971742.78.0.379614893398.issue44710@roundup.psfhosted.org> Message-ID: <1626976818.62.0.45703548452.issue44710@roundup.psfhosted.org> Serhiy Storchaka added the comment: Because super().__init__(name, bases, nmspc) does not have any effect. Type is created by the metaclass' __new__ method, and the __init__ method is virtually no-op. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:12:56 2021 From: report at bugs.python.org (Tobias Bergkvist) Date: Thu, 22 Jul 2021 18:12:56 +0000 Subject: [issue44689] MacOS: Python binaries not portable between Catalina and Big Sur In-Reply-To: <1626818206.09.0.214441719603.issue44689@roundup.psfhosted.org> Message-ID: <1626977576.09.0.716730392749.issue44689@roundup.psfhosted.org> Tobias Bergkvist added the comment: Okay, I decided to look into how I could do dynamic loading as you suggested. Here is a POC (executable) for using _dyld_shared_cache_contains_path when available: ``` #include #include void* libsystemb_handle; typedef bool (*_dyld_shared_cache_contains_path_f)(const char* path); _dyld_shared_cache_contains_path_f _dyld_shared_cache_contains_path; bool _dyld_shared_cache_contains_path_fallback(const char* name) { return false; } __attribute__((constructor)) void load_libsystemb(void) { if ( (libsystemb_handle = dlopen("/usr/lib/libSystem.B.dylib", RTLD_LAZY)) == NULL || (_dyld_shared_cache_contains_path = dlsym(libsystemb_handle, "_dyld_shared_cache_contains_path")) == NULL ) { _dyld_shared_cache_contains_path = _dyld_shared_cache_contains_path_fallback; } } __attribute__((destructor)) void unload_libsystemb(void) { if (libsystemb_handle != NULL) { dlclose(libsystemb_handle); } } int main(int argc, char ** argv) { printf("Library exists in cache: %d\n", _dyld_shared_cache_contains_path(argv[1])); } ``` A fallback function is used when _dyld_shared_cache_contains_path cannot be loaded, which always returns false. If there is no cache - the (nonexistent) cache also does not contain whatever path you pass it. The constructor function is called when the Python extension is loaded - ensuring that _dyld_shared_cache_contains_path is defined and callable. I've read that C extension modules cannot be autoreloaded (https://ipython.org/ipython-doc/3/config/extensions/autoreload.html) - so this might mean there is no need for a deconstructor? Instead the OS would handle cleanup once the process exits? This could be compiled on either MacOS Catalina or Big Sur, and run without problems on the other MacOS version. Regarding the "explicit weak linking" when building on MacOS Big Sur and later; wouldn't this mean that a Big Sur build wouldn't work on Catalina? Would you be positive towards a PR with the approach I demonstrated here? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:23:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Jul 2021 18:23:37 +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: <1626978217.59.0.187476294883.issue14879@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 50ffbe3dafcae7826d114df61d56c7ac45a6358c by Jack DeVries in branch 'main': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) https://github.com/python/cpython/commit/50ffbe3dafcae7826d114df61d56c7ac45a6358c ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:23:39 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 18:23:39 +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: <1626978219.88.0.0613733283783.issue14879@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25830 pull_request: https://github.com/python/cpython/pull/27288 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:23:45 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 18:23:45 +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: <1626978225.69.0.638005040091.issue14879@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25831 pull_request: https://github.com/python/cpython/pull/27289 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:25:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Jul 2021 18:25:34 +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: <1626978334.53.0.89796169676.issue14879@roundup.psfhosted.org> Irit Katriel added the comment: New changeset 5ffbb05f1c3c952588ba5c1927da0e8223f5aaa7 by Miss Islington (bot) in branch '3.9': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27289) https://github.com/python/cpython/commit/5ffbb05f1c3c952588ba5c1927da0e8223f5aaa7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:26:01 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Jul 2021 18:26:01 +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: <1626978361.33.0.13391225878.issue14879@roundup.psfhosted.org> Irit Katriel added the comment: New changeset d0c61753036dcae292d49aa8ddac555062da6b76 by Miss Islington (bot) in branch '3.10': bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27288) https://github.com/python/cpython/commit/d0c61753036dcae292d49aa8ddac555062da6b76 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:26:01 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 18:26:01 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626978361.93.0.562594140475.issue44708@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583 by ?ukasz Langa in branch 'main': bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) https://github.com/python/cpython/commit/f1afef5e0d93d66fbf3c9aaeab8b3b8da9617583 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 14:26:37 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 22 Jul 2021 18:26:37 +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: <1626978397.44.0.177776278061.issue14879@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 Jul 22 15:00:06 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 19:00:06 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626980406.39.0.843449012985.issue44708@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25832 pull_request: https://github.com/python/cpython/pull/27290 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 15:50:28 2021 From: report at bugs.python.org (Anton G.) Date: Thu, 22 Jul 2021 19:50:28 +0000 Subject: [issue44711] Optimize type check in pipes.py Message-ID: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> New submission from Anton G. : When I did some work on typeshed I found some weird syntax in pipes.py. if type(cmd) is not type(''): which can easily be changed to if not isinstance(cmd, str): There are two occurrences and I will directly create the PR :) ---------- components: Library (Lib) messages: 397995 nosy: anton.gruebel priority: normal severity: normal status: open title: Optimize type check in pipes.py type: performance _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 15:54:25 2021 From: report at bugs.python.org (Eric V. Smith) Date: Thu, 22 Jul 2021 19:54:25 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1626983665.7.0.902950912796.issue44711@roundup.psfhosted.org> Eric V. Smith added the comment: The difference is that type(cmd) is doing an exact match on the type, while isinstance is checking for types or derived types. I don't know if that makes a difference here, but it's worth noting. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 15:55:35 2021 From: report at bugs.python.org (Roundup Robot) Date: Thu, 22 Jul 2021 19:55:35 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1626983735.05.0.569445292706.issue44711@roundup.psfhosted.org> Change by Roundup Robot : ---------- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +25833 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27291 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:06:13 2021 From: report at bugs.python.org (=?utf-8?q?Anton_Gr=C3=BCbel?=) Date: Thu, 22 Jul 2021 20:06:13 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1626984373.12.0.123965741978.issue44711@roundup.psfhosted.org> Anton Gr?bel added the comment: I know that :) , it is just weird to do also do the type check on an empty string, which can be replaced with str directly, but as far as I know it is usually better to use isinstance instead of type. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:07:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:07:31 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1626984451.86.0.235087462383.issue44707@roundup.psfhosted.org> Serhiy Storchaka added the comment: AFAIK pointer arithmetic with NULL has undefined behavior. There is similar case in list_slice(). ---------- components: +Interpreter Core nosy: +mark.dickinson, serhiy.storchaka type: -> compile error versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:14:16 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:14:16 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1626984856.53.0.173643489255.issue44707@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25835 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27292 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:27:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:27:27 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1626985647.25.0.701565462604.issue44711@roundup.psfhosted.org> Serhiy Storchaka added the comment: I suppose it is a very old code written when str was a function, not a type (thus using type('')) and builtin types were not subclassable (thus not using isinstance()). I once analyzed other similar cases in the stdlib. Seems it is time to revive my old patch. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:31:06 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 20:31:06 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626985866.81.0.889059163636.issue44708@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9608719e12b14087c1cb34f77c847974442cd6e7 by Miss Islington (bot) in branch '3.10': bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27290) https://github.com/python/cpython/commit/9608719e12b14087c1cb34f77c847974442cd6e7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:41:12 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:41:12 +0000 Subject: [issue44712] Replace `type(literal)` with corresponding builtin types Message-ID: <1626986471.98.0.436610073153.issue44712@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are several occurrences of type(literal) in the code of the stdlib where literal is a literal of built-in type: '', 1, [], {}, etc. I suppose it is a remnants of very old code written when str, int, list, dict, etc were functions and not classes. The proposed PR replaces `type(literal)` with corresponding builtin types. It makes the code cleaner. I consider also idea of replacing identity or equality checks ("is" or "==") with isinstance(). I suppose that that code was written when built-in types were not subclassable. But now there is a reason to use isinstance(). See also issue44711. ---------- components: Library (Lib) messages: 398002 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Replace `type(literal)` with corresponding builtin types versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:42:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 20:42:21 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626986541.26.0.123995801099.issue44708@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25836 pull_request: https://github.com/python/cpython/pull/27293 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:42:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:42:31 +0000 Subject: [issue44712] Replace `type(literal)` with corresponding builtin types In-Reply-To: <1626986471.98.0.436610073153.issue44712@roundup.psfhosted.org> Message-ID: <1626986551.27.0.510439312745.issue44712@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25837 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27294 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:54:43 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:54:43 +0000 Subject: [issue44712] Replace `type(literal)` with corresponding builtin types In-Reply-To: <1626986471.98.0.436610073153.issue44712@roundup.psfhosted.org> Message-ID: <1626987283.79.0.901674657962.issue44712@roundup.psfhosted.org> Serhiy Storchaka added the comment: All cases was manually checked several times (with months passes between checks). Several cases were preserved: when the name of built-in type conflicted with the name of function parameter (in weakref.py), when the code was used for testing type() and when the test code looks clearer with type(literal). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 16:55:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Thu, 22 Jul 2021 20:55:29 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1626987329.14.0.261985777975.issue44711@roundup.psfhosted.org> Serhiy Storchaka added the comment: See also issue44712. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:07:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 21:07:03 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626988023.36.0.073256674563.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 96c4cbd96c769e92869c62ba898dd9eb670baa81 by Yurii Karabas in branch 'main': bpo-44353: Implement typing.NewType __call__ method in C (#27262) https://github.com/python/cpython/commit/96c4cbd96c769e92869c62ba898dd9eb670baa81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:15:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 21:15:03 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1626988503.16.0.570794582777.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: Note: we won't be backporting _typing to Python 3.10 as it is much too late for a new module at this point in the life cycle. Consequently, 3.10 will be a (temporary) performance regression in terms of typing.NewType. Thanks everyone, most of all Josepth for reporting and Yurii for implementing the required changes. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:17:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 21:17:23 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626988643.42.0.172679649673.issue44708@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0f55d21212a0fb6dec4479eb76249ab2b54e57a3 by ?ukasz Langa in branch '3.9': [3.9] bpo-44708: Only re-run test methods that match names of previously failing test methods (GH-27287) (GH-27293) https://github.com/python/cpython/commit/0f55d21212a0fb6dec4479eb76249ab2b54e57a3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:18:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 21:18:18 +0000 Subject: [issue44708] Regression tests with -w should only re-run affected test methods, not the entire file In-Reply-To: <1626964349.84.0.902926584101.issue44708@roundup.psfhosted.org> Message-ID: <1626988698.85.0.663527882885.issue44708@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:22:21 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 22 Jul 2021 21:22:21 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1626988941.85.0.727771435068.issue19217@roundup.psfhosted.org> Jack DeVries added the comment: Hi all! @eamanu, I went ahead and picked up where you left off. I stopped short of opening up a PR, because I don't want to step on any toes, but I definitely want to do what I can to give this bpo one final shove over the finish line. Despite not creating a PR, you can see the changes here: https://github.com/python/cpython/compare/main...jdevries3133:bpo-19217-slow-assertEq @eamanu, if you prefer, you can probably just merge this branch into `eamanu:fix_bpo-19217`, and the conversation can move forward on GH-11204. Also, below is a summary of what I've done: Revert Change to difflib ======================== Link to the original thread where this change was discussed a bit: https://github.com/python/cpython/pull/11204#discussion_r242369775 I assume this was a performance improvement. It's not clear to me why we are not interested in this part of the diff when the input is a list or tuple. I'm sure someone will help to explain, but this is why I reverted this change: 1. It is not an issue with unittest, and reaches beyond the scope of this bpo 2. The performance problem at the root of this bpo is solved without this change. 3. Reverting this change fixes most of the cascading failures throughout other parts of the test suite. It better constrains this fix to improving the implementation's performance issues while limiting changes to behavior. Obviously, I don't have knowledge of the reasoning behind this change sufficient to write a new bpo, but I think that this small change does deserve its own bpo with an independent explaination of what it does and why it should be done. It's definitely possible that I'm missing something here, so let me know if that's the case! Add Regression Test =================== The regression test basically attempts to reproduce the problem and asserts that the code will complete within one second. It's a pretty rough approach, but I think that it will catch a future regression. If anyone has any better ideas, I'm all ears. Misc ==== I also fixed the one failing test in unittest's own test case, and added a blurb. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:43:27 2021 From: report at bugs.python.org (Josh Meranda) Date: Thu, 22 Jul 2021 21:43:27 +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: <1626990207.45.0.726938333007.issue41255@roundup.psfhosted.org> Change by Josh Meranda : ---------- pull_requests: +25838 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27295 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:57:10 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 21:57:10 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626991030.38.0.298455805655.issue44653@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2e3744d50b6e30ea24351e55b4352dcc58fd469e by Serhiy Storchaka in branch 'main': bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247) https://github.com/python/cpython/commit/2e3744d50b6e30ea24351e55b4352dcc58fd469e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 17:57:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 21:57:17 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626991037.66.0.0474459620056.issue44653@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25839 pull_request: https://github.com/python/cpython/pull/27296 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:07:21 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 22 Jul 2021 22:07:21 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` Message-ID: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> New submission from Jack DeVries : Good feedback from @merwork just missed the merge, but he is right: it should be ``shell=True``, not ``"shell=True"``. https://github.com/python/cpython/pull/26755#discussion_r675128438 I'll be attaching a PR in just a moment. ---------- messages: 398010 nosy: jack__d priority: normal severity: normal status: open title: subprocess.rst typo ``"shell=True"`` => ``shell=True`` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:08:51 2021 From: report at bugs.python.org (Jack DeVries) Date: Thu, 22 Jul 2021 22:08:51 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1626991731.66.0.975909121064.issue44713@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25840 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27297 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:18:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 22:18:57 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626992337.56.0.65289328672.issue44653@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 21db59fc75b6ebb01bf120a8e5930fe032174f73 by Miss Islington (bot) in branch '3.10': bpo-44653: Support typing types in parameter substitution in the union type. (GH-27247) (#27296) https://github.com/python/cpython/commit/21db59fc75b6ebb01bf120a8e5930fe032174f73 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:21:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 22:21:37 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626442347.74.0.420703742148.issue44653@roundup.psfhosted.org> Message-ID: <1626992497.92.0.814212280183.issue44653@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks Serhiy for the report and the fix, and Ken for reviews. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:24:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 22 Jul 2021 22:24:49 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1626992689.52.0.920357234254.issue44707@roundup.psfhosted.org> ?ukasz Langa added the comment: Interestingly I cannot reproduce the clang report on macOS 10.15 with clang 12.0.0. Maybe it's a new capability of clang 12.0.5 in Big Sur. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 18:34:04 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 22 Jul 2021 22:34:04 +0000 Subject: [issue44653] Parameter substitution in the union type does not work with typing.Union In-Reply-To: <1626992497.92.0.814212280183.issue44653@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Thanks for taking over here, ?! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 19:06:27 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 23:06:27 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1626995187.59.0.359451175128.issue44713@roundup.psfhosted.org> miss-islington added the comment: New changeset 7d25254cf0763b62f4c4a3019e56385cab597b9f by Jack DeVries in branch 'main': bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) https://github.com/python/cpython/commit/7d25254cf0763b62f4c4a3019e56385cab597b9f ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 19:06:36 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 22 Jul 2021 23:06:36 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1626995196.62.0.607015605176.issue44713@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25841 pull_request: https://github.com/python/cpython/pull/27298 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 19:29:42 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Thu, 22 Jul 2021 23:29:42 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1626996582.08.0.739626483671.issue44713@roundup.psfhosted.org> ?ric Araujo added the comment: Thanks for the follow-up! Note that the original bug could have been reused. ---------- nosy: +eric.araujo resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 20:48:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 23 Jul 2021 00:48:21 +0000 Subject: [issue44709] [3.7] Popen Control Characters in stdout affect shell session In-Reply-To: <1626969626.94.0.722055319986.issue44709@roundup.psfhosted.org> Message-ID: <1627001301.15.0.553119987996.issue44709@roundup.psfhosted.org> Steven D'Aprano added the comment: I might be missing something here, but if you send arbitrary binary data to stdout, where it gets written to the terminal, strange things are likely to happen. The terminal interprets the shell characters before Python gets to see them. I think that this is pretty much unavoidable. The Security Considerations section in the docs is about avoiding shell code injection attacks by sending unescaped data to the shell, it isn't relevant to the reverse situation where the process sends terminal control codes back. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 20:51:19 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 23 Jul 2021 00:51:19 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules Message-ID: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> New submission from Filipe La?ns : Consider the following $ tree a a ??? b ? ??? c.py ? ??? __init__.py ??? __init__.py 1 directory, 3 files $ cat a/b/__init__.py import a.b.c $ cat a/b/c.py import a.b a.b $ python Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import a.b Traceback (most recent call last): File "", line 1, in File "/home/anubis/test/a/b/__init__.py", line 1, in import a.b.c File "/home/anubis/test/a/b/c.py", line 3, in a.b AttributeError: module 'a' has no attribute 'b' This happens because even though the module `a` is initialized, the `b` attribute is not set due to the circular import. When a module is partially initialized, we get a more helpful error description hinting that we cannot access the attribute because the module is partially initialized, we could have something similar here. ---------- components: Interpreter Core messages: 398021 nosy: FFY00, pablogsal priority: normal severity: normal status: open title: Improve AttributeError on circular imports of submodules type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 20:52:52 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 23 Jul 2021 00:52:52 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627001572.01.0.755885164762.issue44717@roundup.psfhosted.org> Change by Filipe La?ns : ---------- keywords: +patch pull_requests: +25842 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27299 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 20:54:21 2021 From: report at bugs.python.org (Ma Lin) Date: Fri, 23 Jul 2021 00:54:21 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1627001661.74.0.533767868471.issue44711@roundup.psfhosted.org> Ma Lin added the comment: > I suppose it is a very old code I also found a few old code may have performance loss. memoryview.cast() method was add in Python 3.3. This code doesn't use memoryview.cast(), which will bring extra memory overhead when the amount of data is very large. https://github.com/python/cpython/blob/v3.10.0b4/Lib/multiprocessing/connection.py#L190-L194 ---------- nosy: +malin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 21:08:55 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 23 Jul 2021 01:08:55 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627002535.39.0.0303432479767.issue43838@roundup.psfhosted.org> Change by Brandt Bucher : ---------- keywords: +patch pull_requests: +25843 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27300 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 21:09:36 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 23 Jul 2021 01:09:36 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627002576.87.0.902766966205.issue43838@roundup.psfhosted.org> Brandt Bucher added the comment: I believe that delegating to the actual underlying mapping without exposing it is a bit of a lost cause, since for some type m we still need these to work: >>> types.MappingProxyType(m({"a": 0)) | types.MappingProxyType(m({"b": 1})) m({'a': 0, 'b': 1}) >>> types.MappingProxyType(m({"a": 0)) == types.MappingProxyType(m({"a": 0})) True (Note that because both sides are proxies, it's impossible for any resolution to happen without m explicitly knowing how to handle them unless both mappings are unwrapped simultaneously.) Instead, the attached PR delegates to a *copy* of the underlying mapping for these operations instead. I think this is the easiest way to approximate the current behavior while maintaining proper encapsulation. ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 21:48:06 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 23 Jul 2021 01:48:06 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1627004886.12.0.993560787108.issue36643@roundup.psfhosted.org> Eric V. Smith added the comment: It can?t be resolved in fields(): it is still undefined when the fields are created. I think the best solution is PEP 649. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 22:02:36 2021 From: report at bugs.python.org (Guido van Rossum) Date: Fri, 23 Jul 2021 02:02:36 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1627002576.87.0.902766966205.issue43838@roundup.psfhosted.org> Message-ID: Guido van Rossum added the comment: Maybe we should not fix this then? Copying seems unattractive, and the reason we proxy in the first place is not absolute safety but to make sure people don?t accidentally update the dict when they intend to update the class (for the side effect of updating slots when e.g. __add__ is added/removed.-- --Guido (mobile) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 23:06:10 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 23 Jul 2021 03:06:10 +0000 Subject: [issue39632] variadic function call broken on armhf when passing a float argument In-Reply-To: <1581674608.19.0.403543141988.issue39632@roundup.psfhosted.org> Message-ID: <1627009570.24.0.465002373365.issue39632@roundup.psfhosted.org> Filipe La?ns added the comment: #28491 is now resolved, so the PR should be unblocked. Would you mind rebasing it on main to retrigger the CI? ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 22 23:06:15 2021 From: report at bugs.python.org (Fantix King) Date: Fri, 23 Jul 2021 03:06:15 +0000 Subject: [issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL' In-Reply-To: <1520908295.51.0.467229070634.issue33063@psf.upfronthosting.co.za> Message-ID: <1627009575.9.0.142439589478.issue33063@roundup.psfhosted.org> Change by Fantix King : ---------- nosy: +fantix nosy_count: 3.0 -> 4.0 pull_requests: +25844 stage: -> patch review pull_request: https://github.com/python/cpython/pull/8620 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 00:25:27 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Fri, 23 Jul 2021 04:25:27 +0000 Subject: [issue44718] Incorrect arguments in function select() cause segfault Message-ID: <1627014327.38.0.022368113605.issue44718@roundup.psfhosted.org> New submission from Xinmeng Xia : The following program can trigger segfault on all releases of Python. I think it may be caused by incorrect arguments. Version of Python: 3.6 - master(3.11.0a0) system: ubuntu 16.04 test.py ================================ import select def test_select_mutated(): a = [] class F: def fileno(a): del test_select_mutated()[-1] return sys.__stdout__.fileno() a[:] = [F()] * 10 select.select([], a, []), ([], a[:5], []) test_select_mutated() ================================ output: --------------------------------------------------------------------- xxm at xxm:~$ '/home/xxm/Desktop/compiler/cpython-main/python' test.py Segmentation fault (core dumped) --------------------------------------------------------------------- ---------- components: Interpreter Core messages: 398027 nosy: xxm priority: normal severity: normal status: open title: Incorrect arguments in function select() cause segfault type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 00:27:09 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Fri, 23 Jul 2021 04:27:09 +0000 Subject: [issue44719] Incorrect callable object crashes Python 3.11.0a0 Message-ID: <1627014429.86.0.790861111444.issue44719@roundup.psfhosted.org> New submission from Xinmeng Xia : This program can trigger "Aborted (core dumped)" on Python 3.9.0, Python 3.8.0, Python3.10.0a2. It trigger " segmentation fault" on the master (Python 3.11.0a0). ================================== import weakref class Object: def __init__(self, arg): self.arg = arg def test_set_callback_attribute(): x = Object(1) callback = lambda ref: None callback = weakref.ref(callback, x) with test_set_callback_attribute(): pass test_set_callback_attribute() ================================== Crashes on the master (Python 3.11.0a0) ------------------------------------------------------------ ..... Traceback (most recent call last): File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 26, in test_set_callback_attribute callback = weakref.ref(callback, x) ^^^^^^^^ TypeError: 'Object' object is not callable Exception ignored in: <__main__.Object object at 0x7f3e2d56ca90> Traceback (most recent call last): File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 26, in test_set_callback_attribute Segmentation fault (core dumped) -------------------------------------------------------------- Crashes on the older version of Python ----------------------------------------------------------- File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute File "/home/xxm/Desktop/IFuzzer/bugs/CPython/IFuzzer/test_weakref/test_set_callback_attribute__1.py", line 27 in test_set_callback_attribute ... Aborted (core dumped) --------------------------------------------------------------- System: Ubuntu 16.04 ---------- components: Interpreter Core messages: 398028 nosy: xxm priority: normal severity: normal status: open title: Incorrect callable object crashes Python 3.11.0a0 type: crash versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 01:05:41 2021 From: report at bugs.python.org (Xinmeng Xia) Date: Fri, 23 Jul 2021 05:05:41 +0000 Subject: [issue44720] Finding string in iteratively deleted object cause segfault Message-ID: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> New submission from Xinmeng Xia : This piece of code is originally from https://github.com/python/cpython/tree/main/Lib/test/test_weakref.py. In function test_proxy_iter(), we change the original data dependency and then this generated test case (see the following "test.py") crashes Python. Crashing Python version: 3.6-master(3.11.0a0) test.py ========================= import weakref def test_proxy_iter(): obj = None class MyObj: def __iter__(a): nonlocal obj del obj - return NotImplemented + return p obj = MyObj() - p = weakref.proxy(obj) + p = weakref.proxy(TypeError) - 'blech' in p + 'blech' in obj test_proxy_iter() =========================== system: ubuntu 16.04 crash: segmentation fault ---------- components: Interpreter Core files: test.py messages: 398029 nosy: xxm priority: normal severity: normal status: open title: Finding string in iteratively deleted object cause segfault type: crash versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50171/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 01:22:34 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 23 Jul 2021 05:22:34 +0000 Subject: [issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9 In-Reply-To: <1620224531.72.0.42100874633.issue44050@roundup.psfhosted.org> Message-ID: <1627017754.1.0.44339576072.issue44050@roundup.psfhosted.org> Jack DeVries added the comment: I just took a look at this, and I'm getting an output of "no data" (just one time) on 3.9.6. Has this been fixed? ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 01:36:52 2021 From: report at bugs.python.org (Seyed Amirhossein Misaghi) Date: Fri, 23 Jul 2021 05:36:52 +0000 Subject: [issue44721] Problem in tkinter button widget Message-ID: <1627018612.93.0.785894598889.issue44721@roundup.psfhosted.org> New submission from Seyed Amirhossein Misaghi : Hello The piece of code has false behavior. When click the button, the relief changes to tk.SUNKEN. I think this is a wrong behavior. Thanks ---------- components: Tkinter files: test.tar.gz messages: 398031 nosy: a.h.misaghi priority: normal severity: normal status: open title: Problem in tkinter button widget type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50172/test.tar.gz _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 02:16:06 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 23 Jul 2021 06:16:06 +0000 Subject: [issue29555] Update Python Software Foundation Copyright Year In-Reply-To: <1487088120.64.0.260258993464.issue29555@psf.upfronthosting.co.za> Message-ID: <1627020966.34.0.477870477737.issue29555@roundup.psfhosted.org> Jack DeVries added the comment: Hi, Found while sleuthing random issues. Can we close this? ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 03:13:58 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 07:13:58 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627024438.18.0.9655724109.issue43838@roundup.psfhosted.org> Serhiy Storchaka added the comment: For __or__ we need to copy the content of both mapping to the resulting mapping in any case. We can implement it as {**self, **other}. We should not use the copy() method because it is not a part of the Mapping interface. For __eq__, no copying is needed if we just re-implement Mapping.__eq__ (with special cases for few known types for performance). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 04:35:04 2021 From: report at bugs.python.org (creative-resort) Date: Fri, 23 Jul 2021 08:35:04 +0000 Subject: [issue44722] RFC: string Multiline Formatter Message-ID: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> New submission from creative-resort : I'm opening this issue to propose the following enhancement and a PR on GitHub. Concerning: https://github.com/python/cpython/blob/main/Lib/string.py The idea: Format strings, that are comprised of field values with newlines (Multiline) as Multiline strings in a quasi tabbed format. --> In particular useful for logging of information, that occupies multiple lines. For example: '{levelname}:{name}:{message}:{api}', where the message and the api field is a string with multiple lines (contains newlines) The result: 2021-07-23 09:50:28,981 module_name WARNING Quota exceeded Google-Cloud-API Backing off for 5s version: v1 after trying 2x ---------- components: Library (Lib) messages: 398034 nosy: creative-resort priority: normal severity: normal status: open title: RFC: string Multiline Formatter type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 04:36:52 2021 From: report at bugs.python.org (San) Date: Fri, 23 Jul 2021 08:36:52 +0000 Subject: [issue44709] [3.7] Popen Control Characters in stdout affect shell session In-Reply-To: <1626969626.94.0.722055319986.issue44709@roundup.psfhosted.org> Message-ID: <1627029412.97.0.213949821769.issue44709@roundup.psfhosted.org> San added the comment: I get your point. But I thought setting 'stdout=PIPE' should not send the stdout directly to the terminal but rather through the pipe first?! Also what you're saying seems to contradict that this doesn't happen if I don't set the encoding and let it be a byte-stream. In that case you get the full byte-stream without any control-characters being executed. In my opinion it is unintuitive that this is happening. For instance if I open a file using io, that contains the same control characters like so: f = open('cc.txt', 'r', encoding='latin_1') Then gladly this doesn't happen and the control chars get escaped using \x1b which is what I would also expect to happen when using Popen. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 04:48:04 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Fri, 23 Jul 2021 08:48:04 +0000 Subject: [issue44718] Incorrect arguments in function select() cause segfault In-Reply-To: <1627014327.38.0.022368113605.issue44718@roundup.psfhosted.org> Message-ID: <1627030084.74.0.444680726947.issue44718@roundup.psfhosted.org> Ronald Oussoren added the comment: The problem is related to recursion, the code basically ends up with an unlimited number of iterations of select.select and test_select_mutated on the call stack and this doesn't trigger the stack depth checker. The following definition of class F triggers the same error: class F: def fileno(self): test_select_mutated() return self.fileno() The call stack behaviour can be observed by using the fault handler (``python3.9 -Xfaulthandler crash.py``), although you won't see select.select in the traceback due to it being a C extension function. Fixing this would basically require adding a stack depth check to the PyObject_Call family of functions. I don't know if a PR for that would be accepted due to the possible performance impact. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 04:55:27 2021 From: report at bugs.python.org (San) Date: Fri, 23 Jul 2021 08:55:27 +0000 Subject: [issue44709] [3.7] Popen Control Characters in stdout affect shell session In-Reply-To: <1626969626.94.0.722055319986.issue44709@roundup.psfhosted.org> Message-ID: <1627030527.66.0.902936688227.issue44709@roundup.psfhosted.org> San added the comment: I just realised that this is not a problem of python but rather a problem of the shell that I was using. I was testing the io in a different environment. Now I retried in the same environment that the wrapper was operating and the behaviour is the same using io. Sorry for the confusion and thanks for nudging me the right direction. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:03:05 2021 From: report at bugs.python.org (creative-resort) Date: Fri, 23 Jul 2021 09:03:05 +0000 Subject: [issue44722] RFC: string Multiline Formatter In-Reply-To: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> Message-ID: <1627030985.72.0.400228947921.issue44722@roundup.psfhosted.org> Change by creative-resort : ---------- keywords: +patch pull_requests: +25845 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27301 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:14:26 2021 From: report at bugs.python.org (santhosh) Date: Fri, 23 Jul 2021 09:14:26 +0000 Subject: [issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL' In-Reply-To: <1520908295.51.0.467229070634.issue33063@psf.upfronthosting.co.za> Message-ID: <1627031666.48.0.283509713458.issue33063@roundup.psfhosted.org> santhosh added the comment: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_ FASTCALL' can not be used when making a shared object /usr/bin/ld: final link failed build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/c//c/types/li bf fi/ s rc/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_ closure_ FAST CALL' can not be used when making a shared object /usr/bin/ld: final link failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' can not be used when making a shared object /usr/bin/ld: final link failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffio: In function `ffiprep_closure_loc': /opt/python/Python-3.5.5/Modules/_ c types/ b f fi/sr c/x86/ffi.c:678: undefined reference to ` ff_ closure_ FAST CALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' can not be used when making a shared object /usr/bin/ld: final link failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' can not be used when making a shared object /usr/bin/ld: final link failed ---------- nosy: +santhu_reddy12 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:24:32 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 23 Jul 2021 09:24:32 +0000 Subject: [issue44722] RFC: string Multiline Formatter In-Reply-To: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> Message-ID: <1627032272.47.0.0517174511054.issue44722@roundup.psfhosted.org> Eric V. Smith added the comment: Can you provide a specification of what this class does? You?ve given an example, but not a description of the behavior. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:26:19 2021 From: report at bugs.python.org (Nicolas Dessart) Date: Fri, 23 Jul 2021 09:26:19 +0000 Subject: [issue39632] variadic function call broken on armhf when passing a float argument In-Reply-To: <1581674608.19.0.403543141988.issue39632@roundup.psfhosted.org> Message-ID: <1627032379.26.0.944498171191.issue39632@roundup.psfhosted.org> Nicolas Dessart added the comment: I've just rebased this PR but the CI builds failed (for unrelated reasons?). That being said I think that this particular issue should mostly be resolved by bpo-41100 and PR-22855 in particular. My PR 18560 still brings the support for Ellipsis/... inside ctypes function arguments type list. This is nice because it allows ctypes to automatically perform the necessary type promotions even if a variadic function is called without extra arguments. Since I've rebased my PR on top of bpo-41100 PRs, I had to resolve a few conflicts but didn't tried to limit the diff to the minimum (PR 18560 may be simplified). https://bugs.python.org/issue41100 https://github.com/python/cpython/pull/22855 ---------- versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:47:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 09:47:11 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627033631.82.0.642001298694.issue44676@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fe13f0b0f696464dd6f283576668dbf57cb11399 by Yurii Karabas in branch 'main': bpo-44676: Add ability to serialize types.Union (GH-27244) https://github.com/python/cpython/commit/fe13f0b0f696464dd6f283576668dbf57cb11399 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 05:47:25 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 09:47:25 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627033645.14.0.666792293932.issue44676@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 06:11:45 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 23 Jul 2021 10:11:45 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627035105.6.0.744909565955.issue44353@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25846 pull_request: https://github.com/python/cpython/pull/27302 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 06:18:59 2021 From: report at bugs.python.org (Bodo Graumann) Date: Fri, 23 Jul 2021 10:18:59 +0000 Subject: [issue44723] Codec name normalization breaks custom codecs Message-ID: <1627035539.3.0.918716906127.issue44723@roundup.psfhosted.org> New submission from Bodo Graumann : This is a follow up on https://bugs.python.org/issue37751 concerning normalization of codec names. First of all, the changes made therein are not documented correctly. In the implementation | 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) The documentation however only states that: | Search functions are expected to take one argument, being the encoding name in all lower case letters with hyphens and spaces converted to underscores Cf. https://docs.python.org/3/library/codecs.html#codecs.register 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) How about first looking up the given name and only then, if the given name could not be found, looking for the codec by its normalized name? ---------- components: Unicode messages: 398042 nosy: bodograumann, ezio.melotti, vstinner priority: normal severity: normal status: open title: Codec name normalization breaks custom codecs type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 06:37:08 2021 From: report at bugs.python.org (creative-resort) Date: Fri, 23 Jul 2021 10:37:08 +0000 Subject: [issue44722] RFC: string Multiline Formatter In-Reply-To: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> Message-ID: <1627036628.38.0.169943636321.issue44722@roundup.psfhosted.org> creative-resort added the comment: Thank you. In the process of providing that description I also just realized ? after also seeing the build fail ? that I'm making use of a library which is not part of the core (llist) for a doubly linked list. That dependency is most probably a deal breaker and would require refactoring. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 06:38:58 2021 From: report at bugs.python.org (Cheuk Ting Ho) Date: Fri, 23 Jul 2021 10:38:58 +0000 Subject: [issue44710] Unexpected behavior in empty class with pass (Python 3.7.3) In-Reply-To: <1626971742.78.0.379614893398.issue44710@roundup.psfhosted.org> Message-ID: <1627036738.48.0.237579944128.issue44710@roundup.psfhosted.org> Cheuk Ting Ho added the comment: Thank you, Serhiy for explaining that to me. I am closing it now since it is not a bug. ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 06:59:16 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Jul 2021 10:59:16 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627037956.47.0.482685132568.issue43838@roundup.psfhosted.org> Nick Coghlan added the comment: Delegating operations to the underlying mapping is still OK, all we're wanting to bypass is the operand coercion dances in abstract.c and object.c that may expose the underlying mapping to the *other* operand. We don't want to implicitly copy though, as the performance hit can be non-trivial for large mappings, even if the algorithmic complexity doesn't change. For the `nb_or` slot, it should be correct to retrieve and call `__or__` from the underlying mapping when the left operand is a MappingProxy instance, and `__ror__` when the right operand is a MappingProxy instance (but the left operand is not). Rich comparison is messier though, since PyObject_RichCompare handles both the operand coercion dance *and* the mapping of the specific comparison operations to their implementation slots. I don't see a clean solution to that other than defining a new PyObject_DelegateRichCompare helper function for the mapping proxy to use that provides the mapping from specific operands to their implementation slots *without* doing the coercion dance. However we resolve it, I think it probably won't be worth the risk of backporting the change (this has been the way it currently is for a long time, and it's a "reduce the risk of error" feature rather than any kind of security boundary). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 07:13:22 2021 From: report at bugs.python.org (Nick Coghlan) Date: Fri, 23 Jul 2021 11:13:22 +0000 Subject: [issue44405] add program passed as string to dis module. In-Reply-To: <1623545064.0.0.0970757041396.issue44405@roundup.psfhosted.org> Message-ID: <1627038802.95.0.137813819708.issue44405@roundup.psfhosted.org> Nick Coghlan added the comment: I suspect the only reason the dis CLI isn't documented is because it's been around for so long (22 years!) that nobody previously noticed it was missing: https://github.com/python/cpython/commit/1fdae12c93246fcf4abbf882ba08df789070dfcc Folks then either didn't know about it, or already knew how to use it. Even the migration to use argparse was a code cleanup from a user that happened to be reading the module source code and noticed that it didn't already do so: https://bugs.python.org/issue18538 I can see value in supporting `-c` and `-m` options to dis to align with the main interpreter CLI. ---------- nosy: +ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:06:23 2021 From: report at bugs.python.org (Senthil Kumaran) Date: Fri, 23 Jul 2021 12:06:23 +0000 Subject: [issue29555] Update Python Software Foundation Copyright Year In-Reply-To: <1487088120.64.0.260258993464.issue29555@psf.upfronthosting.co.za> Message-ID: <1627041983.72.0.137591113724.issue29555@roundup.psfhosted.org> Senthil Kumaran added the comment: Yes, closing this. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:39:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 12:39:50 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627043990.45.0.499557037863.issue44353@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PR27262 introduced reference leaks and currently all refleak buildbots are red: Example: https://buildbot.python.org/all/#/builders/205/builds/102/steps/5/logs/stdio Ran 367 tests in 0.198s OK (skipped=1) . test_typing leaked [220, 220, 220] references, sum=660 test_typing leaked [69, 68, 68] memory blocks, sum=205 1 test failed again: test_typing == Tests result: FAILURE then FAILURE == Per our buildbot policy, if a fix is not performed in 24 h we will need to revert ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:49:24 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Jul 2021 12:49:24 +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: <1627044564.68.0.658971141348.issue29298@roundup.psfhosted.org> miss-islington added the comment: New changeset 17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c by Anthony Sottile in branch 'main': bpo-29298: Fix crash with required subparsers without dest (GH-3680) https://github.com/python/cpython/commit/17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:49:15 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Jul 2021 12:49:15 +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: <1627044555.3.0.877466609912.issue29298@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 9.0 -> 10.0 pull_requests: +25847 pull_request: https://github.com/python/cpython/pull/27303 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:49:21 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Jul 2021 12:49:21 +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: <1627044561.33.0.360608632297.issue29298@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25848 pull_request: https://github.com/python/cpython/pull/27304 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 08:58:12 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 23 Jul 2021 12:58:12 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627045092.95.0.88593759355.issue44353@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- pull_requests: +25849 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27305 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:21:24 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Jul 2021 13:21:24 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1627046484.45.0.752300312819.issue42747@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25850 pull_request: https://github.com/python/cpython/pull/27306 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:21:20 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 23 Jul 2021 13:21:20 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1627046480.25.0.0282480144044.issue42747@roundup.psfhosted.org> miss-islington added the comment: New changeset a4760cc32d9e5dac7be262e9736eb30502cd7be3 by Petr Viktorin in branch 'main': bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) https://github.com/python/cpython/commit/a4760cc32d9e5dac7be262e9736eb30502cd7be3 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:27:23 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 13:27:23 +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: <1627046843.01.0.235721565676.issue29298@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset c589992e09d0db7cb47d21d5948929e599fdbb94 by Miss Islington (bot) in branch '3.10': bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27303) https://github.com/python/cpython/commit/c589992e09d0db7cb47d21d5948929e599fdbb94 ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:27:25 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 13:27:25 +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: <1627046845.46.0.267691415712.issue29298@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 097801844c99ea3916bebe1cc761257ea7083d34 by Miss Islington (bot) in branch '3.9': bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27304) https://github.com/python/cpython/commit/097801844c99ea3916bebe1cc761257ea7083d34 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:29:53 2021 From: report at bugs.python.org (Viktor Ivanov) Date: Fri, 23 Jul 2021 13:29:53 +0000 Subject: [issue44724] Resource Tracker is never reaped Message-ID: <1627046993.43.0.654405119923.issue44724@roundup.psfhosted.org> New submission from Viktor Ivanov : The multiprocessing.resource_tracker instance is never reaped, leaving zombie processes. There is a waitpid() call for the ResourceTracker's pid but it is in a private method _stop() which seems to be only called from some test modules. Usually environments have some process handling zombies but if python is the "main" process in a container, for example, and runs another python instance that does something leaking a ResourceTracker process, zombies start to accumulate. This is easily reproducible with a couple of small python programs as long as they are not run from a shell or another parent process that takes care of forgotten children. It was originally discovered in a docker container that has a python program as its entry point (celery worker in an airflow container) running other python programs (dbt). The minimal code is available on Github here: https://github.com/viktorvia/python-multi-issue The attached multi.py is leaking resource tracker processes, but just running it from a full-fledged development environment will not show the issue. Instead, run it via another python program from a Docker container: Dockerfile: --- FROM python:3.9 WORKDIR /usr/src/multi COPY . ./ CMD ["python", "main.py"] --- main.py: --- from subprocess import run from time import sleep while True: result = run(["python", "multi.py"], capture_output=True) print(result.stdout.decode('utf-8')) result = run(["ps", "-ef", "--forest"], capture_output=True) print(result.stdout.decode('utf-8'), flush=True) sleep(1) --- When the program is run it will accumulate 1 zombie on each run: --- $ docker run -it multi python main.py [1, 4, 9] UID PID PPID C STIME TTY TIME CMD root 1 0 11 11:33 pts/0 00:00:00 python main.py root 8 1 0 11:33 pts/0 00:00:00 [python] root 17 1 0 11:33 pts/0 00:00:00 ps -ef --forest [1, 4, 9] UID PID PPID C STIME TTY TIME CMD root 1 0 6 11:33 pts/0 00:00:00 python main.py root 8 1 3 11:33 pts/0 00:00:00 [python] root 19 1 0 11:33 pts/0 00:00:00 [python] root 28 1 0 11:33 pts/0 00:00:00 ps -ef --forest [1, 4, 9] UID PID PPID C STIME TTY TIME CMD root 1 0 4 11:33 pts/0 00:00:00 python main.py root 8 1 1 11:33 pts/0 00:00:00 [python] root 19 1 3 11:33 pts/0 00:00:00 [python] root 30 1 0 11:33 pts/0 00:00:00 [python] root 39 1 0 11:33 pts/0 00:00:00 ps -ef --forest [1, 4, 9] UID PID PPID C STIME TTY TIME CMD root 1 0 3 11:33 pts/0 00:00:00 python main.py root 8 1 1 11:33 pts/0 00:00:00 [python] root 19 1 1 11:33 pts/0 00:00:00 [python] root 30 1 4 11:33 pts/0 00:00:00 [python] root 41 1 0 11:33 pts/0 00:00:00 [python] root 50 1 0 11:33 pts/0 00:00:00 ps -ef --forest --- Running from a shell script, or just another python program that handles SIGCHLD by calling wait() takes care of the zombies. ---------- components: Library (Lib) files: multi.py messages: 398053 nosy: viktor.ivanov priority: normal severity: normal status: open title: Resource Tracker is never reaped type: resource usage versions: Python 3.7, Python 3.9 Added file: https://bugs.python.org/file50173/multi.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 09:31:52 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 23 Jul 2021 13:31:52 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1627047112.33.0.441351536932.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: I haven't modified `_finddoc` in my PR because it currently doesn't show all existing dataclass fields (only those with default set) -- therefore it would make sense to consider this addition if / when complete set of dataclass fields is added to _finddoc. Also as Terry mentioned, help() may end up using inspect.getdoc() in the future. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:04:08 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 23 Jul 2021 14:04:08 +0000 Subject: [issue44725] Expose specialization stats in python Message-ID: <1627049048.24.0.175321998203.issue44725@roundup.psfhosted.org> New submission from Irit Katriel : Make it possible to fetch the current specialization stats in python so that we can compute deltas for small code snippets as well as use them for specialization unit tests. ---------- components: Interpreter Core messages: 398055 nosy: iritkatriel priority: normal severity: normal status: open title: Expose specialization stats in python type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:04:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:04:38 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1627049078.19.0.682427875685.issue44611@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset 906fe47083bc9ab7ed2b70c99c1b0daad021f126 by Dong-hee Na in branch 'main': bpo-44611: Use BCryptGenRandom instead of CryptGenRandom on Windows (GH-27168) https://github.com/python/cpython/commit/906fe47083bc9ab7ed2b70c99c1b0daad021f126 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:04:46 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:04:46 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1627049086.17.0.266236722404.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:05:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 23 Jul 2021 14:05:18 +0000 Subject: [issue44725] Expose specialization stats in python In-Reply-To: <1627049048.24.0.175321998203.issue44725@roundup.psfhosted.org> Message-ID: <1627049118.14.0.868462999959.issue44725@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +25851 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27192 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:28:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 14:28:16 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627050496.22.0.471389269771.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8f42106b5c362495f72c6ca2fa3884538e4023db by Yurii Karabas in branch 'main': bpo-44353: Fix memory leak introduced by GH-27262 (GH-27305) https://github.com/python/cpython/commit/8f42106b5c362495f72c6ca2fa3884538e4023db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:28:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 14:28:44 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627050524.94.0.412004755522.issue44353@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:39:15 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:39:15 +0000 Subject: [issue44726] Build macOS version with thin lto option Message-ID: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> New submission from Dong-hee Na : Since the thin-lto option is available for macOS distribution. We can consider using the thin-lto option for the next macOS Python distribution? ---------- components: Build, macOS messages: 398058 nosy: corona10, ned.deily, ronaldoussoren priority: normal severity: normal status: open title: Build macOS version with thin lto option type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:41:32 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:41:32 +0000 Subject: [issue44726] Build macOS version with thin lto option In-Reply-To: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> Message-ID: <1627051292.76.0.645457627037.issue44726@roundup.psfhosted.org> Change by Dong-hee Na : ---------- keywords: +patch pull_requests: +25852 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27307 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:43:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 14:43:45 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627051425.69.0.901408022823.issue44707@roundup.psfhosted.org> ?ukasz Langa added the comment: I'm still unable to reproduce this locally. Objects/listobject.c:527:24 is this line in `list_concat`: dest = np->ob_item + Py_SIZE(a); (permalink: https://github.com/python/cpython/blob/8f42106b5c362495f72c6ca2fa3884538e4023db/Objects/listobject.c#L527) This can only be problematic if `ob_item` of the new list is NULL *AND* list `a` is non-empty. In practice that's impossible because if `a` is non-empty, it would already populate `np` with its elements using the for-loop right above the line in question. So this sounds like the compiler complaining about NULL + 0 which seems unnecessary? By the way, instead of messing with CC, it's preferred to use the --with-undefined-behavior-sanitizer option to ./configure. We could accept Serhiy's change but I'm afraid that without a reliable way to reproduce, this will regress at some point. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:45:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:45:25 +0000 Subject: [issue44726] Build macOS version with thin lto option In-Reply-To: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> Message-ID: <1627051525.09.0.187900752203.issue44726@roundup.psfhosted.org> Dong-hee Na added the comment: see bpo-44340 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:57:02 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 14:57:02 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1627052222.75.0.295361581559.issue42747@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 632e8a69593efb12ec58d90e624ddf249a7a1b65 by Miss Islington (bot) in branch '3.10': bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) (GH-27306) https://github.com/python/cpython/commit/632e8a69593efb12ec58d90e624ddf249a7a1b65 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 10:59:44 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 14:59:44 +0000 Subject: [issue44726] Build macOS version with thin lto option In-Reply-To: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> Message-ID: <1627052384.95.0.895354698737.issue44726@roundup.psfhosted.org> Dong-hee Na added the comment: However, to use thin-lto, build-installer.py should use clang compiler. We need to check this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:06:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 15:06:02 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1627052762.25.0.824653444501.issue42854@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 83d1430ee5b8008631e7f2a75447e740eed065c1 by Pablo Galindo Salgado in branch 'main': bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write (GH-27271) https://github.com/python/cpython/commit/83d1430ee5b8008631e7f2a75447e740eed065c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:06:05 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 15:06:05 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1627052762.25.0.824653444501.issue42854@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 83d1430ee5b8008631e7f2a75447e740eed065c1 by Pablo Galindo Salgado in branch 'main': bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write (GH-27271) https://github.com/python/cpython/commit/83d1430ee5b8008631e7f2a75447e740eed065c1 ---------- message_count: 11.0 -> 12.0 nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25853 pull_request: https://github.com/python/cpython/pull/27308 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:13:34 2021 From: report at bugs.python.org (Ned Deily) Date: Fri, 23 Jul 2021 15:13:34 +0000 Subject: [issue44726] Build macOS version with thin lto option In-Reply-To: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> Message-ID: <1627053214.14.0.0934941620186.issue44726@roundup.psfhosted.org> Ned Deily added the comment: Thanks for the suggestion. I will do some testing and, if warranted, make the necessary changes. ---------- assignee: -> ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:20:19 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 23 Jul 2021 15:20:19 +0000 Subject: =?utf-8?q?=5Bissue34963=5D_String_representation_for_types_created_with_t?= =?utf-8?q?yping=2ENewType=28=E2=80=A6=29_are_opaque_and_unappealing?= In-Reply-To: <1539313395.67.0.788709270274.issue34963@psf.upfronthosting.co.za> Message-ID: <1627053619.64.0.260183127207.issue34963@roundup.psfhosted.org> Yurii Karabas <1998uriyyo at gmail.com> added the comment: `NewType` was converted into callable class at scope of https://bugs.python.org/issue44353 Currently `repr` of `NewType` is: ``` >>> UserId = NewType("UserId", int) __main__.UserId ``` ---------- nosy: +uriyyo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:23:29 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 15:23:29 +0000 Subject: [issue44726] Build macOS version with thin lto option In-Reply-To: <1627051155.42.0.803615508224.issue44726@roundup.psfhosted.org> Message-ID: <1627053809.48.0.121761238784.issue44726@roundup.psfhosted.org> Dong-hee Na added the comment: > Thanks for the suggestion. I will do some testing and, if warranted, make the necessary changes. Thanks Ned! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:23:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 15:23:37 +0000 Subject: [issue44727] Stable ABI should avoid `enum` Message-ID: <1627053817.9.0.30877505306.issue44727@roundup.psfhosted.org> New submission from Petr Viktorin : Adding a new enumerator to a C enum can change the size of the type, which would break the ABI. This is not often a problem in practice, but the rules around when it is a problem and when it isn't are complicated enough that I believe enum should not be used in the stable ABI (possibly with well-reasoned exceptions) AFAICS, the rules are: - In C++, an incompatible change to an enum is one that changes the size of the *smallest bit field large enough to hold all enumerators*. Values outside the range cause undefined/unspecified behavior. - In C, it looks like enums that fit in `char` are safe. (Also, the compiler-defined size of enums will make it more cumbersome to formally define an ABI for non-C languages.) ---------- components: C API messages: 398067 nosy: petr.viktorin priority: normal severity: normal status: open title: Stable ABI should avoid `enum` _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:26:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 15:26:03 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1627053963.94.0.365199064352.issue42854@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 5ec275758dbc307e9838e7038bfc3b5390950ea7 by Miss Islington (bot) in branch '3.10': bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and _ssl._SSLSocket.write (GH-27271) (GH-27308) https://github.com/python/cpython/commit/5ec275758dbc307e9838e7038bfc3b5390950ea7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:26:03 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 15:26:03 +0000 Subject: [issue42854] OpenSSL 1.1.1: use SSL_write_ex() and SSL_read_ex() In-Reply-To: <1610007789.81.0.109119647565.issue42854@roundup.psfhosted.org> Message-ID: <1627053963.23.0.0804829208585.issue42854@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 Jul 23 11:26:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 23 Jul 2021 15:26:58 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1627054018.08.0.235431755501.issue42747@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is there anything left in this issue? ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:28:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 15:28:58 +0000 Subject: [issue44727] Stable ABI should avoid `enum` In-Reply-To: <1627053817.9.0.30877505306.issue44727@roundup.psfhosted.org> Message-ID: <1627054138.93.0.877849591924.issue44727@roundup.psfhosted.org> Petr Viktorin added the comment: Devguide PR: https://github.com/python/devguide/pull/730 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:44:16 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 15:44:16 +0000 Subject: [issue44727] Stable ABI should avoid `enum` In-Reply-To: <1627053817.9.0.30877505306.issue44727@roundup.psfhosted.org> Message-ID: <1627055056.84.0.408110483045.issue44727@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:49:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 23 Jul 2021 15:49:09 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1627055349.58.0.0994300131276.issue34602@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25854 pull_request: https://github.com/python/cpython/pull/27309 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:49:43 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 15:49:43 +0000 Subject: [issue44727] Stable ABI should avoid `enum` In-Reply-To: <1627053817.9.0.30877505306.issue44727@roundup.psfhosted.org> Message-ID: <1627055383.07.0.643297795133.issue44727@roundup.psfhosted.org> Petr Viktorin added the comment: As far as I can see, the current enums in the stable ABI are: PySendResult from object.h, return value of PyObject_Send: typedef enum { PYGEN_RETURN = 0, PYGEN_ERROR = -1, PYGEN_NEXT = 1, } PySendResult; (This is unlikely to change in the future, but added in 3.10, maybe it can be converted to int.) PyLockStatus from pythread.h, return value of PyThread_acquire_lock_timed: typedef enum PyLockStatus { PY_LOCK_FAILURE = 0, PY_LOCK_ACQUIRED = 1, PY_LOCK_INTR } PyLockStatus; (This has been there for a long time so shouldn't be changed now.) PyGILState_STATE from pystate.h, for PyGILState_Ensure/PyGILState_Release: typedef enum {PyGILState_LOCKED, PyGILState_UNLOCKED} PyGILState_STATE; (Also is unlikely to change in the future.) ---------- nosy: -corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:51:12 2021 From: report at bugs.python.org (Chih-Hsuan Yen) Date: Fri, 23 Jul 2021 15:51:12 +0000 Subject: [issue34602] python3 resource.setrlimit strange behaviour under macOS In-Reply-To: <1536316486.92.0.56676864532.issue34602@psf.upfronthosting.co.za> Message-ID: <1627055472.35.0.434240812195.issue34602@roundup.psfhosted.org> Change by Chih-Hsuan Yen : ---------- nosy: -yan12125 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:53:41 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 23 Jul 2021 15:53:41 +0000 Subject: [issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL' In-Reply-To: <1520908295.51.0.467229070634.issue33063@psf.upfronthosting.co.za> Message-ID: <1627055621.42.0.744708148961.issue33063@roundup.psfhosted.org> Change by Zachary Ware : ---------- pull_requests: -25844 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:54:23 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 23 Jul 2021 15:54:23 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627055663.79.0.434504283893.issue43838@roundup.psfhosted.org> Brandt Bucher added the comment: > Delegating operations to the underlying mapping is still OK, all we're wanting to bypass is the operand coercion dances in abstract.c and object.c that may expose the underlying mapping to the *other* operand. But this won't work if *both* operands are proxies, right? The left wrapped mapping will only ever see itself and the right mappingproxy, and the right operand will only ever see itself and the left mappingproxy. The overwhelmingly common case is where these proxies wrap dicts, and dicts only play nicely with other dicts. I agree that creating redundant copies isn't optimal; it's just the only way that I see we'd be able to fix this without backward compatibility headaches. The fix is easy to explain to users without needing to get into the nuances of operator dispatch or bloating the code to handle weird edge-cases (trust me, I originally tried coding logic to handle all the different possibilities of subclasses and proxies and such before landing on the copying solution). With that said, I think that if we decide it's really not worth it to copy here, Serhiy's proposal is probably "good enough". Just return a merged dict for the union operation, and implement mapping equality in a sane, usable way. I just worry that it will break backward-compatibility in subtle ways that are basically impossible to fix (comparing equality of proxied OrderedDicts, for example). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:56:25 2021 From: report at bugs.python.org (Zachary Ware) Date: Fri, 23 Jul 2021 15:56:25 +0000 Subject: [issue33063] failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL' In-Reply-To: <1520908295.51.0.467229070634.issue33063@psf.upfronthosting.co.za> Message-ID: <1627055785.2.0.216719665679.issue33063@roundup.psfhosted.org> Zachary Ware added the comment: The bundled version of libffi is no longer included in any version in bugfix support; closing this as out of date. As suggested in an earlier message, the libffi from your system should be used instead if you're building a version of Python that still includes a copy of libffi. ---------- resolution: -> out of date stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 11:56:58 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 15:56:58 +0000 Subject: [issue41756] Do not always use exceptions to return result from coroutine In-Reply-To: <1599786636.95.0.884410425349.issue41756@roundup.psfhosted.org> Message-ID: <1627055818.47.0.257235536178.issue41756@roundup.psfhosted.org> Petr Viktorin added the comment: Hello! This change added an enum to the stable ABI: typedef enum { PYGEN_RETURN = 0, PYGEN_ERROR = -1, PYGEN_NEXT = 1, } PySendResult; Adding new values to enums might break the stable ABI in some (admittedly rare) cases; so usually it's better to avoid enums and stick with int and #ifdef'd values. This particular one looks like it won't be extended and won't cause problems, but still, switching to int would make stable ABI easier to work with. Is anyone against switching to int? See pbo-44727 for details. ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:04:57 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 16:04:57 +0000 Subject: [issue41756] Do not always use exceptions to return result from coroutine In-Reply-To: <1599786636.95.0.884410425349.issue41756@roundup.psfhosted.org> Message-ID: <1627056297.06.0.24203706785.issue41756@roundup.psfhosted.org> Petr Viktorin added the comment: that is, bpo-44727 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:05:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 16:05:30 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627056330.36.0.0981130820801.issue44353@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:08:12 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Fri, 23 Jul 2021 16:08:12 +0000 Subject: [issue22240] argparse support for "python -m module" in help In-Reply-To: <1408564751.42.0.897410433728.issue22240@psf.upfronthosting.co.za> Message-ID: <1627056492.49.0.849443333274.issue22240@roundup.psfhosted.org> Nils Kattenbeck added the comment: I expanded the patch from tebeka to also work with invocations like `python3 -m serial.tools.miniterm` where `miniterm.py` is a file and not a directory with a `__main__.py`. This was able to handle everything I threw at it. However due to the import of zipfile which itself imports binascii the build of CPython itself fails at the `sharedmods` stage... ```text CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build Traceback (most recent call last): File "/home/septatrix/Documents/programming/cpython/./setup.py", line 3, in import argparse ^^^^^^^^^^^^^^^ File "/home/septatrix/Documents/programming/cpython/Lib/argparse.py", line 93, in from zipfile import is_zipfile as _is_zipfile ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/septatrix/Documents/programming/cpython/Lib/zipfile.py", line 6, in import binascii ^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'binascii' make: *** [Makefile:639: sharedmods] Error 1 ``` I guess this is because binascii is a c module and not yet build at that point in time. Does anyone who knows more about the build system have an idea how to resolve this? --- Resolving this bug would also allow the removal of several workarounds for this in the stdlib: * https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/unittest/__main__.py#L4 * https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/json/tool.py#L19 * https://github.com/python/cpython/blob/83d1430ee5b8008631e7f2a75447e740eed065c1/Lib/venv/__init__.py#L426 ---------- Added file: https://bugs.python.org/file50174/patch.diff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:09:37 2021 From: report at bugs.python.org (Petr Viktorin) Date: Fri, 23 Jul 2021 16:09:37 +0000 Subject: [issue42747] Remove Py_TPFLAGS_HAVE_VERSION_TAG flag? In-Reply-To: <1608940087.88.0.458230907712.issue42747@roundup.psfhosted.org> Message-ID: <1627056577.92.0.331611526054.issue42747@roundup.psfhosted.org> Petr Viktorin added the comment: I usually wait until buildbots are green before closing the bpo, but I don't think there's anything else. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:37:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 23 Jul 2021 16:37:40 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1627058260.42.0.804640908474.issue42378@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 1.0 -> 2.0 pull_requests: +25855 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27310 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:38:46 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 23 Jul 2021 16:38:46 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1627058326.63.0.326202923948.issue42378@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up a PR here: https://github.com/python/cpython/pull/27310/files If this looks good, I will update the docs and add news entry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 12:49:21 2021 From: report at bugs.python.org (Leonardo Freua) Date: Fri, 23 Jul 2021 16:49:21 +0000 Subject: [issue35728] Tkinter font nametofont requires default root In-Reply-To: <1547328812.09.0.281453810047.issue35728@roundup.psfhosted.org> Message-ID: <1627058961.53.0.113445684295.issue35728@roundup.psfhosted.org> Leonardo Freua added the comment: Has the PR already solved the problem? If yes, could this issue not be closed? ---------- nosy: +Leonardofreua _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:03:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 17:03:02 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627059782.71.0.840194436019.issue44353@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25856 pull_request: https://github.com/python/cpython/pull/27311 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:05:34 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 17:05:34 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627059934.97.0.854590014652.issue44353@roundup.psfhosted.org> Serhiy Storchaka added the comment: PR 27311 copies tests from PR 9951, adds support of nested NewTypes (with __qualname__ containing multiple components) an makes them pickleable by name as functions and classes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:20:12 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 23 Jul 2021 17:20:12 +0000 Subject: [issue44721] Problem in tkinter button widget In-Reply-To: <1627018612.93.0.785894598889.issue44721@roundup.psfhosted.org> Message-ID: <1627060812.69.0.8881921562.issue44721@roundup.psfhosted.org> E. Paine added the comment: Sadly, there is no `activerelief` option. The Tk man pages note the following: > A button's relief is changed to sunken whenever mouse button 1 is pressed over the button, and the relief is restored to its original value when button 1 is later released. [https://www.tcl.tk/man/tcl8.6/TkCmd/button.html#M18] You can also see in the source code that sunken is hard-coded: https://github.com/tcltk/tk/blob/1802b8a5d6807bdab6ac703f48e6e6bf07970266/library/button.tcl#L227 Personally, I think changing the relief to 'sunken' on click is an important feature, since a user needs feedback on when they've clicked the button. Thank you for reporting this issue, but I think it should be closed as either 'not a bug' or 'third party'. ---------- nosy: +epaine, serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:28:04 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 17:28:04 +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: <1627061284.58.0.6077780337.issue38291@roundup.psfhosted.org> Serhiy Storchaka added the comment: Currently deprecation warnings are emitted in test_typing: $ ./python -m test test_typing 0:00:00 load avg: 3.38 Run tests sequentially 0:00:00 load avg: 3.38 [1/1] test_typing /home/serhiy/py/cpython/Lib/test/test_typing.py:4657: DeprecationWarning: typing.io is deprecated, import directly from typing instead. typing.io will be removed in Python 3.12. k not in typing.io.__all__ and /home/serhiy/py/cpython/Lib/test/test_typing.py:4658: DeprecationWarning: typing.re is deprecated, import directly from typing instead. typing.re will be removed in Python 3.12. k not in typing.re.__all__ and == Tests result: SUCCESS == 1 test OK. Total duration: 564 ms Tests result: SUCCESS ---------- assignee: docs at python -> nosy: +serhiy.storchaka resolution: fixed -> stage: resolved -> needs patch status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:30:00 2021 From: report at bugs.python.org (Seyed Amirhossein Misaghi) Date: Fri, 23 Jul 2021 17:30:00 +0000 Subject: [issue44721] Problem in tkinter button widget In-Reply-To: <1627018612.93.0.785894598889.issue44721@roundup.psfhosted.org> Message-ID: <1627061400.16.0.208457411429.issue44721@roundup.psfhosted.org> Seyed Amirhossein Misaghi added the comment: Thanks for your response ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:30:08 2021 From: report at bugs.python.org (Seyed Amirhossein Misaghi) Date: Fri, 23 Jul 2021 17:30:08 +0000 Subject: [issue44721] Problem in tkinter button widget In-Reply-To: <1627018612.93.0.785894598889.issue44721@roundup.psfhosted.org> Message-ID: <1627061408.05.0.117328322269.issue44721@roundup.psfhosted.org> Change by Seyed Amirhossein Misaghi : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:31:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 23 Jul 2021 17:31:50 +0000 Subject: [issue44721] Problem in tkinter button widget In-Reply-To: <1627018612.93.0.785894598889.issue44721@roundup.psfhosted.org> Message-ID: <1627061510.76.0.244884546278.issue44721@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> not a bug _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:51:57 2021 From: report at bugs.python.org (Dominic Davis-Foster) Date: Fri, 23 Jul 2021 17:51:57 +0000 Subject: [issue43838] There is a way to access an underlying mapping in MappingProxyType In-Reply-To: <1618385668.86.0.518778578496.issue43838@roundup.psfhosted.org> Message-ID: <1627062717.15.0.37814897068.issue43838@roundup.psfhosted.org> Change by Dominic Davis-Foster : ---------- nosy: +domdfcoding _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 13:55:01 2021 From: report at bugs.python.org (Erich Eckner) Date: Fri, 23 Jul 2021 17:55:01 +0000 Subject: [issue44728] Testsuite fails on x86_64 Message-ID: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> New submission from Erich Eckner : The following tests fails on x86 32 bit: test_cmath test_math test_posix test_turtle - looks, like the expected precision is too high. Full log is attached. ---------- components: Tests files: build-log.php?a=pentium4&p=python messages: 398084 nosy: deep42thought priority: normal severity: normal status: open title: Testsuite fails on x86_64 versions: Python 3.9 Added file: https://bugs.python.org/file50175/build-log.php?a=pentium4&p=python _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:05:30 2021 From: report at bugs.python.org (Sebastian Rittau) Date: Fri, 23 Jul 2021 18:05:30 +0000 Subject: [issue38291] Deprecate the typing.io and typing.re pseudo-modules In-Reply-To: <1569584917.37.0.450943031305.issue38291@roundup.psfhosted.org> Message-ID: <1627063530.36.0.692816830295.issue38291@roundup.psfhosted.org> Change by Sebastian Rittau : ---------- pull_requests: +25857 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27312 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:16:58 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 23 Jul 2021 18:16:58 +0000 Subject: [issue41256] activate script created by venv is not smart enough In-Reply-To: <1594288628.21.0.90149093497.issue41256@roundup.psfhosted.org> Message-ID: <1627064218.61.0.0792616074022.issue41256@roundup.psfhosted.org> Jack DeVries added the comment: What do you think about this as an entrypoint? ```sh #!/usr/bin/env # this becomes venv/bin/activate # the old venv/bin/activate is now venv/bin/activate.sh # Try to execute a `return` statement, # but do it in a sub-shell and catch the results. # If this script isn't sourced, that will raise an error. $(return >/dev/null 2>&1) # What exit code did that give? if [ "$?" -ne "0" ] then echo "Warning: this script must be sourced, not run in a subshell." echo "Try \"source /path/to/activate\" on unix-like systems." fi # dispatch to shell-specific activate scripts # *ignore proper path construction for the sake of demonstration...* [ $BASH_VERSION ] || [ $ZSH_VERSION ] && . ./activate.sh [ $FISH_VERSION ] && . ./activate.fish [ $csh_version ] && . ./activate.csh ``` The try-to-return trick was shamelessly taken from here: https://stackoverflow.com/a/34642589/13262536 I am a shell scripting novice, so I am certain that there are many unaddressed edge cases here. I know that reliably detecting whether a script has been sourced or "ran" is essentially impossible to do in a cross-platform way. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:17:44 2021 From: report at bugs.python.org (Jack DeVries) Date: Fri, 23 Jul 2021 18:17:44 +0000 Subject: [issue41256] activate script created by venv is not smart enough In-Reply-To: <1594288628.21.0.90149093497.issue41256@roundup.psfhosted.org> Message-ID: <1627064264.71.0.084318292774.issue41256@roundup.psfhosted.org> Jack DeVries added the comment: *please disregard the typo in the shebang line!* ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:47:58 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 18:47:58 +0000 Subject: [issue35728] Tkinter font nametofont requires default root In-Reply-To: <1547328812.09.0.281453810047.issue35728@roundup.psfhosted.org> Message-ID: <1627066078.28.0.633501082953.issue35728@roundup.psfhosted.org> Terry J. Reedy added the comment: The code I gave above now exits with a clearer message. RuntimeError: No master specified and tkinter is configured to not support default root But now, in 3.10, the master can be specified, so that fnt = font.nametofont('TkFixedFont', root) works. Thank you Serhiy and desmondcheongzx. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:57:03 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 23 Jul 2021 18:57:03 +0000 Subject: [issue44719] Incorrect callable object crashes Python 3.11.0a0 In-Reply-To: <1627014429.86.0.790861111444.issue44719@roundup.psfhosted.org> Message-ID: <1627066623.71.0.169716388975.issue44719@roundup.psfhosted.org> Dennis Sweeney added the comment: ### Simplified crasher from weakref import ref def f(): ref(lambda: 0, []) f() f() ######################## Running this in debug mode, I got a failed assertion at traceback.c, line 746, `assert(source_line);`. If that assertion is commented out, a null pointer is dereferenced in _PyPegen_byte_offset_to_character_offset() ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 14:58:19 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 23 Jul 2021 18:58:19 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627066699.09.0.171672861869.issue43950@roundup.psfhosted.org> Dennis Sweeney added the comment: bpo-44719 managed to make the `assert(source_line);` fail ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 15:08:48 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Fri, 23 Jul 2021 19:08:48 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627067328.38.0.814950504588.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25858 pull_request: https://github.com/python/cpython/pull/27313 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 15:42:15 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 23 Jul 2021 19:42:15 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1627069335.37.0.131971513689.issue42414@roundup.psfhosted.org> Eric V. Smith added the comment: The more I think about this, the less I like it as a dataclasses-specific solution (if it?s accepted at all, that is). Why dataclasses and not attrs or NamedTuple? I suggest bringing it up on python-ideas for wider exposure. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 15:59:17 2021 From: report at bugs.python.org (Brandt Bucher) Date: Fri, 23 Jul 2021 19:59:17 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627070357.47.0.961204551584.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: Two other things we realized while working on this: - The first occurrence of line 15 in the example output should be marked as incorrectly traced. - We should emit a NOP to show coverage of "case _" (that fix will be part of the same PR). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 16:07:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 23 Jul 2021 20:07:05 +0000 Subject: [issue42414] unable to document fields of dataclass In-Reply-To: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> Message-ID: <1627070825.49.0.24821991116.issue42414@roundup.psfhosted.org> Andrei Kulakov added the comment: I was thinking about adding this to named tuple as well, but it's less useful than with dataclasses because named tuples are simpler and smaller. However if this feature is added to dataclasses and is widely used, it would make a lot of sense to expand it to namedtuples especially if people request that. I don't think it makes sense for attributes because many attributes are immutable so you can't add a doc attr to them. Additionally, most attrs can be documented via methods that set or update them. I agree it's a good idea to bring this to Ideas, I'll think about this for a few days and then do that. Thanks! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 16:08:21 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Fri, 23 Jul 2021 20:08:21 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627070901.27.0.220963824745.issue44693@roundup.psfhosted.org> ?ric Araujo added the comment: > it doesn't do a normal import of the `__future__.py` module, it is actually a compiler directive. It?s both! The compiler has special handling for this line (pseudo-module), and the interpreter does a regular import that gets the regular python module which can be used for introspection (the third purpose noted in the module doc). ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 16:52:57 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 20:52:57 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627073577.01.0.15815914573.issue44660@roundup.psfhosted.org> Terry J. Reedy added the comment: RFC 6532 Internationalized Email Headers https://datatracker.ietf.org/doc/html/rfc6532 3.5. Changes to MIME Message Type Encoding Restrictions https://datatracker.ietf.org/doc/html/rfc6532#section-3.5 don't obviously "message/global Emails with non-identity Content-Transfer-Encodings". Please clarify. ---------- nosy: +terry.reedy title: email.feedparser Module Lacks Support for Section 3.5 of RFC 6532: message/global Emails with non-identity Content-Transfer-Encodings -> email.feedparser: support RFC 6532 section 3.5 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:02:20 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 21:02:20 +0000 Subject: [issue44671] Create a built-in yaml module In-Reply-To: <1626644028.22.0.677421965462.issue44671@roundup.psfhosted.org> Message-ID: <1627074140.37.0.643005845583.issue44671@roundup.psfhosted.org> Terry J. Reedy added the comment: The current status of this idea is that it has been rejected. Please read the previous discussion(s) and consider the arguments against. If you then still want this idea reconsidered, please post to the python-ideas list explaining why you think the rejection is wrong, or what you think has changed. Please do not simply repeat the previous arguments. ---------- nosy: +terry.reedy resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:14:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 21:14:10 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627074850.06.0.736470553633.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: I thnk the glossary should say both. Approximately: "When the first statement of a program starts 'from __future__ import feature', a pseudo-module ... . When used later in a program, __future__ is a real module." Link each statement to an appropriate place in the doc. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:17:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 21:17:36 +0000 Subject: [issue44709] [3.7] Popen Control Characters in stdout affect shell session In-Reply-To: <1626969626.94.0.722055319986.issue44709@roundup.psfhosted.org> Message-ID: <1627075056.87.0.745126584414.issue44709@roundup.psfhosted.org> Terry J. Reedy added the comment: Interpreting the last post ... ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:28:26 2021 From: report at bugs.python.org (Arjun) Date: Fri, 23 Jul 2021 21:28:26 +0000 Subject: [issue44674] dataclasses should allow frozendict default value In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> Message-ID: <1627075706.77.0.684166847943.issue44674@roundup.psfhosted.org> Arjun added the comment: Which frozendict does your message concern? I found this in some test: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/test/test_builtin.py#L741 or are you suggesting any user defined immutable object? I'm not sure indicating that an object should be immutable to dataclasses will be less cumbersome than default_factory. Currently, you have to do this: > x: frozendict = field(default_factory=frozendict) But, indicating mutability would be something like this: > x: frozendict = field(mutable=false) ---------- nosy: +CCLDArjun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:40:52 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 21:40:52 +0000 Subject: [issue44722] RFC: string Multiline Formatter In-Reply-To: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> Message-ID: <1627076452.58.0.692708143333.issue44722@roundup.psfhosted.org> Terry J. Reedy added the comment: I suggest you close this issue and if you have an improved code, propose it on python-ideas list for discussion. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:44:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 23 Jul 2021 21:44:34 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627076674.0.0.0166179922419.issue44660@roundup.psfhosted.org> Terry J. Reedy added the comment: dont obviously *match* .... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 17:45:36 2021 From: report at bugs.python.org (Francis Johnson) Date: Fri, 23 Jul 2021 21:45:36 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627076736.19.0.878812888106.issue44660@roundup.psfhosted.org> Francis Johnson added the comment: Try parsing an example such as this through the Python email library: Content-Type: message/global Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; = charset=3D?us-ascii? Hello, World! You will find that the valid quoted-printable content is visited but not decoded prior to parsing; it is parsed as-is and treated as a bad message: the charset in the ?text/plain? Content-Type improperly parsed, for example. I have a draft pull request for this, which might be easier to understand. Let me know if you need further clarification. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 18:07:25 2021 From: report at bugs.python.org (Dong-hee Na) Date: Fri, 23 Jul 2021 22:07:25 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1627078045.0.0.234747057268.issue44611@roundup.psfhosted.org> Change by Dong-hee Na : ---------- pull_requests: +25859 pull_request: https://github.com/python/cpython/pull/27314 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 19:31:28 2021 From: report at bugs.python.org (Hasan) Date: Fri, 23 Jul 2021 23:31:28 +0000 Subject: [issue44729] sys.setprofile bug Message-ID: <1627083088.37.0.595553564439.issue44729@roundup.psfhosted.org> New submission from Hasan : 1. If we try to import modules except os or sys, we will get such events. 2. If we access frame.f_locals.items() and frame.f_code.replace() inside tracefunc, function execution shows events and stops, but if access other frame.f_locals.* it begins to call and look all files in python directory import sys def tracefunc(frame, event, arg): if event == "call": print('frame.f_locals.items: ->', frame.f_locals.items()) return tracefunc sys.setprofile(tracefunc) def test_sum(x: int, y: int): return x + y test_sum(10, 20) import asyncio ------------- event: -> call frame.f_locals.items: -> dict_items([('x', 10), ('y', 20)]) event: -> return event: -> call frame.f_locals.items: -> dict_items([('name', 'asyncio'), ('import_', )]) event: -> call frame.f_locals.items: -> dict_items([('self', <_frozen_importlib._ModuleLockManager object at 0x10ae2a3f0>), ('name', 'asyncio')]) event: -> return event: -> call frame.f_locals.items: -> dict_items([('self', <_frozen_importlib._ModuleLockManager object at 0x10ae2a3f0>)]) event: -> call frame.f_locals.items: -> dict_items([('name', 'asyncio')]) event: -> c_call event: -> c_return event: -> call frame.f_locals.items: -> Traceback (most recent call last): File "/Users/hasanaliyev/Documents/programming/github/test/debugger/notwork.py", line 38, in import asyncio ^^^^^^^^^^^^^^ File "", line 1024, in _find_and_load File "", line 170, in __enter__ File "", line 196, in _get_module_lock File "", line 71, in __init__ File "/Users/hasanaliyev/Documents/programming/github/test/debugger/notwork.py", line 24, in tracefunc print('frame.f_locals.items: ->', frame.f_locals.items()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 139, in __repr__ AttributeError: '_ModuleLock' object has no attribute 'name' ---------- components: Library (Lib) messages: 398102 nosy: AliyevH priority: normal severity: normal status: open title: sys.setprofile bug versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 19:31:42 2021 From: report at bugs.python.org (Hasan) Date: Fri, 23 Jul 2021 23:31:42 +0000 Subject: [issue44729] sys.setprofile bug In-Reply-To: <1627083088.37.0.595553564439.issue44729@roundup.psfhosted.org> Message-ID: <1627083102.95.0.733502017506.issue44729@roundup.psfhosted.org> Change by Hasan : ---------- type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 19:35:10 2021 From: report at bugs.python.org (blackrose 1337) Date: Fri, 23 Jul 2021 23:35:10 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627083310.07.0.686112980508.issue44660@roundup.psfhosted.org> blackrose 1337 added the comment: #44713: subprocess.rst typo ``"shell=True"`` => ``shell=True`` ---------- nosy: +virusdetected1337 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 19:38:41 2021 From: report at bugs.python.org (Gareth Williams) Date: Fri, 23 Jul 2021 23:38:41 +0000 Subject: [issue44730] unittest.mock.patch does not work as a decorator on generator functions Message-ID: <1627083521.49.0.990756419002.issue44730@roundup.psfhosted.org> New submission from Gareth Williams : unitest.mock.patch does not work well when applied as a decorator to a function which is a generator. It results in the function being changed from a generator function (co_flags 99) to a non-generator (co_flag 31) and the patch is not applied. [I have a MWE, attached, and fairly simple fix, to the file mock.py, which I will put up as a PR in due course. This is the first time I've submitted a bug or PR, so apologies if I've not done this particularly well.] ---------- components: Library (Lib) files: example_patch_failure.py messages: 398104 nosy: garethmjwilliams priority: normal severity: normal status: open title: unittest.mock.patch does not work as a decorator on generator functions type: enhancement versions: Python 3.8 Added file: https://bugs.python.org/file50176/example_patch_failure.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:00:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Jul 2021 00:00:42 +0000 Subject: [issue44674] dataclasses should allow frozendict default value In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> Message-ID: <1627084842.13.0.768659775953.issue44674@roundup.psfhosted.org> Eric V. Smith added the comment: When I originally read this, I read it as frozenset. I agree that there's no good way of telling if an arbitrary class is immutable, so I'm not sure we can do anything here. So I think we should close this as a rejected idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:03:17 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Jul 2021 00:03:17 +0000 Subject: [issue44674] dataclasses should allow frozendict default value In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> Message-ID: <1627084997.61.0.402977511436.issue44674@roundup.psfhosted.org> Change by Eric V. Smith : ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:03:48 2021 From: report at bugs.python.org (Gary Davenport) Date: Sat, 24 Jul 2021 00:03:48 +0000 Subject: [issue44429] Tkinter Flow Geometry Manager In-Reply-To: <1623798573.21.0.50454331855.issue44429@roundup.psfhosted.org> Message-ID: <1627085028.89.0.447410677694.issue44429@roundup.psfhosted.org> Gary Davenport added the comment: Just an update on this issue. I did make 2 packages available on pypi.org: https://pypi.org/project/flowframe/ and https://pypi.org/project/tkinterflow/ Thank you very much for your help. ---------- resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:27:53 2021 From: report at bugs.python.org (Francis Johnson) Date: Sat, 24 Jul 2021 00:27:53 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627086473.58.0.395519219484.issue44660@roundup.psfhosted.org> Francis Johnson added the comment: The first paragraph of section 3.5 states two positions that the RFC holds on Content-Transfer-Encodings: (1) ?allows newly defined MIME types to permit content-transfer-encoding;? and (2) ?allows content-transfer-encoding for message/global (see Section 3.7) [sic].? The second position refers to and combines with section 3.7 (namely the ?Encoding considerations? paragraph) to support my interpretation that implementations should accurately parse "message/global Emails with non-identity Content-Transfer-Encodings? (how I have paraphrased it). For quick reference, ?non-identity? refers to the ?quoted-printable? and ?base64? Content-Transfer-Encodings. The first position ?suggests? a wider breadth, but I do not think its words ?necessitate? it. For, the RFC lists only one ?newly defined MIME type;? whereas a media/MIME type in general (in this case, all others) only affects the scope of RFCs that define/update it. So I think my interpretation is precise if one defers to section 3 of the RFC. Now, admittedly, two other sections in the RFC seem to contradict section 3.5 by broadening the scope (Abstract, p. 2; Introduction, s. 1, p. 3). I?m not super hung up on how to resolve the contradiction; but I think, at a minimum, the missing support for ?message/global? should be added. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:53:09 2021 From: report at bugs.python.org (R. David Murray) Date: Sat, 24 Jul 2021 00:53:09 +0000 Subject: [issue44660] email.feedparser: support RFC 6532 section 3.5 In-Reply-To: <1626493971.02.0.0360385916287.issue44660@roundup.psfhosted.org> Message-ID: <1627087989.33.0.395436016896.issue44660@roundup.psfhosted.org> R. David Murray added the comment: Having looked at the cited part of the RFC (but not tried to analyze it in detail), I think you are correct. I've also glanced at your PR, and I think your approach is correct in broad outline, but I haven't looked at the details. For full message/global support, however, it will also be necessary to look at the output side: given a message/global part, a transfer encoding should be applied when serializing with cte_type=7bit. Support for message/global should also be added to the contentmanager. I won't have an objection if this is accepted with only the feedparser support, but I would recommend that the remaining pieces of support for message/global be added before the feature is released. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:57:01 2021 From: report at bugs.python.org (Gareth Williams) Date: Sat, 24 Jul 2021 00:57:01 +0000 Subject: [issue44730] unittest.mock.patch does not work as a decorator on generator functions In-Reply-To: <1627083521.49.0.990756419002.issue44730@roundup.psfhosted.org> Message-ID: <1627088221.75.0.816227844379.issue44730@roundup.psfhosted.org> Change by Gareth Williams : ---------- keywords: +patch pull_requests: +25860 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27315 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 20:59:42 2021 From: report at bugs.python.org (R. David Murray) Date: Sat, 24 Jul 2021 00:59:42 +0000 Subject: [issue44694] Message from BytesParser cannot be flattened immediately In-Reply-To: <1626865587.67.0.966185604714.issue44694@roundup.psfhosted.org> Message-ID: <1627088382.5.0.885446186517.issue44694@roundup.psfhosted.org> R. David Murray added the comment: I suspect maxheaderlen=0 works because it causes the original lines to be re-emitted without any folding or other processing. Without that, lines longer than the default max_line_length get refolded. Can you provide an example of an input message that triggers this problem? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 21:08:00 2021 From: report at bugs.python.org (R. David Murray) Date: Sat, 24 Jul 2021 01:08:00 +0000 Subject: [issue44685] Email package issue with Outlook msg files In-Reply-To: <1626796935.18.0.522723051399.issue44685@roundup.psfhosted.org> Message-ID: <1627088880.49.0.987075228993.issue44685@roundup.psfhosted.org> R. David Murray added the comment: That file appears to be a binary file? By itself it isn't enough to reproduce the problem. Can you provide a complete script as well as the email message you are parsing that demonstrates the problem? By "looks like any other eml file", are you including the MIME headers associated with the part? Because it is the MIME headers that contain the information you say is missing. Mostly likely, outlook is not supplying that information for these transformed eml files. If you can supply a copy of the actual email message you are parsing, we should be able to confirm that. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 21:18:24 2021 From: report at bugs.python.org (creative-resort) Date: Sat, 24 Jul 2021 01:18:24 +0000 Subject: [issue44722] RFC: string Multiline Formatter In-Reply-To: <1627029304.73.0.520646474457.issue44722@roundup.psfhosted.org> Message-ID: <1627089504.68.0.513913761444.issue44722@roundup.psfhosted.org> creative-resort added the comment: Thank you for your kind guidance :) ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 21:36:43 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 24 Jul 2021 01:36:43 +0000 Subject: [issue42357] Wrong Availability for signal.SIGCHLD In-Reply-To: <1605368197.47.0.575674573541.issue42357@roundup.psfhosted.org> Message-ID: <1627090603.02.0.730737403428.issue42357@roundup.psfhosted.org> Andrei Kulakov added the comment: This can be closed (fixed). ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 21:54:14 2021 From: report at bugs.python.org (Zachary Ware) Date: Sat, 24 Jul 2021 01:54:14 +0000 Subject: [issue42357] Wrong Availability for signal.SIGCHLD In-Reply-To: <1605368197.47.0.575674573541.issue42357@roundup.psfhosted.org> Message-ID: <1627091654.85.0.0904620359264.issue42357@roundup.psfhosted.org> Zachary Ware added the comment: You are correct, thanks for the ping Andrei. And thank you for the patch, Maiyun! ---------- nosy: +zach.ware resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 22:14:24 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 24 Jul 2021 02:14:24 +0000 Subject: [issue44720] Finding string in iteratively deleted object cause segfault In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627092864.97.0.45460762631.issue44720@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch nosy: +Dennis Sweeney nosy_count: 1.0 -> 2.0 pull_requests: +25862 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27316 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 22:21:45 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 24 Jul 2021 02:21:45 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627093305.87.0.77769946317.issue44720@roundup.psfhosted.org> Dennis Sweeney added the comment: Here's a simpler reproducer: not_an_iterator = lambda: 0 class A: def __iter__(self): return weakref.proxy(not_an_iterator) a = A() list(a) I opened a PR. ---------- title: Finding string in iteratively deleted object cause segfault -> Weakref proxy crashes on null tp_iternext slot. _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 22:30:41 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 24 Jul 2021 02:30:41 +0000 Subject: [issue44719] Incorrect callable object crashes Python 3.11.0a0 In-Reply-To: <1627014429.86.0.790861111444.issue44719@roundup.psfhosted.org> Message-ID: <1627093841.39.0.52394762197.issue44719@roundup.psfhosted.org> Dennis Sweeney added the comment: I think GH-27313 will fix this ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 23 23:04:59 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sat, 24 Jul 2021 03:04:59 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1627074850.06.0.736470553633.issue44693@roundup.psfhosted.org> Message-ID: <20210724030143.GB3540@ando.pearwood.info> Steven D'Aprano added the comment: What exactly is a "pseudo-module"? I can only imagine it is something like sys, which exists internally in the interpreter but doesn't have an independent existence as a .py .dll or .so file. That's not the case with `__future__`, which is an *actual* module. I think that talking about "pseudo-module" is inaccurate and confusing and I suggest we ought to drop it. The real difference is (as I understand it) is that the **syntax** from __future__ import is not an actual import, it doesn't go through the import system, it doesn't touch the `__future__` module, and it can only appear in restricted positions. (It is legal in the interactive interpreter, and as the very first executable line of code in a .py file. So after the docstring, but before any code.) So the current docs are misleading. It's not `__future__` that is special. That is a real module. It is the syntactic form that is special. It's not a pseudo-*module* but a pseudo-*import*. With a little bit of jiggery-pokery we can even get the "from ... import ..." version working: >>> from __future__ import nested_scopes as nested_scopes >>> nested_scopes _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), 16) (Only tested in the interactive interpreter, but I presume it will also work in a .py file.) So: 1. `__future__` is a real, not "pseudo", module. 2. We can import from the module like any other module. 3. It is the *syntax* `from __future__ import ` that is special, not the module. 4. It behaves as a compiler directive, not an import. Let's fix the docs to describe what actually happens and drop any reference to "pseudo-module". It is needlessly confusing and inaccurate. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 00:12:34 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 04:12:34 +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: <1627099954.71.0.632943916778.issue38291@roundup.psfhosted.org> Change by Ken Jin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 01:47:56 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Jul 2021 05:47:56 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627105676.61.0.114360918428.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: I agree with Steven's more careful analysis and with canning 'pseudo'. Current suggestion. A *future statement*, "from __future__ import *feature* ...", directs the compiler to compile the current module using syntax or semantics that will become standard in a future release of Python. The *__future__ module* documents the possible values of *feature*. Cross reference *future statement to and *__future__ module* to its doc chapter. The first sentence above is based on the first sentence of the future statement doc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 02:45:59 2021 From: report at bugs.python.org (Gianni Mariani) Date: Sat, 24 Jul 2021 06:45:59 +0000 Subject: [issue44674] dataclasses should allow frozendict default value In-Reply-To: <1626703592.29.0.0154308260517.issue44674@roundup.psfhosted.org> Message-ID: <1627109159.36.0.509582449495.issue44674@roundup.psfhosted.org> Gianni Mariani added the comment: @Arjun - this is about default values (See the bug description - Using a frozendict as a default value) Try this: from frozendict import frozendict from dataclasses import dataclass @dataclass class A: a: frozendict = frozendict(a=1) This used to work until frozendict became a subclass of dict. Perhaps another fix is to convert any dict to a frozendict? Maybe not. How would you handle this case? The only thing I figured was: from frozendict import frozendict, field from dataclasses import dataclass AD=frozendict(a=1) @dataclass class A: a: frozendict = field(default_factory=lambda:AD) Which imho is cumbersome. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:04:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 07:04:29 +0000 Subject: [issue44731] Simplify implementation of the union type Message-ID: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR simplifies implementation of the union type by removing direct support of typing types. It was not necessary because all these types implement __or__ and __ror__ methods. The only visible difference is that int | TypeVar() etc returns now typing.Union instead of types.Union. But TypeVar() | int already returns typing.Union. ---------- components: Interpreter Core messages: 398119 nosy: gvanrossum, kj, serhiy.storchaka, uriyyo priority: normal severity: normal status: open title: Simplify implementation of the union type type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:07:50 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 07:07:50 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627110470.92.0.066897889702.issue44731@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +25863 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27318 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:12:08 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 07:12:08 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627110728.33.0.590499092731.issue44353@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25864 pull_request: https://github.com/python/cpython/pull/9951 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:40:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 07:40:16 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627112416.1.0.6446297985.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e89ef0ad2a299770a88ece8f7a316f7d3eb65c9f by Serhiy Storchaka in branch 'main': bpo-44353: Expand NewType tests for complex __qualname__. (#27311) https://github.com/python/cpython/commit/e89ef0ad2a299770a88ece8f7a316f7d3eb65c9f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:46:08 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 07:46:08 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627112768.89.0.484350497426.issue44353@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25865 pull_request: https://github.com/python/cpython/pull/27319 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 03:52:25 2021 From: report at bugs.python.org (hai shi) Date: Sat, 24 Jul 2021 07:52:25 +0000 Subject: [issue43145] Leak of locks from multiprocessing.Process In-Reply-To: <1612616557.31.0.756365409942.issue43145@roundup.psfhosted.org> Message-ID: <1627113145.73.0.259168773847.issue43145@roundup.psfhosted.org> hai shi added the comment: > The following locks are leaked: > 1. https://github.com/python/cpython/blob/196d4deaf4810a0bba75ba537dd40f2d71a5a634/Python/pystate.c#L78 > 2. https://github.com/python/cpython/blob/196d4deaf4810a0bba75ba537dd40f2d71a5a634/Python/pystate.c#L84 > 3. https://github.com/python/cpython/blob/196d4deaf4810a0bba75ba537dd40f2d71a5a634/Python/pystate.c#L90 > 4. https://github.com/python/cpython/blob/master/Python/ceval.c#L810 > 5. https://github.com/python/cpython/blob/master/Python/import.c#L126 > 6. and 7. https://github.com/python/cpython/blob/master/Modules/_threadmodule.c#L597 Hi, Boris. Thanks for your report. We may receive the wrong alarm sometimes when we use valgrind. 1. https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Python/pystate.c#L78 free in here: https://github.com/python/cpython/blob/196d4deaf4810a0bba75ba537dd40f2d71a5a634/Python/pystate.c#L127 2. https://github.com/python/cpython/blob/main/Python/ceval.c#L741 free in here: https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Python/pystate.c#L375 3. https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Python/import.c#L124 4. free in here: https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Python/import.c#L156 5. https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Modules/_threadmodule.c#L613 free in here: https://github.com/python/cpython/blob/4512848ab92c8ed6aafb54d6e1908b1074558c43/Modules/_threadmodule.c#L74 To tihs refleak, I can't get the entire traceback of newobject. But I haven't get refleak when I run `./python -m test _test_multiprocessing -R 3:3 -vv`. ---------- nosy: +shihai1991 versions: +Python 3.11 -Python 3.10, Python 3.9 Added file: https://bugs.python.org/file50177/valgrind output.txt _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 04:36:54 2021 From: report at bugs.python.org (Steven Hsu) Date: Sat, 24 Jul 2021 08:36:54 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627115814.38.0.422843973662.issue44693@roundup.psfhosted.org> Steven Hsu added the comment: Applying above suggestions, the first sentence of the entry "__future__" would be replaced by: A :ref:`future statement `, "from __future__ import *feature* ...", directs the compiler to compile the current module using syntax or semantics that will become standard in a future release of Python. The :mod:`__future__` module documents the possible values of *feature*. And the confusing sentence, "A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter." would be removed. Can I fix this issue this way? If confirmed, I would make a PR for this issue. -- :ref:`future` -> https://docs.python.org/3.9/reference/simple_stmts.html#future-statements :mod:`__future__` -> https://docs.python.org/3.9/library/__future__.html#module-__future__ ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 04:53:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 08:53:53 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627116833.34.0.909606824957.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7aac3f623610cf3dffbf548a5be5bfd4fa6790a0 by Ken Jin in branch 'main': bpo-44353: Document that typing.NewType is now a class (#27319) https://github.com/python/cpython/commit/7aac3f623610cf3dffbf548a5be5bfd4fa6790a0 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 04:59:02 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 08:59:02 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627117142.32.0.203528803395.issue44353@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25866 pull_request: https://github.com/python/cpython/pull/27321 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:08:28 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 09:08:28 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627117708.28.0.491101212792.issue44731@roundup.psfhosted.org> Serhiy Storchaka added the comment: It fixes also issue44642. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:12:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 09:12:29 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627117949.01.0.223966326744.issue44676@roundup.psfhosted.org> Serhiy Storchaka added the comment: It is not good to use private method in pickle, because we will not be able to get rid of it for backward compatibility. Why not use functools.reduce()? ---------- nosy: +serhiy.storchaka status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:14:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:14:11 +0000 Subject: [issue44611] CPython uses deprecated randomness API In-Reply-To: <1626110193.36.0.138157170892.issue44611@roundup.psfhosted.org> Message-ID: <1627118051.67.0.901097451948.issue44611@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4463fa2fa111e03f7ec47e6e9d433104aa943605 by Dong-hee Na in branch 'main': bpo-44611: Update docs for os and whatsnew 3.11 (#27314) https://github.com/python/cpython/commit/4463fa2fa111e03f7ec47e6e9d433104aa943605 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:15:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 09:15:20 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627118120.79.0.296878859349.issue44676@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- pull_requests: +25867 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27323 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:17:28 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 09:17:28 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627118248.47.0.109432790876.issue44720@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25868 pull_request: https://github.com/python/cpython/pull/27324 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:17:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:17:23 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627118243.59.0.029238938933.issue44720@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5370f0a82aaa4ba617070d5c71d2b18236096ac0 by Dennis Sweeney in branch 'main': bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) https://github.com/python/cpython/commit/5370f0a82aaa4ba617070d5c71d2b18236096ac0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:17:33 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 09:17:33 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627118253.45.0.752884282288.issue44720@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25869 pull_request: https://github.com/python/cpython/pull/27325 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:24:20 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 09:24:20 +0000 Subject: [issue44732] Rename types.Union to types.UnionType Message-ID: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> New submission from Serhiy Storchaka : There are differences between typing.Union and types.Union: * typing.Union is indexable, types.Union is not. * types.Union is a class, typing.Union is not. types.Union corresponds to typing._UnionGenericAlias, not typing.Union. It is confusing that typing.Union and types.Union have the same name. Note also that most classes in the types module have the "Type" suffix: FunctionType, MethodType, ModuleType, etc. I think that it would be better to rename types.Union to types.UnionType. ---------- components: Interpreter Core messages: 398128 nosy: gvanrossum, kj, pablogsal, serhiy.storchaka priority: normal severity: normal status: open title: Rename types.Union to types.UnionType versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:31:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:31:38 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627119098.64.0.511416110432.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d15949a845a6db66675bca7105ad508ba9e79639 by Miss Islington (bot) in branch '3.10': bpo-44353: Document that typing.NewType is now a class (GH-27319) (GH-27321) https://github.com/python/cpython/commit/d15949a845a6db66675bca7105ad508ba9e79639 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:33:46 2021 From: report at bugs.python.org (Hasan) Date: Sat, 24 Jul 2021 09:33:46 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627119226.23.0.469879202881.issue44732@roundup.psfhosted.org> Hasan added the comment: If nobody works on it i would like to fix it ---------- nosy: +AliyevH _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:45:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:45:17 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627119917.15.0.225511530369.issue44720@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 659030c7d56a329c1aa559678f2df15e306215e4 by Miss Islington (bot) in branch '3.10': bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) (GH-27324) https://github.com/python/cpython/commit/659030c7d56a329c1aa559678f2df15e306215e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:45:43 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:45:43 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627119943.65.0.105660246336.issue44720@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0a08f22184aef6e36bb8bb7ad84207e47594f46e by Miss Islington (bot) in branch '3.9': bpo-44720: Don't crash when calling weakref.proxy(not_an_iterator).__next__ (GH-27316) (#27325) https://github.com/python/cpython/commit/0a08f22184aef6e36bb8bb7ad84207e47594f46e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:46:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:46:50 +0000 Subject: [issue44720] Weakref proxy crashes on null tp_iternext slot. In-Reply-To: <1627016741.96.0.306120219144.issue44720@roundup.psfhosted.org> Message-ID: <1627120010.17.0.0647728588463.issue44720@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks for your quick pull request, Dennis! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:48:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:48:59 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627120139.33.0.831588640716.issue44353@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- pull_requests: +25870 pull_request: https://github.com/python/cpython/pull/27326 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:50:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:50:22 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627120222.18.0.125701822269.issue44717@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8072a1181dd64135f700b44372fbf7bf91e68072 by Filipe La?ns in branch 'main': bpo-44717: improve AttributeError on circular imports of submodules (GH-27299) https://github.com/python/cpython/commit/8072a1181dd64135f700b44372fbf7bf91e68072 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:51:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:51:07 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627120267.57.0.954578454941.issue44717@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks a lot for your report and patch, Filipe! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:53:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:53:44 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627120424.39.0.203947740471.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a22b05da87bdfb081d6aaecfce136ae8dbb8680c by Yurii Karabas in branch 'main': bpo-44353: Improve tests covering typing.NewType pickling (GH-27302) https://github.com/python/cpython/commit/a22b05da87bdfb081d6aaecfce136ae8dbb8680c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 05:59:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 09:59:26 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1627120766.46.0.619946922888.issue44713@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 45caee27159aa89b8dbcfde0c5faedea5f965584 by Miss Islington (bot) in branch '3.10': bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) (GH-27298) https://github.com/python/cpython/commit/45caee27159aa89b8dbcfde0c5faedea5f965584 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 06:00:28 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 10:00:28 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1627120828.54.0.123371686405.issue44713@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25871 pull_request: https://github.com/python/cpython/pull/27327 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 06:08:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 10:08:00 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627121280.15.0.0779953510197.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 05f5d8e48c86c8025d3f82285666d93e52e360f9 by ?ukasz Langa in branch '3.10': [3.10] bpo-44353: Expand NewType tests for complex __qualname__ (GH-27311) (GH-27326) https://github.com/python/cpython/commit/05f5d8e48c86c8025d3f82285666d93e52e360f9 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 06:08:25 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 10:08:25 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627121305.39.0.490215010861.issue44353@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25872 pull_request: https://github.com/python/cpython/pull/27328 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 06:29:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 10:29:22 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627122562.93.0.197255752461.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e8c01749c02a97a2f5b01086951bb564121c5113 by Miss Islington (bot) in branch '3.10': bpo-44353: Improve tests covering typing.NewType pickling (GH-27302) (GH-27328) https://github.com/python/cpython/commit/e8c01749c02a97a2f5b01086951bb564121c5113 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 06:30:28 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 10:30:28 +0000 Subject: [issue44713] subprocess.rst typo ``"shell=True"`` => ``shell=True`` In-Reply-To: <1626991641.24.0.753017266969.issue44713@roundup.psfhosted.org> Message-ID: <1627122628.88.0.0907067919533.issue44713@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5d9c86e340b40379d18ffeb7ce1739e07bdeb536 by Miss Islington (bot) in branch '3.9': bpo-44713: [doc fix]: typo in subprocess.rst (GH-27297) (#27327) https://github.com/python/cpython/commit/5d9c86e340b40379d18ffeb7ce1739e07bdeb536 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 07:12:05 2021 From: report at bugs.python.org (Misha Drachuk) Date: Sat, 24 Jul 2021 11:12:05 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1627125125.23.0.253494522314.issue36643@roundup.psfhosted.org> Change by Misha Drachuk : ---------- keywords: +patch pull_requests: +25873 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27330 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 07:14:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Jul 2021 11:14:09 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1627125249.72.0.152224270428.issue36643@roundup.psfhosted.org> Eric V. Smith added the comment: I?m deferring any action on this until PEP 649 is ruled on. ---------- assignee: -> eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 07:41:27 2021 From: report at bugs.python.org (Eric V. Smith) Date: Sat, 24 Jul 2021 11:41:27 +0000 Subject: [issue36643] Forward reference is not resolved by dataclasses.fields() In-Reply-To: <1555443878.01.0.308772794144.issue36643@roundup.psfhosted.org> Message-ID: <1627126887.28.0.48882074502.issue36643@roundup.psfhosted.org> Eric V. Smith added the comment: Also, when dataclasses was originally written, it deliberately did not import typing, for performance reasons. I don't know if PEP 560 (I think) improved performance enough to make a difference. But adding this dependency needs to be looked at. But if we are going to import typing, there are other changes that I'd like to make, like improving the ClassVar stuff. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 08:09:28 2021 From: report at bugs.python.org (Vitas Ivanoff) Date: Sat, 24 Jul 2021 12:09:28 +0000 Subject: [issue44694] Message from BytesParser cannot be flattened immediately In-Reply-To: <1626865587.67.0.966185604714.issue44694@roundup.psfhosted.org> Message-ID: <1627128568.27.0.490103197459.issue44694@roundup.psfhosted.org> Change by Vitas Ivanoff : Added file: https://bugs.python.org/file50178/0.msg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 08:14:41 2021 From: report at bugs.python.org (Ram Rachum) Date: Sat, 24 Jul 2021 12:14:41 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor Message-ID: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> New submission from Ram Rachum : I love `concurrent.futures`, and I'd like to use it wherever I can. There's a feature in `multiprocessing.Pool` that I wish would also be available in `ProcessPoolExecutor`: The `maxtasksperchild` argument. Documentation: "maxtasksperchild is the number of tasks a worker process can complete before it will exit and be replaced with a fresh worker process, to enable unused resources to be freed. The default maxtasksperchild is None, which means worker processes will live as long as the pool." I want to be able to set it to 1, so each process will only execute one task and then be replaced with a fresh process. ---------- components: Library (Lib) messages: 398143 nosy: cool-RR, pitrou priority: normal severity: normal status: open title: Feature request: maxtasksperchild for ProcessPoolExecutor type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 08:50:35 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 12:50:35 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627131035.92.0.0172129000404.issue43950@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset c8362314cce53a5b59da7523fbdfa00f122aa319 by Batuhan Taskaya in branch 'main': bpo-43950: ensure source_line is present when specialising the traceback (GH-27313) https://github.com/python/cpython/commit/c8362314cce53a5b59da7523fbdfa00f122aa319 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 08:54:38 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 12:54:38 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627131278.7.0.638991174766.issue44600@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The release candidate is soon, so I would recommend to land a fix as soon as possible so it can be tested for some time before is released, if that is possible. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 08:58:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 12:58:48 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627131528.44.0.188785585404.issue44717@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: There is a buildbot failure after merging this PR: https://buildbot.python.org/all/#/builders/464/builds/574 If is not fixed in 24 we will need to revert per our buildbot policy ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:01:06 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:01:06 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627131666.39.0.217700779904.issue44353@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The buildbots are still not green. Unfortunately we will need to revert all PRs if this is not fixed soon as this is already making other issues ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:05:20 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 13:05:20 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627131920.81.0.93752802379.issue44353@roundup.psfhosted.org> Ken Jin added the comment: @Pablo, I don't think this change is causing the buildbots to fail. The test failure on all the currently failing buildbots is: ====================================================================== ERROR: test_absolute_circular_submodule (test.test_import.CircularImportTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.installed/build/target/lib/python3.11/test/test_import/__init__.py", line 1355, in test_absolute_circular_submodule import test.test_import.data.circular_imports.subpkg2.parent ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'test.test_import.data.circular_imports.subpkg2' ---------------------------------------------------------------------- Which seems to be GH-27299. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:11:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:11:17 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627132277.87.0.127270206509.issue44353@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Pick any of the failing refleak buildbots. For example: https://buildbot.python.org/all/#/builders/280/builds/99 You will see: ---------------------------------------------------------------------- Ran 106 tests in 0.074s OK ...... test_types leaked [2, 2, 2] references, sum=6 test_types leaked [1, 1, 1] memory blocks, sum=3 1 test failed again: test_types ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:12:43 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:12:43 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627132363.98.0.692257822669.issue44717@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25874 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27331 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:13:12 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Sat, 24 Jul 2021 13:13:12 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627132392.56.0.837476783334.issue44353@roundup.psfhosted.org> ?ukasz Langa added the comment: types is not typing. This is a different failure from what we've seen before. I'll fix that today. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:17:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:17:32 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627132652.26.0.809992752112.issue44353@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Bisecting points to: fe13f0b0f696464dd6f283576668dbf57cb11399 is the first bad commit commit fe13f0b0f696464dd6f283576668dbf57cb11399 Author: Yurii Karabas <1998uriyyo at gmail.com> Date: Fri Jul 23 12:47:00 2021 +0300 bpo-44676: Add ability to serialize types.Union (GH-27244) Lib/test/test_types.py | 35 +++++++++++++++ Lib/typing.py | 4 +- .../2021-07-19-19-53-46.bpo-44676.WgIMvh.rst | 2 + Objects/unionobject.c | 51 ++++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-07-19-19-53-46.bpo-44676.WgIMvh.rst bisect run success ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:17:52 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:17:52 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627132672.38.0.814508799378.issue44353@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I am closing this one again, apologies for the confusion. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:18:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:18:25 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627132705.52.0.421059378771.issue44676@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This PR has introduced reference leaks. Bisecting points to: fe13f0b0f696464dd6f283576668dbf57cb11399 is the first bad commit commit fe13f0b0f696464dd6f283576668dbf57cb11399 Author: Yurii Karabas <1998uriyyo at gmail.com> Date: Fri Jul 23 12:47:00 2021 +0300 bpo-44676: Add ability to serialize types.Union (GH-27244) Lib/test/test_types.py | 35 +++++++++++++++ Lib/typing.py | 4 +- .../2021-07-19-19-53-46.bpo-44676.WgIMvh.rst | 2 + Objects/unionobject.c | 51 ++++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-07-19-19-53-46.bpo-44676.WgIMvh.rst bisect run successfe13f0b0f696464dd6f283576668dbf57cb11399 is the first bad commit commit fe13f0b0f696464dd6f283576668dbf57cb11399 Author: Yurii Karabas <1998uriyyo at gmail.com> Date: Fri Jul 23 12:47:00 2021 +0300 bpo-44676: Add ability to serialize types.Union (GH-27244) Lib/test/test_types.py | 35 +++++++++++++++ Lib/typing.py | 4 +- .../2021-07-19-19-53-46.bpo-44676.WgIMvh.rst | 2 + Objects/unionobject.c | 51 ++++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-07-19-19-53-46.bpo-44676.WgIMvh.rst bisect run success Example failure: https://buildbot.python.org/all/#/builders/259/builds/100 Ran 106 tests in 0.053s OK ...... test_types leaked [2, 2, 2] references, sum=6 test_types leaked [1, 1, 1] memory blocks, sum=3 1 test failed again: test_types == Tests result: FAILURE then FAILURE == 413 tests OK. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:25:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:25:21 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627133121.67.0.492388219487.issue44676@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25875 pull_request: https://github.com/python/cpython/pull/27332 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:33:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:33:12 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627133592.41.0.659002858906.issue44717@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 3eae8f20d7b6f88d3618b0afc94893165a914022 by Pablo Galindo Salgado in branch 'main': Revert "bpo-44717: improve AttributeError on circular imports of submodules (GH-27299)" (GH-27331) https://github.com/python/cpython/commit/3eae8f20d7b6f88d3618b0afc94893165a914022 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:34:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:34:56 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627133696.54.0.824636535023.issue44731@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 08284231275ac9cc60ae27eab2338805919d8881 by Serhiy Storchaka in branch 'main': bpo-44731: Simplify the union type implementation (GH-27318) https://github.com/python/cpython/commit/08284231275ac9cc60ae27eab2338805919d8881 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:37:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:37:37 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627133857.09.0.481315687147.issue44600@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- priority: normal -> release blocker _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 09:50:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 13:50:30 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627134630.75.0.350632189623.issue44676@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25876 pull_request: https://github.com/python/cpython/pull/27333 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:08:56 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 14:08:56 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627135736.62.0.761087087521.issue44676@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 9356d1e47de583fd794e9d29abc448759f7a4109 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-44676: Add ability to serialize types.Union (GH-27244) (GH-27333) https://github.com/python/cpython/commit/9356d1e47de583fd794e9d29abc448759f7a4109 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:11:03 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 24 Jul 2021 14:11:03 +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: <1627135863.6.0.471463037625.issue43944@roundup.psfhosted.org> Jack DeVries added the comment: I am working on a fix for this bug. I'm a beginner cpython contributor, so if anyone recognizes this as a fool's errand, please let me know! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:17:35 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 14:17:35 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627136255.06.0.987623495648.issue44731@roundup.psfhosted.org> Change by Ken Jin : ---------- pull_requests: +25877 pull_request: https://github.com/python/cpython/pull/27334 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:26:03 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 14:26:03 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627136763.7.0.126177550813.issue44676@roundup.psfhosted.org> miss-islington added the comment: New changeset 8158e059e9952f08d19a18d3e9e021cee2393cd2 by Pablo Galindo Salgado in branch 'main': bpo-44676: Fix reference leaks in union_reduce (GH-27332) https://github.com/python/cpython/commit/8158e059e9952f08d19a18d3e9e021cee2393cd2 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:30:25 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 24 Jul 2021 14:30:25 +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: <1627137025.82.0.551904349877.issue43944@roundup.psfhosted.org> Jack DeVries added the comment: Ah never mind. @Genarito, the ThreadPoolExecutor is supposed to be used as a context manager. In your current code, the script ends and Python starts tearing itself down while `execute_error` is still running in a subprocess. If you simply use the ThreadPoolExecutor to a context manager, the error goes away:: ```python from multiprocessing import Process from concurrent.futures import ThreadPoolExecutor def some_task(): pass def execute_error(): p = Process(target=some_task) p.start() p.join() print(p.exitcode) # This is always 1 on a ThreadPoolExecutor!!! # THIS IS THE IMPORTANT CHANGE with ThreadPoolExecutor(max_workers=4) as executor: executor.submit(execute_error) ``` ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:49:32 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 14:49:32 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627138172.22.0.963482233723.issue44731@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ca5a4cf8266cf789eae379fe224458e94dd41b30 by Ken Jin in branch '3.10': bpo-44731: Simplify the union type implementation (GH-27318) (GH-27334) https://github.com/python/cpython/commit/ca5a4cf8266cf789eae379fe224458e94dd41b30 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 10:50:23 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 14:50:23 +0000 Subject: [issue44731] Simplify implementation of the union type In-Reply-To: <1627110269.61.0.426966849087.issue44731@roundup.psfhosted.org> Message-ID: <1627138223.55.0.163583510016.issue44731@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 Jul 24 11:06:39 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 15:06:39 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1627139199.36.0.368617712484.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: Extract from the log - from the configure output: > checking for expm1... yes and from the test output > expm10118: expm1(27.0): expected 532048240600.79865, got 532048240600.7976 (error = 0.00104 (17 ulps); permitted error = 0 or 5 ulps) > expm10119: expm1(123.0): expected 2.6195173187490626e+53, got 2.619517318749054e+53 (error = 8.51e+38 (20 ulps); permitted error = 0 or 5 ulps) > expm10300: expm1(300.0): expected 1.9424263952412558e+130, got 1.942426395241274e+130 (error = 1.82e+116 (74 ulps); permitted error = 0 or 5 ulps) > expm10301: expm1(700.0): expected 1.0142320547350045e+304, got 1.0142320547349733e+304 (error = 3.12e+290 (256 ulps); permitted error = 0 or 5 ulps) > expm10307: expm1(709.5): expected 1.3549863193146328e+308, got 1.354986319314675e+308 (error = 4.21e+294 (211 ulps); permitted error = 0 or 5 ulps) The first part indicates that your math library does provide expm1, so Python goes ahead and uses it. The errors from test_math show that the expm1 implementation provided by your math library has accuracy problems for large inputs. From the other failures, I suspect that the underlying issue is actually an issue with exp (but our tests for exp are not so thorough as those for expm1). In short, the tests represent issues with the underlying C math library. What OS is this, and who supplies the libm? ---------- nosy: +mark.dickinson _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 11:14:09 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 15:14:09 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1627139649.73.0.381301863222.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: The test_posix failure appears to be unrelated; I'll let others look into that one. The test_turtle failure looks again like a libm issue, perhaps combined with an overeager test: we're expecting a `** 0.5` operation (which translates to a libm pow call) to give exact results when the square root is exactly representable. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 11:25:56 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 24 Jul 2021 15:25:56 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627140356.14.0.787025823004.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: Yup, I plan on having it in this weekend. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 11:29:29 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 15:29:29 +0000 Subject: [issue44353] PEP 604 NewType In-Reply-To: <1623183708.45.0.801079090844.issue44353@roundup.psfhosted.org> Message-ID: <1627140569.61.0.906403818761.issue44353@roundup.psfhosted.org> Ken Jin added the comment: Thanks a bunch Yurii, Serhiy, Jelle, ?ukasz and Pablo for working on this! I'm re-closing this issue. *Fingers-crossed* we won't have to open this again ;-). ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 11:48:42 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 24 Jul 2021 15:48:42 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627141722.86.0.412767473265.issue44676@roundup.psfhosted.org> Change by Ken Jin : ---------- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +25878 pull_request: https://github.com/python/cpython/pull/27335 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 12:03:52 2021 From: report at bugs.python.org (Vishvas Vasuki) Date: Sat, 24 Jul 2021 16:03:52 +0000 Subject: [issue12737] str.title() is overzealous by upcasing combining marks inappropriately In-Reply-To: <1313102254.23.0.17412568785.issue12737@psf.upfronthosting.co.za> Message-ID: <1627142632.84.0.744349625126.issue12737@roundup.psfhosted.org> Vishvas Vasuki added the comment: This case still fails with 3.9 - 'Tr?t?y?'.title() ---------- nosy: +vishvas.vasuki _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 12:46:47 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 16:46:47 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict Message-ID: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> New submission from Mark Dickinson : >From the tests for Vec2D.__abs__ in the turtle module we have: def test_distance(self): vec = Vec2D(6, 8) expected = 10 self.assertEqual(abs(vec), expected) vec = Vec2D(0, 0) expected = 0 self.assertEqual(abs(vec), expected) vec = Vec2D(2.5, 6) expected = 6.5 self.assertEqual(abs(vec), expected) GitHub link: https://github.com/python/cpython/blob/8158e059e9952f08d19a18d3e9e021cee2393cd2/Lib/test/test_turtle.py#L237-L248 The first test was reported as failing in issue #44728, with error: ====================================================================== FAIL: test_distance (test.test_turtle.TestVec2D) ---------------------------------------------------------------------- Traceback (most recent call last): File "/build/python/src/Python-3.9.6/Lib/test/test_turtle.py", line 237, in test_distance self.assertEqual(abs(vec), expected) AssertionError: 9.999999999999998 != 10 The first and last test should use assertAlmostEqual with a suitable tolerance (the default tolerance is probably fine). ---------- messages: 398166 nosy: mark.dickinson priority: normal severity: normal status: open title: turtle: tests for Vec2D.__abs__ are too strict _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 12:47:06 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 16:47:06 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627145226.02.0.501189669952.issue44734@roundup.psfhosted.org> Change by Mark Dickinson : ---------- type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 12:47:41 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 16:47:41 +0000 Subject: [issue44728] Testsuite fails on x86_64 In-Reply-To: <1627062901.76.0.984645302952.issue44728@roundup.psfhosted.org> Message-ID: <1627145261.66.0.808081085044.issue44728@roundup.psfhosted.org> Mark Dickinson added the comment: Looks like the turtle code was changed to use `math.hypot` instead of `** 0.5` in issue #41528. That will likely also fix the test failure, but I've opened #44734 to fix the unnecessarily strict test. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 12:49:25 2021 From: report at bugs.python.org (Mark Dickinson) Date: Sat, 24 Jul 2021 16:49:25 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627145365.01.0.968481965425.issue44734@roundup.psfhosted.org> Change by Mark Dickinson : ---------- keywords: +easy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:04:36 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Jul 2021 17:04:36 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627146276.53.0.831583951111.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: Yes, ask me to review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:18:08 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 17:18:08 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627147088.57.0.134213375759.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25879 pull_request: https://github.com/python/cpython/pull/27336 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:18:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 17:18:07 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627147087.84.0.286741059734.issue44676@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- components: +Interpreter Core, Library (Lib) versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:20:04 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 17:20:04 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627147204.52.0.179862019244.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25880 pull_request: https://github.com/python/cpython/pull/27337 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:49:35 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 17:49:35 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627148975.86.0.138234157845.issue43950@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset ef8b8535cb3cd705392af9b927d6ff336d98427d by Batuhan Taskaya in branch 'main': bpo-43950: check against the raw string, not the pyobject (GH-27337) https://github.com/python/cpython/commit/ef8b8535cb3cd705392af9b927d6ff336d98427d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 13:50:43 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 17:50:43 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627149043.54.0.875288594844.issue43950@roundup.psfhosted.org> Batuhan Taskaya added the comment: New changeset 4f5980a4f57dab68b9137304f58bd08891d43d5a by Batuhan Taskaya in branch 'main': bpo-43950: support long lines in traceback.py (GH-27336) https://github.com/python/cpython/commit/4f5980a4f57dab68b9137304f58bd08891d43d5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:22:52 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 24 Jul 2021 18:22:52 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627150972.64.0.299147561171.issue44717@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +25881 pull_request: https://github.com/python/cpython/pull/27338 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:25:25 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 18:25:25 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627151125.45.0.446886758833.issue43950@roundup.psfhosted.org> Change by Batuhan Taskaya : ---------- pull_requests: +25882 pull_request: https://github.com/python/cpython/pull/27339 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:26:06 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 18:26:06 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627151166.31.0.515130718435.issue44676@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 435a0334d341e5f8faed594d9f015746bb7845db by Serhiy Storchaka in branch 'main': bpo-44676: Serialize the union type using only public API (GH-27323) https://github.com/python/cpython/commit/435a0334d341e5f8faed594d9f015746bb7845db ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:26:34 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 24 Jul 2021 18:26:34 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627151194.52.0.860673176625.issue44676@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25883 pull_request: https://github.com/python/cpython/pull/27340 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:28:59 2021 From: report at bugs.python.org (Batuhan Taskaya) Date: Sat, 24 Jul 2021 18:28:59 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627151339.15.0.352403899767.issue43950@roundup.psfhosted.org> Batuhan Taskaya added the comment: There is a subtle difference between traceback.py and Python/traceback.c which makes the latter (C version) output the line without trimming the trailing whitespace. The Python version simply uses `.strip()` which strips both the left (starting) and right (ending) side. I'd personally go with adapting the C version to use full strip, since it makes more sense but I am open to comments on this. Here is an example test (needs GH 27339 first) (func( call has 2 trailing whitespace characters); https://gist.github.com/isidentical/37ab1693d551b678a52626298d99e582 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 14:29:50 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 24 Jul 2021 18:29:50 +0000 Subject: [issue12737] str.title() is overzealous by upcasing combining marks inappropriately In-Reply-To: <1313102254.23.0.17412568785.issue12737@psf.upfronthosting.co.za> Message-ID: <1627151390.49.0.396409811458.issue12737@roundup.psfhosted.org> Terry J. Reedy added the comment: Which comes out 'Tr?T?y?'. The underdot '?' is '0x325' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 15:36:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 24 Jul 2021 19:36:07 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627155367.61.0.244207221582.issue44676@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset 0aea99e44416f37c75e5540072156dbf90ef1659 by Miss Islington (bot) in branch '3.10': bpo-44676: Serialize the union type using only public API (GH-27323) (GH-27340) https://github.com/python/cpython/commit/0aea99e44416f37c75e5540072156dbf90ef1659 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 17:55:55 2021 From: report at bugs.python.org (Genaro Camele) Date: Sat, 24 Jul 2021 21:55:55 +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: <1627163755.89.0.935373880681.issue43944@roundup.psfhosted.org> Genaro Camele added the comment: Hi @jack__d, thanks for your answer and time. Unfortunately, It's still a regression, as in Python < 3.9 my example works as expected ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 18:45:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 22:45:15 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627166715.95.0.25669767565.issue44717@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0a8ae8a50a0fea3d39ec49b220a5c7a5b70e36f8 by Filipe La?ns in branch 'main': bpo-44717: improve AttributeError on circular imports of submodules (GH-27338) https://github.com/python/cpython/commit/0a8ae8a50a0fea3d39ec49b220a5c7a5b70e36f8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 18:45:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 24 Jul 2021 22:45:30 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627166730.36.0.106198437007.issue44717@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 Jul 24 19:53:27 2021 From: report at bugs.python.org (Hasan) Date: Sat, 24 Jul 2021 23:53:27 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627170807.83.0.445016031212.issue44732@roundup.psfhosted.org> Change by Hasan : ---------- keywords: +patch pull_requests: +25884 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27342 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 20:22:31 2021 From: report at bugs.python.org (Logan Jones) Date: Sun, 25 Jul 2021 00:22:31 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627172551.68.0.903040253927.issue44734@roundup.psfhosted.org> Change by Logan Jones : ---------- keywords: +patch nosy: +loganasherjones nosy_count: 1.0 -> 2.0 pull_requests: +25885 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27343 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 20:49:13 2021 From: report at bugs.python.org (Hasan) Date: Sun, 25 Jul 2021 00:49:13 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627174153.99.0.592879031096.issue44732@roundup.psfhosted.org> Hasan added the comment: should have a deprecation period and if so, how long? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 21:27:23 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sun, 25 Jul 2021 01:27:23 +0000 Subject: [issue44717] Improve AttributeError on circular imports of submodules In-Reply-To: <1627001479.9.0.177247321024.issue44717@roundup.psfhosted.org> Message-ID: <1627176443.07.0.16693274068.issue44717@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +25886 pull_request: https://github.com/python/cpython/pull/27344 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 24 22:23:58 2021 From: report at bugs.python.org (Ken Jin) Date: Sun, 25 Jul 2021 02:23:58 +0000 Subject: [issue44676] Add ability to serialise types.Union In-Reply-To: <1626711613.61.0.665333814569.issue44676@roundup.psfhosted.org> Message-ID: <1627179838.26.0.229236045715.issue44676@roundup.psfhosted.org> Ken Jin added the comment: This is fixed. Thanks Yurii and Serhiy for the patches :) (and everyone else for the reviews too). ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 00:42:20 2021 From: report at bugs.python.org (Charles Burkland) Date: Sun, 25 Jul 2021 04:42:20 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627188140.82.0.0101864202696.issue44600@roundup.psfhosted.org> Change by Charles Burkland : ---------- keywords: +patch nosy: +chaburkland nosy_count: 6.0 -> 7.0 pull_requests: +25887 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27346 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 01:23:58 2021 From: report at bugs.python.org (adore_blvnk) Date: Sun, 25 Jul 2021 05:23:58 +0000 Subject: [issue44735] Failed venv Activation With "&" In Folder Name Message-ID: <1627190638.68.0.811624039795.issue44735@roundup.psfhosted.org> New submission from adore_blvnk : This is relating to activation of venvs. This was first discovered in VS Code, but can be replicated in Windows CMD & PyCharm too. Normally, creating a virtual environment via py -m venv venv would create the venv. Next would be the activation of the venv, example: "c:/Users/normal/venv/Scripts/activate.bat" This activates the venv, & using a pip command would install the respective packages in the "site-packages" folder in the venv. HOWEVER, creating a NEW folder "c:/Users/is & allowed", creating the venv, & attempting to activate it as follows: "c:/Users/is & allowed/venv/Scripts/activate.bat" Will throw an error: The system cannot find the path specified. Do note that in the 2nd attempt, the presence of character "&" will throw the error. ---------- components: Windows messages: 398179 nosy: adore_blvnk, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Failed venv Activation With "&" In Folder Name type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 04:50:24 2021 From: report at bugs.python.org (BAHADIR) Date: Sun, 25 Jul 2021 08:50:24 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. Message-ID: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> New submission from BAHADIR : While working on several examples I noticed that ASCII Horizontal Tab (TAB) gives different results for different values. When I looked at the rfc documents, I couldn't see any result about its calculation. The calculation method I noticed myself is as follows ((8 -(string from previous "\t"))%8) * a number of spaces(in python IDLE) result change in other IDE or editors. ---------- components: Parser messages: 398180 nosy: BAHADIR, lys.nikolaou, pablogsal priority: normal severity: normal status: open title: '\t' Escape Sequence behaving differently. type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 04:56:00 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 25 Jul 2021 08:56:00 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. In-Reply-To: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> Message-ID: <1627203360.41.0.018069320383.issue44736@roundup.psfhosted.org> Steven D'Aprano added the comment: I'm sorry, I don't understand what "different results for different values" you are talking about. Can you please copy and paste (not a screen shot) code demonstrating: - what code you ran - what result you expected - why you expected it - and what result you got instead. ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 04:58:18 2021 From: report at bugs.python.org (BAHADIR) Date: Sun, 25 Jul 2021 08:58:18 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. In-Reply-To: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> Message-ID: <1627203498.47.0.421133313237.issue44736@roundup.psfhosted.org> Change by BAHADIR : Added file: https://bugs.python.org/file50179/IDLE.jpeg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 05:03:19 2021 From: report at bugs.python.org (BAHADIR) Date: Sun, 25 Jul 2021 09:03:19 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. In-Reply-To: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> Message-ID: <1627203799.0.0.484504319495.issue44736@roundup.psfhosted.org> BAHADIR added the comment: >>> print("1\t1") 1 1 >>> print("12\t1") 12 1 >>> print("123\t1") 123 1 >>> print("1234\t1") 1234 1 >>> print("12345\t1") 12345 1 >>> print("123456\t1") 123456 1 >>> print("1234567\t1") 1234567 1 >>> print("12345678\t1") 12345678 1 >>> print("1","12","123","1234","12345","123456","1234567","12345678",sep="\t") 1 12 123 1234 12345 123456 1234567 12345678 space length is always changing ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 05:05:33 2021 From: report at bugs.python.org (BAHADIR) Date: Sun, 25 Jul 2021 09:05:33 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. In-Reply-To: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> Message-ID: <1627203933.17.0.426913971265.issue44736@roundup.psfhosted.org> Change by BAHADIR : Removed file: https://bugs.python.org/file50179/IDLE.jpeg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 05:23:32 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Sun, 25 Jul 2021 09:23:32 +0000 Subject: [issue44736] '\t' Escape Sequence behaving differently. In-Reply-To: <1627203024.75.0.177419132701.issue44736@roundup.psfhosted.org> Message-ID: <1627205012.49.0.918188090588.issue44736@roundup.psfhosted.org> Steven D'Aprano added the comment: That's not a Python issue, that's a feature of your terminal. That's how tabs are supposed to work. By default, most terminals set tab stops every 8 columns. Printing a tab character jumps to the next tab stop. If you are using Linux or Mac, you can use the `tabs` command in the terminal to control where the tab stops are. This is not a Python command, it is part of your OS shell. https://askubuntu.com/questions/63424/how-to-change-tab-width-in-terminal-in-ubuntu-10-04 https://superuser.com/questions/110421/tab-character-width-in-terminal I don't know about the Windows Terminal. It is possible it doesn't support changing the tab stops. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 05:27:11 2021 From: report at bugs.python.org (Nils Kattenbeck) Date: Sun, 25 Jul 2021 09:27:11 +0000 Subject: [issue13824] argparse.FileType opens a file and never closes it In-Reply-To: <1326975939.94.0.524131708506.issue13824@psf.upfronthosting.co.za> Message-ID: <1627205231.82.0.99401896181.issue13824@roundup.psfhosted.org> Nils Kattenbeck added the comment: A good alternative would be to use pathlib.Path. The only downside would be that one has to manually handle `-` but besides that it solves most problems. Still the fact that file descriptors are kept open should be added as a warning to the docs ---------- nosy: +Nils Kattenbeck _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 07:42:22 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 11:42:22 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627213342.01.0.166876813858.issue43184@roundup.psfhosted.org> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +25888 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27347 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 08:57:33 2021 From: report at bugs.python.org (Logan Jones) Date: Sun, 25 Jul 2021 12:57:33 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1627217853.87.0.778809943774.issue44733@roundup.psfhosted.org> Change by Logan Jones : ---------- nosy: +loganasherjones _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 09:46:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 25 Jul 2021 13:46:30 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627220790.15.0.75153123766.issue44732@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: This is a feature added to 3.10 so if we change it before the release there is no deprecation period needed. On the other hand if we don't get it to 3.10 is going to be much difficult to rename. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 11:53:32 2021 From: report at bugs.python.org (Dong-hee Na) Date: Sun, 25 Jul 2021 15:53:32 +0000 Subject: [issue44725] Expose specialization stats in python In-Reply-To: <1627049048.24.0.175321998203.issue44725@roundup.psfhosted.org> Message-ID: <1627228412.82.0.865300422806.issue44725@roundup.psfhosted.org> Change by Dong-hee Na : ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 12:35:34 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 16:35:34 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627230934.74.0.502140219927.issue44399@roundup.psfhosted.org> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +25889 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27348 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 12:36:38 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 16:36:38 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627230998.86.0.557274205902.issue43184@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 50b72768ffe6413424dc4eba916dd1ff89a2fe7b by Vinay Sajip in branch 'main': bpo-43184: Add information about added attribute and method. (GH-27347) https://github.com/python/cpython/commit/50b72768ffe6413424dc4eba916dd1ff89a2fe7b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 12:37:03 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 25 Jul 2021 16:37:03 +0000 Subject: [issue44605] functools.total_ordering doesn't work with metaclasses In-Reply-To: <1626067265.0.0.995880932731.issue44605@roundup.psfhosted.org> Message-ID: <1627231023.23.0.876054043294.issue44605@roundup.psfhosted.org> Raymond Hettinger added the comment: To add support for metaclasses, replacing 'self.__lt__(other)' with 'type(self).__lt__(self, other)' will work. The performance degradation for the common case is about 25%: $ py -m timeit -s 'from tmp import a, b' 'a >= b' # op_result = type(self).__lt__(self, other) 1000000 loops, best of 5: 283 nsec per loop $ py -m timeit -s 'from tmp import a, b' 'a >= b' # op_result = self.__lt__(other) 1000000 loops, best of 5: 227 nsec per loop ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 12:48:21 2021 From: report at bugs.python.org (hai shi) Date: Sun, 25 Jul 2021 16:48:21 +0000 Subject: [issue43967] Valgrind memcheck on Py_Initialize In-Reply-To: <1619618001.66.0.42182617734.issue43967@roundup.psfhosted.org> Message-ID: <1627231701.01.0.45756215334.issue43967@roundup.psfhosted.org> hai shi added the comment: Hi, Simon. Thanks for your report. There have an relatived issue in: bpo-43145, this bpo have mentioned `Py_Initialize()`. So I suggest to close this bpo. We can reopen it if we have seperated questions need to be discussed in here. > Running a Valgrind memcheck of Py_Initialize still produces issues even when using the suggested suppressions file. Am I doing something wrong or is this expected? AFAIK, You are right;) ---------- nosy: +shihai1991 resolution: -> duplicate stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:05:46 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 17:05:46 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627232746.93.0.633604488001.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 9751f85914e0ef3324671a91da34a635d48b17fb by Vinay Sajip in branch 'main': bpo-44399: Update logging cookbook to document patterns to be avoided. (GH-27348) https://github.com/python/cpython/commit/9751f85914e0ef3324671a91da34a635d48b17fb ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:06:12 2021 From: report at bugs.python.org (Steven Hsu) Date: Sun, 25 Jul 2021 17:06:12 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627232772.42.0.231225103857.issue44693@roundup.psfhosted.org> Change by Steven Hsu : ---------- keywords: +patch pull_requests: +25890 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27349 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:17 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:17 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627232897.7.0.884012405902.issue44399@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25891 pull_request: https://github.com/python/cpython/pull/27350 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:28 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:28 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627232908.28.0.337479584957.issue44399@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25893 pull_request: https://github.com/python/cpython/pull/27352 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:38 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:38 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627232918.68.0.778696594667.issue43184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25895 pull_request: https://github.com/python/cpython/pull/27354 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:43 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:43 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627232923.76.0.458409523009.issue43184@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25896 pull_request: https://github.com/python/cpython/pull/27355 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:23 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:23 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627232903.51.0.113054906257.issue44399@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25892 pull_request: https://github.com/python/cpython/pull/27351 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 13:08:33 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 17:08:33 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627232913.21.0.0670253662957.issue43184@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25894 pull_request: https://github.com/python/cpython/pull/27353 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 14:34:12 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sun, 25 Jul 2021 18:34:12 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627238052.42.0.420931793105.issue44732@roundup.psfhosted.org> Guido van Rossum added the comment: Agreed. I think we should do it, Serhiy?s reasoning makes sense. We should just update the PEP and add a note that this was changed during the beta period. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 15:30:27 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 19:30:27 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627241427.95.0.531710575704.issue43184@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset ce2033694ef4bf4c304e5c98d19fdeb684cd961b by Miss Islington (bot) in branch '3.9': [3.9] bpo-43184: Add information about added attribute and method. (GH-27347) (GH-27353) https://github.com/python/cpython/commit/ce2033694ef4bf4c304e5c98d19fdeb684cd961b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 15:30:59 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 19:30:59 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627241459.42.0.738099805665.issue43184@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 59058a65a27de434a79adb749637b74a7fe418ba by Miss Islington (bot) in branch '3.10': [3.10] bpo-43184: Add information about added attribute and method. (GH-27347) (GH-27355) https://github.com/python/cpython/commit/59058a65a27de434a79adb749637b74a7fe418ba ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 15:32:02 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 19:32:02 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627241522.18.0.129606056732.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 628baf6fef4d633e756024cf813941a4075360c1 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44399: Update logging cookbook to document patterns to be avoided. (GH-27348) (GH-27352) https://github.com/python/cpython/commit/628baf6fef4d633e756024cf813941a4075360c1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 15:32:23 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sun, 25 Jul 2021 19:32:23 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627241543.81.0.381829438762.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 5a0c6abb569cadfc6b418a7d23ecffec01bd234d by Miss Islington (bot) in branch '3.9': [3.9] bpo-44399: Update logging cookbook to document patterns to be avoided. (GH-27348) (GH-27350) https://github.com/python/cpython/commit/5a0c6abb569cadfc6b418a7d23ecffec01bd234d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 16:17:50 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 20:17:50 +0000 Subject: [issue42378] logging reopens file with same mode, possibly truncating In-Reply-To: <1605556102.98.0.0941471383568.issue42378@roundup.psfhosted.org> Message-ID: <1627244270.93.0.465368847678.issue42378@roundup.psfhosted.org> miss-islington added the comment: New changeset 96cf5a63d2dbadaebf236362b4c7c09c51fda55c by andrei kulakov in branch 'main': bpo-42378: fixed log truncation on logging shutdown (GH-27310) https://github.com/python/cpython/commit/96cf5a63d2dbadaebf236362b4c7c09c51fda55c ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 16:19:36 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Jul 2021 20:19:36 +0000 Subject: [issue41203] Replace references to OS X in documentation with macOS In-Reply-To: <1593800586.51.0.799645858165.issue41203@roundup.psfhosted.org> Message-ID: <1627244376.11.0.858123863766.issue41203@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 16:27:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sun, 25 Jul 2021 20:27:19 +0000 Subject: [issue41203] Replace references to OS X in documentation with macOS In-Reply-To: <1593800586.51.0.799645858165.issue41203@roundup.psfhosted.org> Message-ID: <1627244839.0.0.454319240876.issue41203@roundup.psfhosted.org> Serhiy Storchaka added the comment: Patrick, are you interested in reviving your PR? It mostly LGTM, except several not addressed comments. I clarified them. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 18:01:51 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 22:01:51 +0000 Subject: [issue43950] Include column offsets for bytecode instructions In-Reply-To: <1619521118.33.0.233805842394.issue43950@roundup.psfhosted.org> Message-ID: <1627250511.5.0.302244894487.issue43950@roundup.psfhosted.org> miss-islington added the comment: New changeset 3e235e0447e373d81f195f4292959c7be9c013dc by Batuhan Taskaya in branch 'main': bpo-43950: support some multi-line expressions for PEP 657 (GH-27339) https://github.com/python/cpython/commit/3e235e0447e373d81f195f4292959c7be9c013dc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 18:08:21 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sun, 25 Jul 2021 22:08:21 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1627250901.91.0.200733443042.issue19217@roundup.psfhosted.org> Terry J. Reedy added the comment: Lukasz, perhaps you can finish this. Too many assistent cooks and no chief cook. At least tell Jack (above) whether to submit his PR. ---------- nosy: +lukasz.langa, terry.reedy versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 19:42:28 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 25 Jul 2021 23:42:28 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627256548.09.0.507351699969.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 4214f470f0cb9b6fef9a90758756fbc00ba95b5a by Charles Burkland in branch 'main': bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) https://github.com/python/cpython/commit/4214f470f0cb9b6fef9a90758756fbc00ba95b5a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 19:42:43 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 25 Jul 2021 23:42:43 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627256563.87.0.739338996678.issue44600@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25897 pull_request: https://github.com/python/cpython/pull/27356 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 19:43:03 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sun, 25 Jul 2021 23:43:03 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627256583.72.0.120680859715.issue44600@roundup.psfhosted.org> Change by Brandt Bucher : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 20:04:29 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 00:04:29 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627257869.26.0.36781752767.issue44600@roundup.psfhosted.org> miss-islington added the comment: New changeset 01601aa7360ae51e74a64dbe957288096bb364fd by Miss Islington (bot) in branch '3.10': [3.10] bpo-44600: Fix line numbers for pattern matching cleanup code (GH-27346) (GH-27356) https://github.com/python/cpython/commit/01601aa7360ae51e74a64dbe957288096bb364fd ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 20:11:03 2021 From: report at bugs.python.org (Ryan Ozawa) Date: Mon, 26 Jul 2021 00:11:03 +0000 Subject: [issue28356] [easy doc] Document os.rename() behavior on Windows when src and dst are on different filesystems In-Reply-To: <1475588552.47.0.916118565333.issue28356@psf.upfronthosting.co.za> Message-ID: <1627258263.48.0.703344040428.issue28356@roundup.psfhosted.org> Ryan Ozawa added the comment: Hi all, This is my first issue so feedback is welcome. Following @vstinner 's suggestions: > * os.rename() can fail if source and destination are on two different file systems > * Use shutil.move() to support move to a different directory And from @eryksun : > ... on Windows the "operation will fail if src and dst are on different filesystems". Just 2 short lines: 2292,6 +2292,8 @@ features: will fail with an :exc:`OSError` subclass in a number of cases: On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. + The operation will fail if *src* and *dst* are on different filesystems. Use + :func:`shutil.move` to support moves to a different filesystem. If nothing to change, I will make a PR soon. ---------- keywords: +patch nosy: +rhyn0 Added file: https://bugs.python.org/file50180/os_rename_windows.patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 20:24:24 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 26 Jul 2021 00:24: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: <1627259064.5.0.164088790765.issue43944@roundup.psfhosted.org> Jack DeVries added the comment: I've identified the first bad commit with git-bisect: commit b61b818d916942aad1f8f3e33181801c4a1ed14b Author: Kyle Stanley Date: Fri Mar 27 15:31:22 2020 -0400 bpo-39812: Remove daemon threads in concurrent.futures (GH-19149) Remove daemon threads from :mod:`concurrent.futures` by adding an internal `threading._register_atexit()`, which calls registered functions prior to joining all non-daemon threads. This allows for compatibility with subinterpreters, which don't support daemon threads. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 20:25:22 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 26 Jul 2021 00:25:22 +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: <1627259122.08.0.240252427128.issue43944@roundup.psfhosted.org> Jack DeVries added the comment: The first bad commit was a fix for bpo-39812. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:11:22 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 01:11:22 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627261882.54.0.688809330773.issue44693@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25898 pull_request: https://github.com/python/cpython/pull/27357 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:11:35 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 26 Jul 2021 01:11:35 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627261895.01.0.308710667858.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 0363a4014d90df17a29042de008ef0b659f92505 by Steven Hsu in branch 'main': bpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349) https://github.com/python/cpython/commit/0363a4014d90df17a29042de008ef0b659f92505 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:11:27 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 01:11:27 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627261887.31.0.912629441191.issue44693@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25899 pull_request: https://github.com/python/cpython/pull/27358 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:40:16 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 26 Jul 2021 01:40:16 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627263616.15.0.722382977554.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 642d873d672eb1b4ddffd99e665c54ed358a4562 by Miss Islington (bot) in branch '3.10': bpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349) (GH-27357) https://github.com/python/cpython/commit/642d873d672eb1b4ddffd99e665c54ed358a4562 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:40:39 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 26 Jul 2021 01:40:39 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627263639.7.0.526457288622.issue44693@roundup.psfhosted.org> Terry J. Reedy added the comment: New changeset 4ce6c5285abd78dc936ec6036e7bb964fd55d955 by Miss Islington (bot) in branch '3.9': bpo-44693: Update __future__ entry in Doc/glossary.rst (GH-27349) (GH-27358) https://github.com/python/cpython/commit/4ce6c5285abd78dc936ec6036e7bb964fd55d955 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 21:41:07 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Mon, 26 Jul 2021 01:41:07 +0000 Subject: [issue44693] Unclear definition of the "__future__" module in Docs In-Reply-To: <1626857117.48.0.847566254974.issue44693@roundup.psfhosted.org> Message-ID: <1627263667.9.0.231423251478.issue44693@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- nosy: -miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 23:22:15 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 26 Jul 2021 03:22:15 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1627269735.47.0.401044238085.issue26153@roundup.psfhosted.org> Andrei Kulakov added the comment: 3.6 no longer gets bugfixes, so I think this can be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sun Jul 25 23:51:36 2021 From: report at bugs.python.org (Du) Date: Mon, 26 Jul 2021 03:51:36 +0000 Subject: [issue44737] Mapping from to collections.abc Message-ID: <1627271496.93.0.602313115544.issue44737@roundup.psfhosted.org> New submission from Du <491609917 at qq.com>: When using Sanic, referencing Mapping in collections in SANic-Jinja2 brings ImportError: Cannot import name 'Mapping' from 'collections'. When you use Mapping, shouldn't you call from collections.abc? ---------- messages: 398208 nosy: haitanghuadeng priority: normal severity: normal status: open title: Mapping from to collections.abc type: resource usage versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 00:43:59 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 26 Jul 2021 04:43:59 +0000 Subject: [issue44737] Mapping from to collections.abc In-Reply-To: <1627271496.93.0.602313115544.issue44737@roundup.psfhosted.org> Message-ID: <1627274639.85.0.748182769214.issue44737@roundup.psfhosted.org> Jelle Zijlstra added the comment: This sounds like a bug in the third-party library you're using, not in Python itself. Could you report this bug to the library? According to https://docs.python.org/3.9/library/collections.html, aliases like collections.Mapping were removed from the collections namespace in 3.10. ---------- nosy: +Jelle Zijlstra resolution: -> third party stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 00:49:10 2021 From: report at bugs.python.org (Jelle Zijlstra) Date: Mon, 26 Jul 2021 04:49:10 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627274950.59.0.0515450260452.issue44732@roundup.psfhosted.org> Jelle Zijlstra added the comment: I agree that UnionType is marginally better so we should rename it. It doesn't seem worth doing if this doesn't make it in in time for 3.10, though. With the advent of PEP 604 typing.Union will hopefully become irrelevant. ---------- nosy: +Jelle Zijlstra _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 00:59:12 2021 From: report at bugs.python.org (Jack DeVries) Date: Mon, 26 Jul 2021 04:59:12 +0000 Subject: [issue39812] Avoid daemon threads in concurrent.futures In-Reply-To: <1583071410.96.0.599538732629.issue39812@roundup.psfhosted.org> Message-ID: <1627275552.98.0.414889031871.issue39812@roundup.psfhosted.org> Jack DeVries added the comment: The regression that @janfrederik.konopka points out also has it's own open issue: bpo-43944. I'm trying to work on a fix for this regression. Slowly but surely. Now I've finally found these threads, this information will be a big help! Any tips are appreciated. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 01:48:28 2021 From: report at bugs.python.org (ty) Date: Mon, 26 Jul 2021 05:48:28 +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: <1627278508.1.0.634641987149.issue44493@roundup.psfhosted.org> ty added the comment: Changes have been made in this PR, waiting for reviewing. ---------- resolution: -> fixed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 03:07:03 2021 From: report at bugs.python.org (sedrubal) Date: Mon, 26 Jul 2021 07:07:03 +0000 Subject: [issue25549] call sum on list of timedelta throws TypeError In-Reply-To: <1446610306.98.0.69863764968.issue25549@psf.upfronthosting.co.za> Message-ID: <1627283223.7.0.727313248211.issue25549@roundup.psfhosted.org> sedrubal added the comment: What is the reason for this start parameter? Why will sum not just use the first entry of the input sequence? I think at least a error message that points programmers into the right direction was very helpful. ---------- nosy: +sedrubal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 03:49:50 2021 From: report at bugs.python.org (Joongi Kim) Date: Mon, 26 Jul 2021 07:49:50 +0000 Subject: [issue44738] io_uring as a new backend to selectors and asyncio Message-ID: <1627285790.87.0.178288680058.issue44738@roundup.psfhosted.org> New submission from Joongi Kim : This is a rough early idea suggestion on adding io_uring as an alternative I/O multiplexing mechanism in Python (maybe selectors and asyncio). io_uring is a relatively new I/O mechanism introduced in Linux kernel 5.1 or later. https://lwn.net/Articles/776703/ https://lwn.net/Articles/810414/ https://blogs.oracle.com/linux/post/an-introduction-to-the-io_uring-asynchronous-io-framework The advantages of io_uring over epoll: - completion-based - less number of syscalls - higher performance (https://twitter.com/hielkedv/status/1218891982636027905) - file I/O support including read/write/stat/open/close I'm not sure that io_uring would bring actual performance improvements to Python (and asyncio) or not yet. We need some exploration and prototyping, but still technically it would be a nice-to-have feature, considering Python's recent speed-up optimizations. Also io_uring is also intended to support high-speed storage devices such as NVMe, and may be a good addition to asyncio in terms of improved async file I/O support. Here are existing attempts to incorporate uring in other languages: - liburing (C, https://github.com/axboe/liburing) - iou, tokio-uring (Rust, https://tokio.rs/blog/2021-07-tokio-uring) I don't have any estimation on the efforts and time required to do the work, but just want to spark the discussion. :) ---------- components: asyncio messages: 398215 nosy: achimnol, asvetlov, corona10, njs, yselivanov priority: normal severity: normal status: open title: io_uring as a new backend to selectors and asyncio type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 04:02:22 2021 From: report at bugs.python.org (Nathaniel Smith) Date: Mon, 26 Jul 2021 08:02:22 +0000 Subject: [issue44738] io_uring as a new backend to selectors and asyncio In-Reply-To: <1627285790.87.0.178288680058.issue44738@roundup.psfhosted.org> Message-ID: <1627286542.97.0.146997074944.issue44738@roundup.psfhosted.org> Nathaniel Smith added the comment: I think this is a dupe of issue41271? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 04:09:51 2021 From: report at bugs.python.org (Joongi Kim) Date: Mon, 26 Jul 2021 08:09:51 +0000 Subject: [issue44738] io_uring as a new backend to selectors and asyncio In-Reply-To: <1627285790.87.0.178288680058.issue44738@roundup.psfhosted.org> Message-ID: <1627286991.36.0.949311086359.issue44738@roundup.psfhosted.org> Joongi Kim added the comment: Ah, yes, but one year has passed so it may be another chance to discuss its adoption, as new advances like tokio_uring became available. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 04:18:22 2021 From: report at bugs.python.org (Joongi Kim) Date: Mon, 26 Jul 2021 08:18:22 +0000 Subject: [issue44738] io_uring as a new backend to selectors and asyncio In-Reply-To: <1627285790.87.0.178288680058.issue44738@roundup.psfhosted.org> Message-ID: <1627287502.57.0.222783453933.issue44738@roundup.psfhosted.org> Joongi Kim added the comment: As in the previous discussion, instead of tackling stdlib right away, it would be nice to evaluate the approach using 3rd-party libs, such as trio and/or async-tokio, or maybe a new library. I have a strong feeling that we need to improve the async file I/O. AFAIK, aiofiles is the only choice we have and it uses a thread pool, which involves many more context switches than required. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 06:09:39 2021 From: report at bugs.python.org (Artem) Date: Mon, 26 Jul 2021 10:09:39 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1627294179.64.0.255863824431.issue44697@roundup.psfhosted.org> Artem added the comment: Checked on 3.9.6 - still leaking. Strange stuff, but if I write except OSError as e: del self instead of except OSError as e: pass leak is disappearing. ---------- versions: +Python 3.9 -Python 3.6 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 06:22:28 2021 From: report at bugs.python.org (Mark Shannon) Date: Mon, 26 Jul 2021 10:22:28 +0000 Subject: [issue44590] Create frame objects lazily when needed In-Reply-To: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> Message-ID: <1627294948.76.0.664381976416.issue44590@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ae0a2b756255629140efcbe57fc2e714f0267aa3 by Mark Shannon in branch 'main': bpo-44590: Lazily allocate frame objects (GH-27077) https://github.com/python/cpython/commit/ae0a2b756255629140efcbe57fc2e714f0267aa3 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 07:16:21 2021 From: report at bugs.python.org (logon_name) Date: Mon, 26 Jul 2021 11:16:21 +0000 Subject: [issue44739] XScrollbar is not stationary Message-ID: <1627298181.72.0.462970304554.issue44739@roundup.psfhosted.org> New submission from logon_name : Hello! When I was working on Tkinter GUI, I made a Text with two Scrollbars. But when I created many lines, filled the last line with letters, and then dragged the YScrollbar upwards, the XScrollbar could not be dragged. Moreover, when dragging down to the end, the Slider of the XScrollbar is not on the far right. I hope this bug can be fixed as soon as possible. ---------- components: Tkinter files: editor.py messages: 398221 nosy: logon_name priority: normal severity: normal status: open title: XScrollbar is not stationary type: behavior versions: Python 3.8 Added file: https://bugs.python.org/file50181/editor.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 07:23:12 2021 From: report at bugs.python.org (Thomas Wouters) Date: Mon, 26 Jul 2021 11:23:12 +0000 Subject: [issue26153] PyImport_GetModuleDict: no module dictionary! when `__del__` triggers a warning In-Reply-To: <1453205670.9.0.210259286868.issue26153@psf.upfronthosting.co.za> Message-ID: <1627298592.18.0.585922801307.issue26153@roundup.psfhosted.org> Thomas Wouters added the comment: This was fixed back in 2018, in fact. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 07:52:23 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Mon, 26 Jul 2021 11:52:23 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs Message-ID: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> New submission from Mariusz Felisiak : AP lowercased "internet" and "web" in all instances ? web page, the web, web browser, etc. on June 1, 2016: https://twitter.com/APStylebook/status/716384777406922753 https://twitter.com/APStylebook/status/716279539052191746?s=20 I'd be happy to provide a patch, if accepted. We will update the Django docs to follow this recommendation, see https://code.djangoproject.com/ticket/32956. ---------- assignee: docs at python components: Documentation messages: 398223 nosy: docs at python, felixxm priority: normal severity: normal status: open title: Lowercase "Internet" and "web" in docs type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 08:13:34 2021 From: report at bugs.python.org (wyz23x2) Date: Mon, 26 Jul 2021 12:13:34 +0000 Subject: [issue27035] Cannot set exit code in atexit callback In-Reply-To: <1463385428.15.0.762354704325.issue27035@psf.upfronthosting.co.za> Message-ID: <1627301614.22.0.246003919595.issue27035@roundup.psfhosted.org> Change by wyz23x2 : ---------- versions: +Python 3.10, Python 3.11 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 08:47:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 26 Jul 2021 12:47:47 +0000 Subject: [issue32937] Multiprocessing worker functions not terminating with a large number of processes and a manager In-Reply-To: <1519481823.24.0.467229070634.issue32937@psf.upfronthosting.co.za> Message-ID: <1627303667.42.0.784648074591.issue32937@roundup.psfhosted.org> Andrei Kulakov added the comment: I have confirmed the reproducer posted by Ronald also works for me, on 3.11 compiled from dev branch, also with cpu count == 8; on the new M1 silicon (that shouldn't matter though). I agree this can be closed. ---------- nosy: +andrei.avk status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 08:54:04 2021 From: report at bugs.python.org (Eric V. Smith) Date: Mon, 26 Jul 2021 12:54:04 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627304044.86.0.10590540115.issue44740@roundup.psfhosted.org> Eric V. Smith added the comment: That seems reasonable to me. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 09:02:18 2021 From: report at bugs.python.org (Ondrej Novak) Date: Mon, 26 Jul 2021 13:02:18 +0000 Subject: [issue40106] multiprocessor spawn In-Reply-To: <1585518578.2.0.0489480686513.issue40106@roundup.psfhosted.org> Message-ID: <1627304538.03.0.299189208789.issue40106@roundup.psfhosted.org> Change by Ondrej Novak : ---------- nosy: +andrenvk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:23:39 2021 From: report at bugs.python.org (Pierre Quentel) Date: Mon, 26 Jul 2021 14:23:39 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence Message-ID: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> New submission from Pierre Quentel : This code match range(42): case [x, *w, y]: z = 0 sets w to a list with 40 items : the length of the subject, minus the number of non-star subpatterns. But this code (adapted from test_patma_186) enters an infinite loop import collections.abc class Seq(collections.abc.Sequence): def __getitem__(self, i): print('get item', i) return i def __len__(self): return 42 match Seq(): case [x, *w, y]: z = 0 __getitem__ gets called forever, instead of stopping when the expected number of items in w is reached. ---------- components: Interpreter Core messages: 398226 nosy: quentel priority: normal severity: normal status: open title: Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence type: crash versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:35:27 2021 From: report at bugs.python.org (Dong-hee Na) Date: Mon, 26 Jul 2021 14:35:27 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627310127.17.0.338378863344.issue44740@roundup.psfhosted.org> Dong-hee Na added the comment: @felixxm Please submit the PR :) ---------- nosy: +corona10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:39:49 2021 From: report at bugs.python.org (=?utf-8?q?C=C3=A9lestin_Matte?=) Date: Mon, 26 Jul 2021 14:39:49 +0000 Subject: [issue44742] smtplib: less confusing behaviour when giving incorrect multiple recipients list Message-ID: <1627310389.11.0.324785663075.issue44742@roundup.psfhosted.org> New submission from C?lestin Matte : When giving recipients in a string format ("email1, email2") to sendmail(), an email is sent to the first email in the list only. This is not a bug since the documentation indicates that sendmail() takes either a list of addresses, or a single address in a string. However, this error is easy to make since the "To:" field expects a comma-separated series of email addresses in a string format. I suggest either that: - sendmail() accepts a series of emails in a string format: "email1, email2" for the recipient lists - sendmail() raises an exception if a series of email in a string format is detected Attached is an example script to test confusing behaviour (email is sent to email1 at mydomain.com only): ---------- files: test_sendmail.py messages: 398228 nosy: cmatte priority: normal severity: normal status: open title: smtplib: less confusing behaviour when giving incorrect multiple recipients list type: enhancement Added file: https://bugs.python.org/file50182/test_sendmail.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:50:58 2021 From: report at bugs.python.org (Julian_Orteil) Date: Mon, 26 Jul 2021 14:50:58 +0000 Subject: [issue44743] asyncio DatagramProtocol stops calling callbacks after OSError Message-ID: <1627311058.63.0.328526216812.issue44743@roundup.psfhosted.org> New submission from Julian_Orteil : After working through the Transports and Protocols documentation of asyncio, I decided to stress test the DatagramProtocol as an application I'm developing needs to act as a UDP server. One of my tests drops the client before the server responds which raises an OSError on the server; however, after the error is raised, the server stops executing callbacks (like connection_made, datagram_received, error_received and connection_lost) until it is restarted. There is no documentation I can find that explains this behavior nor is there any meaningful discussions about it elsewhere. I don't think the socket itself drops because the client doesn't raise an OSError itself when connecting to the now-errored server. Interestingly though, when I tried to enable debug mode of the loops on both the client to see if there were any silent errors being raised (which didn't occur), this issue doesn't occur. Enabling debug mode on the server had no effect. Attached is the reproducible code; it is a slightly modified version of the UDP Echo Client/Server example found in the docs named above. My environment is Python 3.9.5 on Windows 10. ---------- components: asyncio files: reproducible_datagramprotocol_error.py messages: 398229 nosy: JulianOrteil, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio DatagramProtocol stops calling callbacks after OSError type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50183/reproducible_datagramprotocol_error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:52:16 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Jul 2021 14:52:16 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint In-Reply-To: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> Message-ID: <1627311136.73.0.772737739113.issue44682@roundup.psfhosted.org> Irit Katriel added the comment: Silently ignoring errors is not exactly a bug, and this change might break some scripts. So I think we should not backport it. ---------- nosy: +iritkatriel versions: -Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:55:49 2021 From: report at bugs.python.org (Ondrej Novak) Date: Mon, 26 Jul 2021 14:55:49 +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: <1627311349.32.0.496467577125.issue44037@roundup.psfhosted.org> Change by Ondrej Novak : ---------- nosy: +andrenvk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:58:05 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 26 Jul 2021 14:58:05 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint In-Reply-To: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> Message-ID: <1627311485.09.0.649458632417.issue44682@roundup.psfhosted.org> Andrei Kulakov added the comment: I agree not backporting is most likely fine; just want to add that the issue here is that it allows you to enter command for an invalid breakpoint, creating a strong impression both that bpoint is valid and that command will be active. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 10:58:32 2021 From: report at bugs.python.org (ready-research) Date: Mon, 26 Jul 2021 14:58:32 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse Message-ID: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> New submission from ready-research : `urlparse` mishandles certain uses of extra slash or backslash(such as https:/// , https:/, https:\) and interprets the URI as a relative path. A userland logic implementation that bases its decision on the urlparse() function may introduce a security vulnerability due to the unexpected returned values of the function. These vulnerabilities may manifest as an SSRF, Open Redirect, and other types of vulnerabilities related to incorrectly trusting a URL. ``` from urllib.parse import urlparse url1=urlparse('https://www.attacker.com/a/b') url2=urlparse('https:///www.attacker.com/a/b') url3=urlparse('https:/www.attacker.com/a/b') url4=urlparse('https:\www.attacker.com/a/b') print("Normal behaviour: HOSTNAME should be in netloc\n") print(url1) print("\nMishandling hostname and returning it as path\n") print(url2) print(url3) print(url4) ``` OUTPUT: ``` Normal behaviour: HOSTNAME should be in netloc ParseResult(scheme='https', netloc='www.attacker.com', path='/a/b', params='', query='', fragment='') Mishandling hostname and returning it as path ParseResult(scheme='https', netloc='', path='/www.attacker.com/a/b', params='', query='', fragment='') ParseResult(scheme='https', netloc='', path='/www.attacker.com/a/b', params='', query='', fragment='') ParseResult(scheme='https', netloc='', path='\\www.attacker.com/a/b', params='', query='', fragment='') ``` ---------- components: Parser messages: 398232 nosy: lys.nikolaou, pablogsal, ready-research priority: normal severity: normal status: open title: [security] Open redirect attack due to insufficient validation in Urlparse 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 Jul 26 11:21:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 15:21:17 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627312877.28.0.356118516027.issue44734@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 3f135c073a53793ec68902f6b513934ddff47235 by Logan Jones in branch 'main': bpo-44734: Fix precision in turtle tests (GH-27343) https://github.com/python/cpython/commit/3f135c073a53793ec68902f6b513934ddff47235 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:21:19 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 15:21:19 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627312879.45.0.416403207192.issue44734@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25901 pull_request: https://github.com/python/cpython/pull/27361 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:21:25 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 15:21:25 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627312885.16.0.924620997698.issue44734@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25902 pull_request: https://github.com/python/cpython/pull/27362 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:46:34 2021 From: report at bugs.python.org (Kyle Stanley) Date: Mon, 26 Jul 2021 15:46:34 +0000 Subject: [issue44697] Memory leak when asyncio.open_connection raise In-Reply-To: <1626875179.77.0.215331684735.issue44697@roundup.psfhosted.org> Message-ID: <1627314394.38.0.168745086425.issue44697@roundup.psfhosted.org> Kyle Stanley added the comment: Thank you Arteem, that should help indicate where the memory leak is present. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:56:00 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 15:56:00 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627314960.01.0.332594695707.issue44734@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 16a174f7bac481ff6f859179b30a74d867747137 by Miss Islington (bot) in branch '3.10': bpo-44734: Fix precision in turtle tests (GH-27343) (GH-27361) https://github.com/python/cpython/commit/16a174f7bac481ff6f859179b30a74d867747137 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:56:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 15:56:23 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627314983.54.0.769533706285.issue44734@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7b2185b8e495daed30b50fe89f3ada0dc0129b62 by Miss Islington (bot) in branch '3.9': bpo-44734: Fix precision in turtle tests (GH-27343) (GH-27362) https://github.com/python/cpython/commit/7b2185b8e495daed30b50fe89f3ada0dc0129b62 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:59:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 15:59:48 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627315188.13.0.617561501407.issue44734@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 11:59:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 15:59:55 +0000 Subject: [issue44734] turtle: tests for Vec2D.__abs__ are too strict In-Reply-To: <1627145207.46.0.348646231014.issue44734@roundup.psfhosted.org> Message-ID: <1627315195.06.0.236339388935.issue44734@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:00:34 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:00:34 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627315234.02.0.912930900855.issue44732@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25903 pull_request: https://github.com/python/cpython/pull/27365 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:00:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 16:00:30 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627315230.52.0.893223087116.issue44732@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2b8ad9e6c5f0a66e9ca2d15f85336d8a3eefefb0 by Hasan in branch 'main': bpo-44732: Rename types.Union to types.UnionType (#27342) https://github.com/python/cpython/commit/2b8ad9e6c5f0a66e9ca2d15f85336d8a3eefefb0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:03:44 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 16:03:44 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627315424.2.0.321394653478.issue44698@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 1d582bbc969e05896addf97844ddf17ce9830e5e by T. Wouters in branch 'main': bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) https://github.com/python/cpython/commit/1d582bbc969e05896addf97844ddf17ce9830e5e ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:03:44 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:03:44 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627315424.88.0.488177275077.issue44698@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25904 pull_request: https://github.com/python/cpython/pull/27366 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:03:51 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:03:51 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627315431.42.0.950919928176.issue44698@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25905 pull_request: https://github.com/python/cpython/pull/27367 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:06:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 16:06:04 +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: <1627315564.84.0.543739559333.issue44490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6c1b57d958e2b0d5bcf0f2315b5044838e11638f by Yurii Karabas in branch 'main': bpo-44490: Add 'Whats New' docs regarding types.Union changes (GH-27215) https://github.com/python/cpython/commit/6c1b57d958e2b0d5bcf0f2315b5044838e11638f ---------- message_count: 17.0 -> 18.0 nosy: +lukasz.langa nosy_count: 10.0 -> 11.0 pull_requests: +25906 pull_request: https://github.com/python/cpython/pull/27368 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:05:54 2021 From: report at bugs.python.org (Logan Jones) Date: Mon, 26 Jul 2021 16:05:54 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1627315554.46.0.558363444161.issue44733@roundup.psfhosted.org> Logan Jones added the comment: I think I have a solution for this, but I'm pretty new to contributing. Still writing up some tests. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:06:04 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:06:04 +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: <1627315564.73.0.384835258789.issue44490@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25906 pull_request: https://github.com/python/cpython/pull/27368 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:11:36 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:11:36 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627315896.03.0.52383705677.issue43443@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25907 pull_request: https://github.com/python/cpython/pull/27369 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:11:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 16:11:35 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627315895.06.0.22603090987.issue43443@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c97c2a050cf753003012ae3f08e035326b8f6167 by Serhiy Storchaka in branch 'main': bpo-43443: Clarify difference between shelve objects and dicts (GH-27004) https://github.com/python/cpython/commit/c97c2a050cf753003012ae3f08e035326b8f6167 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:11:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:11:41 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627315901.66.0.211990366099.issue43443@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25908 pull_request: https://github.com/python/cpython/pull/27370 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:12:19 2021 From: report at bugs.python.org (Ram Rachum) Date: Mon, 26 Jul 2021 16:12:19 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1627315939.88.0.803096740401.issue44733@roundup.psfhosted.org> Ram Rachum added the comment: Awesome. You can link to experimental code here. Even if it were not accepted to Python, it could be useful for me and for other people who might see this issue. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:19:10 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:19:10 +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: <1627316350.32.0.112487339102.issue44453@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25910 pull_request: https://github.com/python/cpython/pull/27372 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:19:05 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 16:19:05 +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: <1627316345.66.0.599919577079.issue44453@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +25909 pull_request: https://github.com/python/cpython/pull/27371 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 12:56:59 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 26 Jul 2021 16:56:59 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627318619.96.0.7287207464.issue44741@roundup.psfhosted.org> Change by Brandt Bucher : ---------- nosy: +brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 13:24:01 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 26 Jul 2021 17:24:01 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627320241.5.0.647652094826.issue44741@roundup.psfhosted.org> Brandt Bucher added the comment: (Raising the priority to "high" because any decision on this should ideally be made before the 3.10 RCs.) Hm, interesting. This is because we use UNPACK_EX for these patterns, so the destructuring is basically the same as if you had written: [x, *w, y] = Seq() ...which also hangs. We actually have three implementations for destructuring sequences: - Using UNPACK_EX, when there is a starred name. - Using BINARY_SUBSCR, when there is a starred wildcard. - Using UNPACK_SEQUENCE, when there is no star. When using your Seq class: - The first fails by falling into an infinite loop. - The second works as expected. - The third fails with a ValueError at runtime (for a length mismatch). *If* we decide that this is a big enough problem to fix, then I think the easiest way of doing it is to use the BINARY_SUBSCR implementation for all three paths (we'll just also need to use BUILD_LIST / LIST_APPEND to actually collect the starred items). It will simplify the pattern compiler a bit, but I imagine it will also come with a performance penalty as well. In my opinion, I don't think we should rewrite everything to support Seq (though my mind isn't made up entirely). Sequences are supposed to be sized and iterable, but Seq doesn't really support the iteration protocol correctly (it expects the iterating code to stop once the length is exhausted, rather than raising StopIteration). I'm curious to hear opinions on whether we want to actually fix this, though. It seems that it will always be possible to write classes like Seq the hack our pattern-matching implementation with dubious sequences and mappings, so it really comes down to: is supporting classes like Seq worth potentially slowing down all other sequence patterns? ---------- assignee: -> brandtbucher nosy: +Mark.Shannon, gvanrossum, pablogsal priority: normal -> high _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 13:39:39 2021 From: report at bugs.python.org (Logan Jones) Date: Mon, 26 Jul 2021 17:39:39 +0000 Subject: [issue44733] Feature request: maxtasksperchild for ProcessPoolExecutor In-Reply-To: <1627128881.56.0.324294431588.issue44733@roundup.psfhosted.org> Message-ID: <1627321179.08.0.0526064326068.issue44733@roundup.psfhosted.org> Change by Logan Jones : ---------- keywords: +patch pull_requests: +25911 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27373 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:01:02 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Jul 2021 19:01:02 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627326062.77.0.697417745358.issue44741@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I don't think there is anything technically wrong here. The Seq class is relying on the legacy version of the iterator protocol, which specifies that you need to raise IndexError there to stop the iteration. For instance, this version works: import collections.abc class Seq(collections.abc.Sequence): def __getitem__(self, i): if i >= len(self): raise IndexError return i def __len__(self): return 42 match Seq(): case [x, *w, y]: z = 0 print(z) Also, one could argue that Seq has exactly the same problem all over the language. For instance >> list(Seq()) will hang >> [x,*y] = Seq() will hang and so on and so forth. So, if I am a user and I am trying to **predict** how this would behave based on these two experiments my conclusion would be: "Anything that tries to iterate on this thing will hang" I think that whatever we do, we should make it *predictable* and consistency across the language, and IMHO only fixing it in pattern matching doesn't make it predictable. Being said that, I don't think these use cases justifies a major overhaul of how this behaves everywhere. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:01:47 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Jul 2021 19:01:47 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627326107.49.0.162048250796.issue44741@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: In general I would propose to close this as "not a bug" ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:03:07 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 19:03:07 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627326187.97.0.155908106251.issue44732@roundup.psfhosted.org> miss-islington added the comment: New changeset 8a37e8cf45105fbb592c31ebd30501bbdea5ab81 by Miss Islington (bot) in branch '3.10': bpo-44732: Rename types.Union to types.UnionType (GH-27342) https://github.com/python/cpython/commit/8a37e8cf45105fbb592c31ebd30501bbdea5ab81 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:03:15 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Jul 2021 19:03:15 +0000 Subject: [issue44732] Rename types.Union to types.UnionType In-Reply-To: <1627118660.44.0.542723113695.issue44732@roundup.psfhosted.org> Message-ID: <1627326195.67.0.991627354313.issue44732@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 Jul 26 15:17:38 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 26 Jul 2021 19:17:38 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627327058.9.0.925397635263.issue44741@roundup.psfhosted.org> Brandt Bucher added the comment: I agree, Pablo. The only thing that makes me pause is that, depending on the pattern, *sometimes* we use iteration and *sometimes* we use indexing. That might be sort of surprising to classes like Seq if you change patterns or major Python versions and this thing starts hanging. Hopefully, though, the reason will be relatively easy to debug and fix. Closing as "not a bug". ---------- resolution: -> not a bug stage: -> resolved status: open -> closed type: crash -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:30:49 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:30:49 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627327849.92.0.667710875968.issue44698@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:30:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:30:24 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627327824.47.0.683424200307.issue44698@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 85ac81499ec5fb156a57408bcd95b06de4531488 by Miss Islington (bot) in branch '3.9': bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (GH-27367) https://github.com/python/cpython/commit/85ac81499ec5fb156a57408bcd95b06de4531488 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:30:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:30:24 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627327824.89.0.132938393433.issue44698@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 256d97c8a3151ec7caba6c06bf2a1e682008c304 by Miss Islington (bot) in branch '3.10': bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (#27366) https://github.com/python/cpython/commit/256d97c8a3151ec7caba6c06bf2a1e682008c304 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:30:24 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:30:24 +0000 Subject: [issue44698] Undefined behaviour in Objects/complexobject.c's complex_pow In-Reply-To: <1626880009.97.0.704529118942.issue44698@roundup.psfhosted.org> Message-ID: <1627327824.47.0.683424200307.issue44698@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 85ac81499ec5fb156a57408bcd95b06de4531488 by Miss Islington (bot) in branch '3.9': bpo-44698: Fix undefined behaviour in complex exponentiation. (GH-27278) (GH-27367) https://github.com/python/cpython/commit/85ac81499ec5fb156a57408bcd95b06de4531488 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:32:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:32:08 +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: <1627327928.93.0.246720765232.issue44490@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4a5457d5d48e6563ec481daad245ff3d6ef13503 by Miss Islington (bot) in branch '3.10': bpo-44490: Add 'Whats New' docs regarding types.Union changes (GH-27215) (GH-27368) https://github.com/python/cpython/commit/4a5457d5d48e6563ec481daad245ff3d6ef13503 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:32:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:32:39 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627327959.8.0.0665273366589.issue43443@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 563e05743c8f31366db7ef35a00e396c9f442b17 by Miss Islington (bot) in branch '3.10': bpo-43443: Clarify difference between shelve objects and dicts (GH-27004) (GH-27369) https://github.com/python/cpython/commit/563e05743c8f31366db7ef35a00e396c9f442b17 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:32:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:32:53 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627327972.99.0.471618689021.issue43443@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7482fff297727bb5faf64cc92c73561ccf48feda by Miss Islington (bot) in branch '3.9': bpo-43443: Clarify difference between shelve objects and dicts (GH-27004) (GH-27370) https://github.com/python/cpython/commit/7482fff297727bb5faf64cc92c73561ccf48feda ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:33:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:33:20 +0000 Subject: [issue43443] Should shelve support dict union? In-Reply-To: <1615279595.44.0.954464448046.issue43443@roundup.psfhosted.org> Message-ID: <1627328000.29.0.528045579679.issue43443@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:36:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 19:36:14 +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: <1627328174.7.0.0849320751587.issue44453@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:38:23 2021 From: report at bugs.python.org (Arfrever Frehtes Taifersar Arahesis) Date: Mon, 26 Jul 2021 19:38:23 +0000 Subject: [issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt In-Reply-To: <1516702927.0.0.467229070634.issue32635@psf.upfronthosting.co.za> Message-ID: <1627328303.25.0.0437570611008.issue32635@roundup.psfhosted.org> Arfrever Frehtes Taifersar Arahesis added the comment: Geoffrey Thomas: I agree that including crypt.h only where required is better. Can you file new bug with patch? Benjamin Peterson: I suspect that with crypt.h not included in _cryptmodule.c, crypt() was treated by compiler as implicitly declared function (returning 'int'), however real crypt() function returns 'char*'. ---------- nosy: +Arfrever _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 15:53:12 2021 From: report at bugs.python.org (Ryan Ozawa) Date: Mon, 26 Jul 2021 19:53:12 +0000 Subject: [issue28356] [easy doc] Document os.rename() behavior on Windows when src and dst are on different filesystems In-Reply-To: <1475588552.47.0.916118565333.issue28356@psf.upfronthosting.co.za> Message-ID: <1627329192.78.0.950836625782.issue28356@roundup.psfhosted.org> Change by Ryan Ozawa : ---------- pull_requests: +25912 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27376 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 16:24:51 2021 From: report at bugs.python.org (Logan Jones) Date: Mon, 26 Jul 2021 20:24:51 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627331091.14.0.647084732305.issue44744@roundup.psfhosted.org> Change by Logan Jones : ---------- nosy: +loganasherjones _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 16:31:25 2021 From: report at bugs.python.org (E. Paine) Date: Mon, 26 Jul 2021 20:31:25 +0000 Subject: [issue44739] Tkinter text horizontal scrollbar is not stationary In-Reply-To: <1627298181.72.0.462970304554.issue44739@roundup.psfhosted.org> Message-ID: <1627331485.57.0.576006056928.issue44739@roundup.psfhosted.org> E. Paine added the comment: Thank you for reporting this issue. I have personally found this problem to be annoying and it is also noted in msg377227. I did a brief bit of research but couldn't find an existing ticket on https://core.tcl-lang.org/tk/ticket so please feel free to report it there. I believe it is a side-effect of optimisations the Tk team have made to allow the Text widget to have reasonable performance with a large number of lines (so I would be surprised if this limitation was not already known by them). Again, thank you for reporting this issue, but tkinter is just a thin wrapper around Tk so I think the issue here should be closed. ---------- nosy: +epaine, serhiy.storchaka title: XScrollbar is not stationary -> Tkinter text horizontal scrollbar is not stationary _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 16:36:07 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Mon, 26 Jul 2021 20:36:07 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627331767.83.0.313456504059.issue44740@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- keywords: +patch pull_requests: +25913 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27378 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 16:57:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 20:57:41 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1627333061.23.0.756716187329.issue44515@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset a2c45e5bcf9d3dfff9f2699dbc161489897616b5 by Nick Coghlan in branch 'main': bpo-44515: handle non-refcounted GC in contextlib tests (GH-26910) https://github.com/python/cpython/commit/a2c45e5bcf9d3dfff9f2699dbc161489897616b5 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 16:57:27 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 20:57:27 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1627333047.08.0.581053952426.issue44515@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25914 pull_request: https://github.com/python/cpython/pull/27379 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 17:02:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Mon, 26 Jul 2021 21:02:26 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627333346.83.0.354316146465.issue44744@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 17:06:24 2021 From: report at bugs.python.org (Yury Selivanov) Date: Mon, 26 Jul 2021 21:06:24 +0000 Subject: [issue22239] asyncio: nested event loop In-Reply-To: <1408557830.66.0.604610139339.issue22239@psf.upfronthosting.co.za> Message-ID: <1627333584.97.0.726115808096.issue22239@roundup.psfhosted.org> Yury Selivanov added the comment: > nest-asyncio library (https://github.com/erdewit/nest_asyncio) Seeing that the community actively wants to have support for nested loops I'm slowly changing my opinion on this. Guido, maybe we should allow nested asyncio loops disabled by default? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 17:17:29 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 26 Jul 2021 21:17:29 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627334249.12.0.309189389403.issue42182@roundup.psfhosted.org> Andrei Kulakov added the comment: The same thing happens in 3.11. I've also confirmed the markup is exactly the same. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 17:21:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 21:21:45 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1627334505.38.0.714818437067.issue44515@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0ea5e0d792a85b435ef299319dcd52e59f535cb1 by Miss Islington (bot) in branch '3.10': bpo-44515: handle non-refcounted GC in contextlib tests (GH-26910) (GH-27379) https://github.com/python/cpython/commit/0ea5e0d792a85b435ef299319dcd52e59f535cb1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 17:23:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 21:23:27 +0000 Subject: [issue44515] contextlib test incompatibility with non-refcounted GC In-Reply-To: <1624696211.08.0.171107948528.issue44515@roundup.psfhosted.org> Message-ID: <1627334607.81.0.759940549205.issue44515@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Nick! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:09:14 2021 From: report at bugs.python.org (Matthew Zielinski) Date: Mon, 26 Jul 2021 22:09:14 +0000 Subject: [issue44745] Manual for python 3.9.6 will not let me search Message-ID: <1627337354.47.0.497539026172.issue44745@roundup.psfhosted.org> New submission from Matthew Zielinski : The Manual for python 3.9.6 always says there are no entries. I searched things it definitely had, like modules, but it said there were no topics found. ---------- components: Library (Lib) files: Python Error.png messages: 398261 nosy: matthman2019 priority: normal severity: normal status: open title: Manual for python 3.9.6 will not let me search type: resource usage versions: Python 3.9 Added file: https://bugs.python.org/file50184/Python Error.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:12:41 2021 From: report at bugs.python.org (miss-islington) Date: Mon, 26 Jul 2021 22:12:41 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627337561.66.0.309804003528.issue44740@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25915 pull_request: https://github.com/python/cpython/pull/27380 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:12:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 22:12:26 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627337546.24.0.360076525083.issue44740@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 11749e2dc20ad6a76e9a39e948853e89b2b4bbed by Mariusz Felisiak in branch 'main': bpo-44740: Lowercase "internet" and "web" where appropriate. (#27378) https://github.com/python/cpython/commit/11749e2dc20ad6a76e9a39e948853e89b2b4bbed ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:15:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Mon, 26 Jul 2021 22:15:56 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627337756.3.0.0222150564989.issue42182@roundup.psfhosted.org> Andrei Kulakov added the comment: In this case, it appears that ref with tilde and object makes it work in both 3.10 and 3.11, but with just bare method specified, it doesn't create link in both -- so it may be good to try updating it to have tilde and a ref to obj: Once an iterator's :meth:`~iterator.__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. .. _generator-types: Generator Types --------------- Python's :term:`generator`\s provide a convenient way to implement the iterator protocol. If a container object's :meth:`__iter__` method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the :meth:`__iter__` and :meth:`~generator.__next__` methods. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:32:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Jul 2021 22:32:57 +0000 Subject: [issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL In-Reply-To: <1534298908.58.0.56676864532.issue34410@psf.upfronthosting.co.za> Message-ID: <1627338777.53.0.98338547262.issue34410@roundup.psfhosted.org> Irit Katriel added the comment: The script (3.py) now gives the RuntimeError (as of 3.9) so I think the discussion about back port is over and there is nothing more to do on this issue. If nobody objects I will close this. ---------- status: open -> pending _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:35:07 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Mon, 26 Jul 2021 22:35:07 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627338907.55.0.40559781795.issue44740@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6fc1efa4546ad94a904239fd5efb84e02894eb31 by Miss Islington (bot) in branch '3.10': bpo-44740: Lowercase "internet" and "web" where appropriate. (GH-27378) (GH-27380) https://github.com/python/cpython/commit/6fc1efa4546ad94a904239fd5efb84e02894eb31 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:51:02 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 26 Jul 2021 22:51:02 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627339862.42.0.882904296796.issue44741@roundup.psfhosted.org> Steven D'Aprano added the comment: How is this not a regression? And a very serious one by the sound of it. All the examples that are said to go into an infinite loop work fine in 3.9. (Obviously I can't check the match statement example in 3.9.) If the Sequence Protocol really has been dropped from Python's execution model, shouldn't there be a PEP for such a major change in behaviour? Legacy or not, it is still a part of the language. At the very least, the examples shouldn't swallow the IndexError and go into an infinite loop. Brandt said: > the destructuring is basically the same as if you had written: > > [x, *w, y] = Seq() > > ...which also hangs. It works fine in 3.9, with or without inheriting from the Sequence ABC. # Python 3.9 >>> class A: ... def __len__(self): ... return 5 ... def __getitem__(self, i): ... print(i) ... if i < 5: ... return i ... raise IndexError ... >>> [x, *y, z] = A() 0 1 2 3 4 5 >>> x, y, z (0, [1, 2, 3], 4) Likewise for list(A()), etc. The __len__ method isn't needed for iteration to work correctly. I just included it to match Pierre's example. Inheriting from collections.abc.Sequence does not change the behaviour. Still in 3.9: >>> list(A()) 0 1 2 3 4 5 [0, 1, 2, 3, 4] I think that closing this is as Not A Bug was premature. If this isn't a bug, then I have no idea what counts as a bug any longer :-( ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 18:51:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Mon, 26 Jul 2021 22:51:34 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627339894.24.0.495306816351.issue34013@roundup.psfhosted.org> Irit Katriel added the comment: This case has changed recently, and not for the better: >>> print f(3) File "", line 1 print f(3) ^^^^^^^^^^ SyntaxError: invalid syntax. Perhaps you forgot a comma? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 19:02:59 2021 From: report at bugs.python.org (Brandt Bucher) Date: Mon, 26 Jul 2021 23:02:59 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627340579.59.0.740028411346.issue44741@roundup.psfhosted.org> Brandt Bucher added the comment: > All the examples that are said to go into an infinite loop work fine in 3.9. [...] At the very least, the examples shouldn't swallow the IndexError and go into an infinite loop. Note that the original example posted did not include a "raise IndexError" branch in its __getitem__. That was class I was referring to, since the lack of an IndexError causes the iteration to continue forever. As far as I know, nothing has changed about the iteration protocol in 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 19:14:56 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Mon, 26 Jul 2021 23:14:56 +0000 Subject: [issue44719] Incorrect callable object crashes Python 3.11.0a0 In-Reply-To: <1627014429.86.0.790861111444.issue44719@roundup.psfhosted.org> Message-ID: <1627341296.51.0.741344687923.issue44719@roundup.psfhosted.org> Dennis Sweeney added the comment: Indeed, I got no crash on main after GH-27313. I also got no crash on 3.10 after GH-23568. Its backport to 3.9 (GH-24501) would have fixed this, but broke the stable ABI and was reverted. This was related to bpo-42500. I'm closing this "fixed". Feel free to re-open if you still see an issue. ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 19:23:54 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 26 Jul 2021 23:23:54 +0000 Subject: [issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals In-Reply-To: <1557772831.22.0.440689390024.issue36906@roundup.psfhosted.org> Message-ID: <1627341834.03.0.162792813215.issue36906@roundup.psfhosted.org> Steven D'Aprano added the comment: This feature (or one very like it) has been requested again, this time with an "i" prefix: https://discuss.python.org/t/indented-multi-line-string-literals/9846/1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 19:35:27 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Mon, 26 Jul 2021 23:35:27 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627340579.59.0.740028411346.issue44741@roundup.psfhosted.org> Message-ID: <20210726233150.GJ3540@ando.pearwood.info> Steven D'Aprano added the comment: Ah, I missed that and totally misinterrpreted other comments. Confirmation bias at work: I saw the code I expected to see, not the code that was actually there :-( All good, I agree that it is a bug in the class, not in the language. Sorry for the noise. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 20:27:28 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 27 Jul 2021 00:27:28 +0000 Subject: [issue44745] Manual for python 3.9.6 will not let me search In-Reply-To: <1627337354.47.0.497539026172.issue44745@roundup.psfhosted.org> Message-ID: <1627345648.0.0.0792119224606.issue44745@roundup.psfhosted.org> Dennis Sweeney added the comment: I replicated the issue: downloading the "Windows Help File" (python396.chm) from the release page https://www.python.org/downloads/release/python-396/ , opening it, and entering a search term (e.g., "tuple") into the search tab resulted in a message box pop-up with the message "No topics found." Doing the same with the corresponding file on prior release pages, (e.g. https://www.python.org/downloads/release/python-395/ ) produced in a list of search results, and no such pop-up message. I'm running Windows 10.0.19042 Build 19042. ---------- components: +Windows -Library (Lib) nosy: +Dennis Sweeney, paul.moore, steve.dower, tim.golden, zach.ware type: resource usage -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 21:06:59 2021 From: report at bugs.python.org (Logan Jones) Date: Tue, 27 Jul 2021 01:06:59 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627348019.64.0.589089726958.issue44744@roundup.psfhosted.org> Logan Jones added the comment: I don't know if urlparse is actually "mishandling" these URLs. Looking over RFC 1808 (https://datatracker.ietf.org/doc/html/rfc1808.html) the BNF (https://datatracker.ietf.org/doc/html/rfc1808.html#section-2.2) seems to support what urlparse is reporting, at least for the first two examples. I'll try to break down each scenario. Maybe you can help me understand what you expect it to report? https : // /www.attacker.com ^ ^ ^ scheme Net loc Not a valid Delimeter netloc character, but is a valid abs_path beginning (according to the spec net_loc is allowed to be empty) https : /www.attacker.com/a/b ^ ^ scheme valid abs_path https : \ www.attacker.com/a/b ^ ^ scheme This isn't actually matched anywhere in the BNF, so if anything maybe a value error should have been raised? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 21:57:47 2021 From: report at bugs.python.org (ready-research) Date: Tue, 27 Jul 2021 01:57:47 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627351067.1.0.854349661957.issue44744@roundup.psfhosted.org> ready-research added the comment: Some other examples to test this behaviour: urlparse('https:/\/\/\www.attacker.com/a/b') urlparse('https:/\www.attacker.com/a/b') ## Comparing it to other languages/runtimes How do other languages and their runtimes work with URL parsing functions? Here's Node.js, also showing that it is missing the `host` and `hostname`, with a similar behavior to the currently reported "buggy" python `urlparse()` one: ``` node >require("url").parse("https:/\/\/\www.attacker.com/a/b"); Will return Url { protocol: 'https:', slashes: true, auth: null, host: '', port: null, hostname: '', hash: null, search: null, query: null, pathname: '/www.attacker.com/a/b', path: '/www.attacker.com/a/b', href: 'https:///www.attacker.com/a/b' } ``` But it is already documented that using Node.js url.parse can lead to security issues: https://nodejs.org/dist/latest-v16.x/docs/api/url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost `Use of the legacy url.parse() method is discouraged. Users should use the WHATWG URL API. Because the url.parse() method uses a lenient, non-standard algorithm for parsing URL strings, security issues can be introduced. Specifically, issues with host name spoofing and incorrect handling of usernames and passwords have been identified.` Here's Ruby, also showing that it is missing the `host` and `hostname`, with a similar behavior to the currently reported "buggy" python `urlparse()` one: ```sh irb(main):001:0> require 'uri' => false irb(main):002:0> uri = URI.parse('https:/www.attacker.com/a/b') => # irb(main):003:0> uri.host => nil irb(main):004:0> uri.hostname => nil irb(main):005:0> uri.scheme => "https" irb(main):006:0> uri.path => "/www.attacker.com/a/b" ``` That said, it seems that Ruby throws on other permutations of the bad URL, which python does not. For example: ``` irb(main):011:0> other_uri = URI.parse('https:/\/\/\www.attacker.com/a/b') Traceback (most recent call last): 8: from /usr/bin/irb:23:in `
' 7: from /usr/bin/irb:23:in `load' 6: from /Library/Ruby/Gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `' 5: from (irb):11 4: from (irb):11:in `rescue in irb_binding' 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse' 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:67:in `split' URI::InvalidURIError (bad URI(is not URI?): "https:/\\/\\/\\www.attacker.com/a/b") ``` Same for this other URI, which Ruby does not accept (unlike python, which does accept it and returns with a missing host and hostname properties as evident earlier in this report): ``` irb(main):012:0> other_uri = URI.parse('https:/\www.attacker.com/a/b') Traceback (most recent call last): 8: from /usr/bin/irb:23:in `
' 7: from /usr/bin/irb:23:in `load' 6: from /Library/Ruby/Gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `' 5: from (irb):12 4: from (irb):12:in `rescue in irb_binding' 3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/common.rb:234:in `parse' 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:73:in `parse' 1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/uri/rfc3986_parser.rb:67:in `split' URI::InvalidURIError (bad URI(is not URI?): "https:/\\www.attacker.com/a/b") ``` Let's look at PHP. PHP's parse_url() function behaves much like python, where it misses to identify the host property for all 3 examples provided in this report: ``` ? php -a Interactive shell php > var_dump(parse_url('https:/\www.attacker.com/a/b')); array(2) { ["scheme"]=> string(5) "https" ["path"]=> string(22) "/\www.attacker.com/a/b" } php > var_dump(parse_url('https:/www.attacker.com/a/b')); array(2) { ["scheme"]=> string(5) "https" ["path"]=> string(21) "/www.attacker.com/a/b" } php > var_dump(parse_url('https:/\/\/\www.attacker.com/a/b')); array(2) { ["scheme"]=> string(5) "https" ["path"]=> string(26) "/\/\/\www.attacker.com/a/b" } php > var_dump(parse_url('https://www.attacker.com/a/b')); array(3) { ["scheme"]=> string(5) "https" ["host"]=> string(16) "www.attacker.com" ["path"]=> string(4) "/a/b" } ``` The applicability of this vulnerability It seems that, there's no direct way of manipulating a python runtime into a severe impact simply by sending it a malformed URL. However, a userland logic implementation that bases its decision on the python urlparse() function may introduce a security vulnerability due to the unexpected returned values of the function. These vulnerabilities may manifest as an SSRF, Open Redirect and other types of vulnerabilities related to incorrectly trusting a URL. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 22:26:16 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 02:26:16 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627352776.06.0.458332724748.issue42182@roundup.psfhosted.org> Andrei Kulakov added the comment: Something changed between 3.8 and 3.9 so that "bare" references to methods on `object` no longer get linked. So for example, :meth:`__bool__` would get link to object.__bool__ anchor, but in 3.9+, it should be :meth:`~object.__bool__` for the link to be generated. The case of __enter__ and __exit__ is that inside of contextmanager block, Sphinx knows that bare ref should link to contextmanager, but outside of the block, it does not, so no link is created. In 3.8 docs, there are bare refs to __enter__ and __exit__ outside of relevant block, so they link to object.__enter__ and object.__exit__, which is of course wrong. See 2nd paragraph below the block: https://docs.python.org/3.8/library/stdtypes.html#contextmanager.__exit__ I wasn't able to find why or how in 3.8 it was configured to auto-link bare refs to `object`. I looked at make.bat, conf.py and pyspecific.py Perhaps in 3.8 the entire file was considered / configured a block for `object` object? I will make a PR to fix the links. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 22:26:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 02:26:53 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627352813.46.0.911630372761.issue42182@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- type: -> behavior versions: +Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 22:41:17 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Tue, 27 Jul 2021 02:41:17 +0000 Subject: [issue40085] Argument parsing option c should accept int between -128 to 255 ? In-Reply-To: <1585295142.15.0.400379676659.issue40085@roundup.psfhosted.org> Message-ID: <1627353677.29.0.0134014063863.issue40085@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 22:49:08 2021 From: report at bugs.python.org (Matthew Morrissette Vance) Date: Tue, 27 Jul 2021 02:49:08 +0000 Subject: [issue39658] Include user scripts folder to PATH on Windows In-Reply-To: <1581891148.96.0.449800548141.issue39658@roundup.psfhosted.org> Message-ID: <1627354148.2.0.674127894691.issue39658@roundup.psfhosted.org> Change by Matthew Morrissette Vance : ---------- nosy: +yinzara _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 22:52:17 2021 From: report at bugs.python.org (ready-research) Date: Tue, 27 Jul 2021 02:52:17 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627354337.43.0.181609839282.issue44744@roundup.psfhosted.org> ready-research added the comment: Node.js is recommending using WHATWG URL API. Which handles all these correctly. We can test the same using https://jsdom.github.io/whatwg-url/ For example test the below and will return the same(correct) for all. https:///www.attacker.com/a/b https:/www.attacker.com/a/b https:\www.attacker.com/a/b https:/\/\/\www.attacker.com/a/b https:/\www.attacker.com/a/b ``` href https://www.attacker.com/a/b protocol https: username (empty string) password (empty string) port (empty string) hostname www.attacker.com pathname /a/b search (empty string) hash (empty string) ``` SUMMARY: python urlparse() function should also handle all the above in the same way. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Mon Jul 26 23:40:57 2021 From: report at bugs.python.org (logon_name) Date: Tue, 27 Jul 2021 03:40:57 +0000 Subject: [issue44739] Tkinter text horizontal scrollbar is not stationary In-Reply-To: <1627298181.72.0.462970304554.issue44739@roundup.psfhosted.org> Message-ID: <1627357257.93.0.54198254784.issue44739@roundup.psfhosted.org> Change by logon_name : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 00:27:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 04:27:58 +0000 Subject: [issue42128] Structural Pattern Matching (PEP 634) In-Reply-To: <1603466540.96.0.7677855399.issue42128@roundup.psfhosted.org> Message-ID: <1627360078.83.0.512759899554.issue42128@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- nosy: +andrei.avk nosy_count: 13.0 -> 14.0 pull_requests: +25916 pull_request: https://github.com/python/cpython/pull/27384 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 00:31:10 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 04:31:10 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627360270.74.0.10963869725.issue42182@roundup.psfhosted.org> Andrei Kulakov added the comment: I put the PR up here: https://github.com/python/cpython/pull/27384/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 00:32:37 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 04:32:37 +0000 Subject: [issue42182] 3.10 Documentation Not Hyperlinking Some Methods In-Reply-To: <1603898907.29.0.300729601022.issue42182@roundup.psfhosted.org> Message-ID: <1627360357.61.0.0172513959527.issue42182@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch pull_requests: +25917 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27384 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 01:52:46 2021 From: report at bugs.python.org (Mariusz Felisiak) Date: Tue, 27 Jul 2021 05:52:46 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627365166.95.0.0390378864006.issue44740@roundup.psfhosted.org> Change by Mariusz Felisiak : ---------- pull_requests: +25918 pull_request: https://github.com/python/cpython/pull/27385 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 02:49:22 2021 From: report at bugs.python.org (Priyanshu) Date: Tue, 27 Jul 2021 06:49:22 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword Message-ID: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> New submission from Priyanshu : The finally clause is not executed when an exception occurs and 'raise' keyword is used in except clause. ---------- components: Windows messages: 398278 nosy: Priyanshu, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Improper behaviour of 'finally' keyword type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 02:51:23 2021 From: report at bugs.python.org (Priyanshu) Date: Tue, 27 Jul 2021 06:51:23 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627368683.4.0.160135747242.issue44746@roundup.psfhosted.org> Priyanshu added the comment: The 'finally' clause is not executed when an exception occurs and 'raise' keyword is used in except clause. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 02:59:16 2021 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 27 Jul 2021 06:59:16 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627369156.87.0.861484691512.issue44741@roundup.psfhosted.org> Pierre Quentel added the comment: Thanks for the explanations, but I feel unconfortable with the fact that variable-length sequence patterns are implemented the same as unpacking. (sorry if this has been discussed before, I can't find references to the discussions that lead to the current version of the PEP). There are obvious similarities between [x, *y, z] = A and match A: case [x, *y, z]: print('ok') but a big difference, put forward in PEP 634 : the classes supported for pattern matching are limited (unpacking a generator expression is possible, but they are not supported as subjects for sequence patterns), and the PEP explicitely refers to them having a len(). It seems to me that this implies that the algorithms should be different: - for unpacking, the iterable must be completely consumed before binding the names on the left-hand side. If it is infinite, unpacking fails - for variable-length sequence pattern matching (this is how I understand the last paragraph about them in PEP 634): . get the subject length . iterate one by one before the star pattern . iterate (len(subject) - number of non-star patterns) times for the star pattern . iterate one by one after the star pattern In the second case, even if the subject never raises StopIteration, the match succeeds. Does this make sense ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 03:08:48 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Jul 2021 07:08:48 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627369728.31.0.139895889565.issue44746@roundup.psfhosted.org> Serhiy Storchaka added the comment: I cannot reproduce. >>> try: ... 1/0 ... except: ... print('except') ... raise ... finally: ... print('finally') ... except finally Traceback (most recent call last): File "", line 2, in ZeroDivisionError: division by zero Could you please provide an example code? ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 03:10:27 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Jul 2021 07:10:27 +0000 Subject: [issue44739] Tkinter text horizontal scrollbar is not stationary In-Reply-To: <1627298181.72.0.462970304554.issue44739@roundup.psfhosted.org> Message-ID: <1627369827.64.0.630957543621.issue44739@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> third party _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 03:17:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Jul 2021 07:17:31 +0000 Subject: [issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL In-Reply-To: <1534298908.58.0.56676864532.issue34410@psf.upfronthosting.co.za> Message-ID: <1627370251.84.0.116190244822.issue34410@roundup.psfhosted.org> Serhiy Storchaka added the comment: It would be nice to add a multi-thread supporting version of tee() or add multi-thread support in tee(), but this is different issue. ---------- stage: patch review -> resolved status: pending -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 03:23:35 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 27 Jul 2021 07:23:35 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627370615.22.0.557026918379.issue44746@roundup.psfhosted.org> Change by Steven D'Aprano : ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 04:06:44 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Tue, 27 Jul 2021 08:06:44 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1627373204.95.0.4003730567.issue44098@roundup.psfhosted.org> Serhiy Storchaka added the comment: I think that List[P] should be illegal at first place. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 04:45:25 2021 From: report at bugs.python.org (Michael Hofmann) Date: Tue, 27 Jul 2021 08:45:25 +0000 Subject: [issue39820] Bracketed paste mode for REPL: don't execute pasted command before ENTER is pressed explicitly In-Reply-To: <1583105435.88.0.337448475427.issue39820@roundup.psfhosted.org> Message-ID: <1627375525.54.0.451445043975.issue39820@roundup.psfhosted.org> Change by Michael Hofmann : ---------- nosy: +mhofmann _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 04:46:10 2021 From: report at bugs.python.org (Niyas Sait) Date: Tue, 27 Jul 2021 08:46:10 +0000 Subject: [issue33125] Windows 10 ARM64 platform support In-Reply-To: <1521767011.97.0.467229070634.issue33125@psf.upfronthosting.co.za> Message-ID: <1627375570.61.0.0951747690782.issue33125@roundup.psfhosted.org> Niyas Sait added the comment: I know this issue is closed but just wanted to have a discussion around adding CI support for cpython on windows on arm targets. We at linaro are working on adding windows/arm support for popular packages such as numpy, cffi etc. Hopefully, very soon we will have many of the popular packages working out of the box on windows on arm targets. Testing windows/arm has been an open question. I heard about the potential availablity of windows/arm machines in azure cloud sometimes in the future but not sure about the timescale. In Linaro, we have a WoA farm which has couple of surface pro which we are happy to use for CI and for release builds etc. It could be an interim testing system until we have support in azure. This would enable us to start official support for cpython for windows/arm sooner. I would like to hear your thoughts on the proposal ---------- nosy: +nsait-linaro _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 04:57:59 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 27 Jul 2021 08:57:59 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627376279.6.0.60082655192.issue44740@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 2e41df4d60d71a2551b9605d07321f75cfb52adf by Mariusz Felisiak in branch 'main': bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) https://github.com/python/cpython/commit/2e41df4d60d71a2551b9605d07321f75cfb52adf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 04:58:15 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Jul 2021 08:58:15 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627376295.12.0.368526809671.issue44740@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25919 pull_request: https://github.com/python/cpython/pull/27386 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 05:04:49 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 27 Jul 2021 09:04:49 +0000 Subject: [issue44747] Reduce usage of sys._getframe at typing module Message-ID: <1627376689.96.0.280713555823.issue44747@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: While I was working with `typing` I have notice that there are duplication of `_getframe` usage. While In scope of issue 44353 I introduced `typing._callee` function which allow to return module name of a caller function. In scope of this issue we will reduce the usage of `_getframe` usage. It will be used only in one place, at `_callee` function. ---------- components: Library (Lib) messages: 398286 nosy: uriyyo priority: normal severity: normal status: open title: Reduce usage of sys._getframe at typing module type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 05:08:03 2021 From: report at bugs.python.org (Yurii Karabas) Date: Tue, 27 Jul 2021 09:08:03 +0000 Subject: [issue44747] Reduce usage of sys._getframe at typing module In-Reply-To: <1627376689.96.0.280713555823.issue44747@roundup.psfhosted.org> Message-ID: <1627376883.14.0.616643745086.issue44747@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25920 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27387 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 05:20:18 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Tue, 27 Jul 2021 09:20:18 +0000 Subject: [issue44740] Lowercase "Internet" and "web" in docs In-Reply-To: <1627300343.54.0.087509500889.issue44740@roundup.psfhosted.org> Message-ID: <1627377618.32.0.809662816429.issue44740@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset be2415487ab80e4bd5ace2954651e78b107b17e4 by Miss Islington (bot) in branch '3.10': bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) (#27386) https://github.com/python/cpython/commit/be2415487ab80e4bd5ace2954651e78b107b17e4 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 05:26:32 2021 From: report at bugs.python.org (Thermi) Date: Tue, 27 Jul 2021 09:26:32 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered Message-ID: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> New submission from Thermi : It'd be great if as part of the namespace returned by argparse.ArgumentParser.parse_args(), there was a bool indicating if a specific argument was encountered. That could then be used to implement the following behaviour: With a config file loaded as part of the program, overwrite the values loaded from the config file if the argument was encountered in the argument vector. That's necessary to implement overwriting of settings that were previously set by a different mechanism, e.g. read from a config file. After all the following order of significance should be used: program defaults < config file < argument vector ---------- components: Library (Lib) messages: 398288 nosy: Thermi priority: normal severity: normal status: open title: argparse: a bool indicating if arg was encountered type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 06:14:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 10:14:50 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627380890.73.0.508648185418.issue34013@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch pull_requests: +25921 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27389 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 06:16:14 2021 From: report at bugs.python.org (Ken Jin) Date: Tue, 27 Jul 2021 10:16:14 +0000 Subject: [issue44021] enum docs in 3.10: missing "New in version 3.10" In-Reply-To: <1620061310.33.0.417307154236.issue44021@roundup.psfhosted.org> Message-ID: <1627380974.36.0.829945635049.issue44021@roundup.psfhosted.org> Ken Jin added the comment: I think we can close this. The current docs show the version added for the items in OP's list https://docs.python.org/3.11/library/enum.html. Their versionadded should be 3.11 now, but that's a separate issue with a PR at GH-27388. ---------- nosy: +kj _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 06:16:35 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 27 Jul 2021 10:16:35 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627380994.99.0.138058196381.issue43468@roundup.psfhosted.org> Thomas Grainger added the comment: how about deprecating the functools.cached_property? ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 06:28:56 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 27 Jul 2021 10:28:56 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627381736.92.0.637471755955.issue43468@roundup.psfhosted.org> Thomas Grainger added the comment: > using a per-descriptor `WeakKeyDictionary` to map the instance to locks (which would of course not work - is there any way to map unhashable instances weakly?) there's an issue for that too: https://bugs.python.org/issue44140 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 07:44:53 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Jul 2021 11:44:53 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627386293.4.0.126960925692.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: Sorry for the delay; getting 652 into Python 3.10 took up most of my time. So, in the current proposal: - `PyType_GetName(t)` is equivalent to `PyObject_GetAttrString(t, "__name__")` - for the qualified name you can use `PyObject_GetAttrString(t, "__qualname__")` - there is still no way to get t.tp_name The advantage of PyType_GetName over a regular getattr is that it's fast for heap types (there's no dict lookup, and the string object is cached as ht_name). For static types, it's a bit slower (a string object needs to be built, but still there's no dict lookup). If we go this way, why not add PyType_GetQualName as well? (Is the speed, compared to getattr, worth adding two new functions? I guess it is, barely.) ---- The OP specifically requested a way to get tp_name, which the current PR does not do. I don't think it should, either: - there's no way to assure that `char* tp_name` is not deallocated before the caller is done with it (especially considering that other Python implementations should be able to implement the stable ABI, and those shouldn't need store tp_name as char*). - there is already __name__ and __qualname__ (and __module__); tp_name is a weird mix that I, personally, won't miss if it goes away. I think it's OK to only use it for creation (as PyType_Spec.name), and then expose the __name__/__module__ derived from it. It's not how CPython works, but that's OK for the limited API. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 08:29:49 2021 From: report at bugs.python.org (Priyanshu) Date: Tue, 27 Jul 2021 12:29:49 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627388989.71.0.0135209140573.issue44746@roundup.psfhosted.org> Priyanshu added the comment: I have attached a file as an example. The finally clause is not getting executed if we make use of raise keyword in except clause. It should have been executed in this case case, right? ---------- Added file: https://bugs.python.org/file50185/error.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 08:52:26 2021 From: report at bugs.python.org (Paul Moore) Date: Tue, 27 Jul 2021 12:52:26 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627390346.55.0.520479260826.issue44746@roundup.psfhosted.org> Paul Moore added the comment: It works as expected (the print statement in the "finally" clause is executed) for me. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 09:10:02 2021 From: report at bugs.python.org (Logan Jones) Date: Tue, 27 Jul 2021 13:10:02 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627391402.15.0.784677338166.issue44744@roundup.psfhosted.org> Logan Jones added the comment: If I've understood what you've written correctly, what you want is to change urlparse to use the WHATWG URL Standard (https://url.spec.whatwg.org/). I'm not a committer or anything, but that seems like a large API change and is not likely to happen quickly if at all. I'm not sure what the path forward here is. There are many options, creating a new function/module, slowly deprecating the current urlparse function, or just say it's not our problem. Hopefully someone else can weigh in. In the meantime, a project like https://pypi.org/project/whatwg-url/ claims to implement the WHATWG URL standard. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 09:39:16 2021 From: report at bugs.python.org (Ronald Oussoren) Date: Tue, 27 Jul 2021 13:39:16 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627393156.75.0.259353302171.issue44746@roundup.psfhosted.org> Ronald Oussoren added the comment: The output from the print statement in the finally block is before the traceback, you need to scroll back in the output buffer in VS Code. ---------- nosy: +ronaldoussoren _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 09:54:34 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Jul 2021 13:54:34 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1627394074.58.0.457948306974.issue42064@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 890e22957d427ee994b85d62dfe4d5a7cbd34ec5 by Erlend Egeberg Aasland in branch 'main': bpo-42064: Migrate to `sqlite3_create_collation_v2` (GH-27156) https://github.com/python/cpython/commit/890e22957d427ee994b85d62dfe4d5a7cbd34ec5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 10:13:35 2021 From: report at bugs.python.org (Douglas Raillard) Date: Tue, 27 Jul 2021 14:13:35 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass Message-ID: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> New submission from Douglas Raillard : Re-raising the bug reported by Kevin Shweh: thread: https://bugs.python.org/issue14385 message: https://bugs.python.org/msg337245 Here is a copy for easier reference: The patch for this issue changed LOAD_GLOBAL to use PyObject_GetItem when globals() is a dict subclass, but LOAD_NAME, STORE_GLOBAL, and DELETE_GLOBAL weren't changed. (LOAD_NAME uses PyObject_GetItem for builtins now, but not for globals.) This means that global lookup doesn't respect overridden __getitem__ inside a class statement (unless you explicitly declare the name global with a global statement, in which case LOAD_GLOBAL gets used instead of LOAD_NAME). I don't have a strong opinion on whether STORE_GLOBAL or DELETE_GLOBAL should respect overridden __setitem__ or __delitem__, but the inconsistency between LOAD_GLOBAL and LOAD_NAME seems like a bug that should be fixed. For reference, in the following code, the first 3 exec calls successfully print 5, and the last exec call fails, due to the LOAD_GLOBAL/LOAD_NAME inconsistency: class Foo(dict): def __getitem__(self, index): return 5 if index == 'y' else super().__getitem__(index) exec('print(y)', Foo()) exec('global y; print(y)', Foo()) exec(''' class UsesLOAD_NAME: global y print(y)''', Foo()) exec(''' class UsesLOAD_NAME: print(y)''', Foo()) I encountered the same issue when trying to create a way to "instantiate" modules with some globals replaced by user-defined values to make a dependency-injection system. I therefore want to lookup some names in a separate dict rather than getting the value normally bound in that module (typically by an import statement). ---------- components: Interpreter Core messages: 398299 nosy: douglas-raillard-arm priority: normal severity: normal status: open title: LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 10:17:59 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Jul 2021 14:17:59 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1627395479.39.0.977918486705.issue44098@roundup.psfhosted.org> Guido van Rossum added the comment: Yeah, but we shouldn't go out of our way to reject it. Especially since in 3.11 we'll likely have something equivalent to PEP 563 or PEP 649 (the SC is thinking deep about this right now) and either of those means that usually it won't be evaluated at all anyway (you'd have to call get_type_hints() with PEP 563, or use __annotations__ with the other). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 10:21:05 2021 From: report at bugs.python.org (Guido van Rossum) Date: Tue, 27 Jul 2021 14:21:05 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627395665.02.0.960209140194.issue44741@roundup.psfhosted.org> Guido van Rossum added the comment: Given that the class used to demonstrate this behavior has a bug (__len__ is inconsistent with __getitem__), I don't think it matters much -- if doing it your way is (as I suspect) slower than the current implementation for other (well-behaved) sequences, we should not change the implementation. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 10:21:39 2021 From: report at bugs.python.org (Akuli) Date: Tue, 27 Jul 2021 14:21:39 +0000 Subject: [issue44021] enum docs in 3.10: missing "New in version 3.10" In-Reply-To: <1620061310.33.0.417307154236.issue44021@roundup.psfhosted.org> Message-ID: <1627395699.59.0.765738900681.issue44021@roundup.psfhosted.org> Change by Akuli : ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:06:36 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Tue, 27 Jul 2021 15:06:36 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627368562.8.0.609178233641.issue44746@roundup.psfhosted.org> Message-ID: <1627398396.14.0.419110929631.issue44746@roundup.psfhosted.org> Steven D'Aprano added the comment: Confirmed that it is working in Linux. I assume Paul has tested it under Windows, and it sounds like Ronald has tested it in VS Code as well. I'm closing this as Not A Bug. Priyanshu, if you disagree and can replicate the error, this time checking the output buffer, please reply with a new example. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:17:53 2021 From: report at bugs.python.org (Roundup Robot) Date: Tue, 27 Jul 2021 15:17:53 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1627399073.62.0.69325838782.issue44559@roundup.psfhosted.org> Change by Roundup Robot : ---------- nosy: +python-dev nosy_count: 6.0 -> 7.0 pull_requests: +25922 pull_request: https://github.com/python/cpython/pull/27388 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:20:05 2021 From: report at bugs.python.org (Ethan Furman) Date: Tue, 27 Jul 2021 15:20:05 +0000 Subject: [issue44559] Enum: revert to 3.9 In-Reply-To: <1625363304.74.0.624005694289.issue44559@roundup.psfhosted.org> Message-ID: <1627399205.07.0.741138941894.issue44559@roundup.psfhosted.org> Ethan Furman added the comment: New changeset 2f54fbafa6481fb10528cb1d3d6b517ca2a4647f by Steffen Zeile in branch 'main': bpo-44559: [Enum] correct `versionadded` to 3.11 for new features (GH-27388) https://github.com/python/cpython/commit/2f54fbafa6481fb10528cb1d3d6b517ca2a4647f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:32:06 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Jul 2021 15:32:06 +0000 Subject: [issue43377] _PyErr_Display should be available in the CPython-specific API In-Reply-To: <1614717737.06.0.355391552087.issue43377@roundup.psfhosted.org> Message-ID: <1627399926.48.0.278125543132.issue43377@roundup.psfhosted.org> Petr Viktorin added the comment: If it should be exposed, it should be renamed to a public (non-underscored) name, like PyErr_DisplayToFile. It should also ideally get documentation and tests (along with PyErr_Display, which is sadly missing those as well). (Also, note that there are no no API/ABI compatibility guarantees if you use private API or define Py_BUILD_CORE. Functions like _PyErr_Display could change/disappear in a patch version of CPython.) ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:39:11 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Jul 2021 15:39:11 +0000 Subject: [issue43235] Tools/scripts/stable_abi.py should also check PC/python3dll.c (Windows stable ABI) In-Reply-To: <1613434410.7.0.341389987333.issue43235@roundup.psfhosted.org> Message-ID: <1627400351.65.0.0162787532035.issue43235@roundup.psfhosted.org> Petr Viktorin added the comment: Since PEP 652, PC/python3dll.c is generated from the stable ABI definition. Checking (i.e. running the tool without --generate) ensures it is up-to-date. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:42:54 2021 From: report at bugs.python.org (Petr Viktorin) Date: Tue, 27 Jul 2021 15:42:54 +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: <1627400574.07.0.914855329825.issue29298@roundup.psfhosted.org> Change by Petr Viktorin : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 11:48:02 2021 From: report at bugs.python.org (Priyanshu) Date: Tue, 27 Jul 2021 15:48:02 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627398396.14.0.419110929631.issue44746@roundup.psfhosted.org> Message-ID: Priyanshu added the comment: Ok, I'll check it out. Thank you for the response. On Tue, 27 Jul, 2021, 20:36 Steven D'Aprano, wrote: > > Steven D'Aprano added the comment: > > Confirmed that it is working in Linux. I assume Paul has tested it under > Windows, and it sounds like Ronald has tested it in VS Code as well. > > I'm closing this as Not A Bug. > > Priyanshu, if you disagree and can replicate the error, this time checking > the output buffer, please reply with a new example. > > ---------- > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 12:03:10 2021 From: report at bugs.python.org (Ammar Askar) Date: Tue, 27 Jul 2021 16:03:10 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627401790.6.0.434953407241.issue34013@roundup.psfhosted.org> Change by Ammar Askar : ---------- pull_requests: +25923 pull_request: https://github.com/python/cpython/pull/27390 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 12:19:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 16:19:31 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627402771.23.0.0751782874387.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 6948964ecf94e858448dd28eea634317226d2913 by Pablo Galindo Salgado in branch 'main': bpo-34013: Generalize the invalid legacy statement error message (GH-27389) https://github.com/python/cpython/commit/6948964ecf94e858448dd28eea634317226d2913 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 12:21:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 16:21:46 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627402906.26.0.92685993769.issue34013@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25924 pull_request: https://github.com/python/cpython/pull/27391 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 09:24:49 2021 From: report at bugs.python.org (Priyanshu) Date: Tue, 27 Jul 2021 13:24:49 +0000 Subject: [issue44746] Improper behaviour of 'finally' keyword In-Reply-To: <1627390346.55.0.520479260826.issue44746@roundup.psfhosted.org> Message-ID: Priyanshu added the comment: Really? Why is it not working for me then? I am using the latest version of VS code application. I have attached a screenshot,have a look at this. On Tue, Jul 27, 2021 at 6:22 PM Paul Moore wrote: > > Paul Moore added the comment: > > It works as expected (the print statement in the "finally" clause is > executed) for me. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- Added file: https://bugs.python.org/file50186/error.py - Visual Studio Code 27_07_2021 6_50_36 PM.png _______________________________________ Python tracker _______________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: error.py - Visual Studio Code 27_07_2021 6_50_36 PM.png Type: image/png Size: 84059 bytes Desc: not available URL: From report at bugs.python.org Tue Jul 27 12:30:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 16:30:44 +0000 Subject: [issue33896] Document what components make up the filecmp.cmp os.stat signature. In-Reply-To: <1529345931.78.0.56676864532.issue33896@psf.upfronthosting.co.za> Message-ID: <1627403444.49.0.425842496259.issue33896@roundup.psfhosted.org> Andrei Kulakov added the comment: Can be closed as a dupe of https://bugs.python.org/issue42958, which has a PR ready for review. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 12:33:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 16:33:16 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627403596.51.0.581950111343.issue34013@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25925 pull_request: https://github.com/python/cpython/pull/27392 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 12:34:24 2021 From: report at bugs.python.org (Pierre Quentel) Date: Tue, 27 Jul 2021 16:34:24 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627403664.03.0.463493996328.issue44741@roundup.psfhosted.org> Pierre Quentel added the comment: Oh, I did not invent this class, it is in the test script for pattern matching : https://github.com/python/cpython/blob/6948964ecf94e858448dd28eea634317226d2913/Lib/test/test_patma.py#L1932 With this class, [x, *_, y] matches, but not [x, *w, y] : this is what made me create this issue. Maybe it would be a good idea to change this class in test_patma.py ? OTOH, if the current implementation remains the same, why does the PEP insist on subjects having a len() ? Could sequence patterns match a wider range of subjects that can be unpacked ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 13:35:28 2021 From: report at bugs.python.org (Alex Waygood) Date: Tue, 27 Jul 2021 17:35:28 +0000 Subject: [issue44750] .popitem() is inconsistent in collections and collections.abc Message-ID: <1627407328.07.0.937784840037.issue44750@roundup.psfhosted.org> New submission from Alex Waygood : In a Python dictionary, `.popitem()` returns (key, value) pairs from the dictionary in a LIFO order. `collections.OrderedDict` and `collections.Counter` both do the same. However, a class inheriting from `collections.abc.MutableMapping` (which includes, in the standard library, `collections.UserDict`), will inherit a `.popitem()` method that returns (key, value) pairs in a FIFO order. In my opinion, this seems like unexpected behaviour, given that these classes are designed to emulate the API of a standard Python dict. The documentation for ordinary dictionaries states that `.popitem()` uses LIFO (https://docs.python.org/3/library/stdtypes.html#typesmapping), as does `collections.OrderedDict` (https://docs.python.org/3/library/collections.html#collections.OrderedDict). However, I can't find anything in the documentation for the collections.abc module (https://docs.python.org/3/library/collections.abc.html) or the docstring for `collections.abc.MutableMapping.popitem()` (https://github.com/python/cpython/blob/ae0a2b756255629140efcbe57fc2e714f0267aa3/Lib/_collections_abc.py#L964) that states that collections.abc.MutableMapping will use FIFO. Ditto for the collections.UserDict documentation/docstring: https://docs.python.org/3/library/collections.html#collections.UserDict, https://github.com/python/cpython/blob/6948964ecf94e858448dd28eea634317226d2913/Lib/collections/__init__.py#L1084. Is this expected/intended behaviour? I found it highly confusing when attempting to implement a custom data structure just now. I think a note in the docstring/documentation, noting that this is the behaviour, would certainly be useful. I have attached a minimal demonstration of this behaviour. Tests only done on Python 3.9. ---------- components: Library (Lib) files: collections popitem weirdness.py messages: 398310 nosy: AlexWaygood priority: normal severity: normal status: open title: .popitem() is inconsistent in collections and collections.abc type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50187/collections popitem weirdness.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 13:51:43 2021 From: report at bugs.python.org (hai shi) Date: Tue, 27 Jul 2021 17:51:43 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627408303.6.0.55621793411.issue42035@roundup.psfhosted.org> hai shi added the comment: > - there is still no way to get t.tp_name Can we create PyType_GetDataSlot function to return the data pointer? > If we go this way, why not add PyType_GetQualName as well? +1. I will create another PR after PR-23903 merged. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 13:52:50 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 17:52:50 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627408370.66.0.074987763204.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b977f8510e2ff4f11e3bda920722098a242fc8cc by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-34013: Generalize the invalid legacy statement error message (GH-27389). (GH-27391) https://github.com/python/cpython/commit/b977f8510e2ff4f11e3bda920722098a242fc8cc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 13:56:17 2021 From: report at bugs.python.org (Alex Waygood) Date: Tue, 27 Jul 2021 17:56:17 +0000 Subject: [issue44750] .popitem() is inconsistent in collections and collections.abc In-Reply-To: <1627407328.07.0.937784840037.issue44750@roundup.psfhosted.org> Message-ID: <1627408577.12.0.0595264792209.issue44750@roundup.psfhosted.org> Change by Alex Waygood : ---------- nosy: +rhettinger, stutzbach _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 14:10:05 2021 From: report at bugs.python.org (Thomas Grainger) Date: Tue, 27 Jul 2021 18:10:05 +0000 Subject: [issue37715] 2to3 set default encoding In-Reply-To: <1564467105.65.0.60061017687.issue37715@roundup.psfhosted.org> Message-ID: <1627409405.35.0.525408590073.issue37715@roundup.psfhosted.org> Thomas Grainger added the comment: lib2to3 is deprecated and is pending removal, so I think this can be closed ---------- nosy: +graingert _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 15:21:41 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Tue, 27 Jul 2021 19:21:41 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627413701.83.0.64226141381.issue42167@roundup.psfhosted.org> Andrei Kulakov added the comment: Note that SETUP_WITH doc was completely removed. Not sure if that was intentional (since the opcode itself still exists). ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 15:26:58 2021 From: report at bugs.python.org (Patrick Reader) Date: Tue, 27 Jul 2021 19:26:58 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627414018.8.0.0979873491197.issue42167@roundup.psfhosted.org> Patrick Reader added the comment: It was, at least partially, replaced by BEGIN_WITH for bpo-40222: https://github.com/python/cpython/commit/adcd2205565f91c6719f4141ab4e1da6d7086126#diff-eaa488fc50d23b30ca8b24ab19e9c91c1c941339847af993e908f006eec0653bL741 ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 16:30:44 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 20:30:44 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627417844.49.0.181897091012.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ecc3c8e4216958d85385bf2467441c975128f26c by Pablo Galindo Salgado in branch 'main': bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392) https://github.com/python/cpython/commit/ecc3c8e4216958d85385bf2467441c975128f26c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 16:31:04 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Jul 2021 20:31:04 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627417864.2.0.966760978715.issue34013@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 15.0 -> 16.0 pull_requests: +25926 pull_request: https://github.com/python/cpython/pull/27393 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 16:43:16 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Tue, 27 Jul 2021 20:43:16 +0000 Subject: [issue44750] .popitem() is inconsistent in collections and collections.abc In-Reply-To: <1627407328.07.0.937784840037.issue44750@roundup.psfhosted.org> Message-ID: <1627418596.68.0.0394499240784.issue44750@roundup.psfhosted.org> Raymond Hettinger added the comment: Alex, thank for noticing this, but it is not a bug. MutableMapping is meant to describe all mapping classes including those that don't remember insertion order. The builtin dict() type implements MutableMapping but also adds ordering guarantees. It is common and normal for concrete classes to implement additional behaviors and guarantees beyond those specified in the abstract base class. ---------- assignee: -> rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:19:55 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Jul 2021 21:19:55 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627420795.37.0.885066175121.issue34013@roundup.psfhosted.org> miss-islington added the comment: New changeset 68e3dca0687c4c8e61ed98aed82f81049880c0ce by Miss Islington (bot) in branch '3.10': bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392) https://github.com/python/cpython/commit/68e3dca0687c4c8e61ed98aed82f81049880c0ce ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:20:00 2021 From: report at bugs.python.org (Alex Waygood) Date: Tue, 27 Jul 2021 21:20:00 +0000 Subject: [issue44750] .popitem() is inconsistent in collections and collections.abc In-Reply-To: <1627407328.07.0.937784840037.issue44750@roundup.psfhosted.org> Message-ID: <1627420800.03.0.660113957664.issue44750@roundup.psfhosted.org> Alex Waygood added the comment: Thanks, Raymond -- that makes sense, and seems very fair. I still think a note somewhere in the documentation stating this might be helpful -- as a user, it wasn't what I was expecting. I would argue this is especially true for UserDict, a class which the name implies will be extremely `dict`-like in behaviour. Just my two cents, though. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:20:34 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 21:20:34 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627420834.71.0.108551526507.issue34013@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 Jul 27 17:22:25 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Tue, 27 Jul 2021 21:22:25 +0000 Subject: [issue43377] _PyErr_Display should be available in the CPython-specific API In-Reply-To: <1614717737.06.0.355391552087.issue43377@roundup.psfhosted.org> Message-ID: <1627420945.31.0.4610652997.issue43377@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: PyErr_Display is not exposed partially because is full of small details of the interpreter and we change it constantly without regard for backwards compatibility on purpose. Exposing it will restrict us a lot on how we display error messages or the arguments it may take, so I woulf prefer to not expose it. ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:23:37 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Tue, 27 Jul 2021 21:23:37 +0000 Subject: [issue44751] crypt.h should be in _cryptmodule.c, not in public header Message-ID: <1627421017.82.0.756095200608.issue44751@roundup.psfhosted.org> New submission from Geoffrey Thomas : In #32635, it was discovered that _cryptmodule.c was missing a dependency on crypt.h, which caused it to segfault when it was missing the proper prototype for crypt. This was fixed by adding an #include to Python.h. This include doesn't need to be in the public header; it only needs to be in _cryptmodule.c. Removing it from the public header is helpful for packagers, because it means that the libpython-dev (or whatever) package doesn't need a dependency on libcrypt-dev, only on the libcrypt runtime library. ---------- components: C API messages: 398321 nosy: geofft priority: normal severity: normal status: open title: crypt.h should be in _cryptmodule.c, not in public header versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:32:14 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Tue, 27 Jul 2021 21:32:14 +0000 Subject: [issue44751] crypt.h should be in _cryptmodule.c, not in public header In-Reply-To: <1627421017.82.0.756095200608.issue44751@roundup.psfhosted.org> Message-ID: <1627421534.29.0.692974562614.issue44751@roundup.psfhosted.org> Change by Geoffrey Thomas : ---------- keywords: +patch pull_requests: +25927 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27394 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:33:23 2021 From: report at bugs.python.org (Geoffrey Thomas) Date: Tue, 27 Jul 2021 21:33:23 +0000 Subject: [issue32635] test_crypt segfaults when using libxcrypt instead of libcrypt In-Reply-To: <1516702927.0.0.467229070634.issue32635@psf.upfronthosting.co.za> Message-ID: <1627421603.92.0.891975275531.issue32635@roundup.psfhosted.org> Geoffrey Thomas added the comment: Opened #44751 and https://github.com/python/cpython/pull/27394 . ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:41:47 2021 From: report at bugs.python.org (Ryan Pecor) Date: Tue, 27 Jul 2021 21:41:47 +0000 Subject: [issue44752] Tab completion executes @property getter function Message-ID: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> New submission from Ryan Pecor : After making a class using the @property decorator to implement a getter, using tab completion that matches the getter function name executes the function. See below for example (line numbers added, indicates when the user presses the tab key): 1 >>> class Foo(object): 2 ... def __init__(self,value): 3 ... self.value = value 4 ... @property 5 ... def print_value(self): 6 ... print("Foo has a value of {}".format(self.value)) 7 ... 8 >>> bar = Foo(4) 9 >>> bar.~~~Foo has a value of 4~~~ 10 ~~~Foo has a value of 4~~~ 11 12 bar.print_value bar.value 13 >>> bar.p~~~Foo has a value of 4~~~ 14 rint_value~~~Foo has a value of 4~~~ 15 ~~~Foo has a value of 4~~~ 16 17 bar.print_value 18 >>> bar.value I pressed tab after typing "bar." in line 9. It then printed the remainder of line 9 and moved the cursor to line 10. Pressing tab again prints line 10 and 11 before finally showing the expected output on line 12. lines 13-17 follow the same steps, but after typing "bar.p" to show that it happens whenever you tab and it matches the getter. Line 18 shows a correct tab completion resulting from hitting tab after typing "bar.v" which does not match the getter function. ---------- components: Interpreter Core messages: 398323 nosy: RPecor priority: normal severity: normal status: open title: Tab completion executes @property getter function type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:46:32 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Tue, 27 Jul 2021 21:46:32 +0000 Subject: [issue44688] [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation() In-Reply-To: <1626815639.0.0.124949004074.issue44688@roundup.psfhosted.org> Message-ID: <1627422392.52.0.807235651325.issue44688@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- keywords: +patch pull_requests: +25928 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27395 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 17:54:40 2021 From: report at bugs.python.org (Ryan Pecor) Date: Tue, 27 Jul 2021 21:54:40 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627422880.14.0.437251347091.issue44752@roundup.psfhosted.org> Ryan Pecor added the comment: I forgot to mention that I also added "~~~" to either side of the printed string every time it printed to help differentiate the printed string from commands that I typed into the interpreter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 18:31:37 2021 From: report at bugs.python.org (Alexander Smirnov) Date: Tue, 27 Jul 2021 22:31:37 +0000 Subject: [issue43344] RotatingFileHandler breaks file type associations In-Reply-To: <1614465857.24.0.529577943251.issue43344@roundup.psfhosted.org> Message-ID: <1627425097.44.0.101913525279.issue43344@roundup.psfhosted.org> Alexander Smirnov added the comment: the problem with namer solution is that it will stop respecting backupCount parameter ---------- nosy: +alexander.smirnoff _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 18:37:55 2021 From: report at bugs.python.org (Alexander Smirnov) Date: Tue, 27 Jul 2021 22:37:55 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified Message-ID: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> New submission from Alexander Smirnov : after adding namer callable (like it is described in https://bugs.python.org/issue43344) to log handler configuration, it stopped removing old files log_filename = os.path.join(log_dir, "application.log") log_handler = logging.handlers.TimedRotatingFileHandler(log_filename, when='MIDNIGHT', interval=1, backupCount=7) // after adding this line, old files are not deleted log_handler.namer = lambda name: name.replace(".log", "") + ".log" ---------- components: Library (Lib) messages: 398326 nosy: alexander.smirnoff priority: normal severity: normal status: open title: backupCount is not respected in TimedRotatingFileHandler when namer is specified versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 18:39:20 2021 From: report at bugs.python.org (Jack DeVries) Date: Tue, 27 Jul 2021 22:39:20 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627425560.83.0.84619690912.issue44752@roundup.psfhosted.org> Jack DeVries added the comment: Woah, til the python shell has tab completion! This does seem like undesirable behavior. I'd like to work on a fix for this if that's all right, assuming that this behavior should not occur. I haven't exactly found where the tab autocomplete is implemented, but I'm assuming I'll find in one of the functions I see in the backtrace when I pause python at the interpreter prompt; maybe one of these? (my best quick guesses by function name). - _PyRun_InteractiveLoopObject - PyRun_InteractiveOneObjectEx - interactive_rule - statement_newline_rule If anyone can point me in the right direction, that'd be great, and I think I can work on this one tomorrow if that's all right! ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 18:58:40 2021 From: report at bugs.python.org (miss-islington) Date: Tue, 27 Jul 2021 22:58:40 +0000 Subject: [issue44751] crypt.h should be in _cryptmodule.c, not in public header In-Reply-To: <1627421017.82.0.756095200608.issue44751@roundup.psfhosted.org> Message-ID: <1627426720.73.0.266401934331.issue44751@roundup.psfhosted.org> miss-islington added the comment: New changeset 196998e220d6ca030e5a1c8ad63fcaed8e049a98 by Geoffrey Thomas in branch 'main': closes bpo-44751: Move crypt.h include from public header to _cryptmodule (GH-27394) https://github.com/python/cpython/commit/196998e220d6ca030e5a1c8ad63fcaed8e049a98 ---------- nosy: +miss-islington resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 19:23:07 2021 From: report at bugs.python.org (Mark Gluzman) Date: Tue, 27 Jul 2021 23:23:07 +0000 Subject: [issue44754] Documentation for pop in Built-in Types Message-ID: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> New submission from Mark Gluzman : Python documentation: v.3.9.6 The Python Standard Library >> Built-in Types >> Mutable Sequence Types The table says that 'pop' operation should be written as s.pop([i]) The right way to do it is s.pop(i) ---------- assignee: docs at python components: Documentation messages: 398329 nosy: docs at python, mark-gluzman priority: normal severity: normal status: open title: Documentation for pop in Built-in Types versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 19:31:29 2021 From: report at bugs.python.org (Ryan Pecor) Date: Tue, 27 Jul 2021 23:31:29 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627428689.19.0.873459899874.issue44752@roundup.psfhosted.org> Ryan Pecor added the comment: It looks to me like the issue is caused by the eval() in line 155 of the rlcompleter.py file (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L155) which runs the function in order to see if it runs or raises an exception. I thought maybe replacing it with hasattr() might work, but it looks like the issue is repeated there as well! >>> hasattr(bar, "print_value") Foo has a value of 4 True This goes over to the C side of things now (https://github.com/python/cpython/blob/196998e220d6ca030e5a1c8ad63fcaed8e049a98/Python/bltinmodule.c#L1162) and I'll put in another issue regarding that! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 19:58:43 2021 From: report at bugs.python.org (Ryan Pecor) Date: Tue, 27 Jul 2021 23:58:43 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627430323.13.0.0786165888773.issue44752@roundup.psfhosted.org> Ryan Pecor added the comment: Actually, hasattr() specifically states that it uses getattr() so that behavior is expected from getattr() so I will not be creating a separate issue for that. Now that I see hasattr() uses getattr(), it looks like the tab completion issue might not stem from line 155, but from line 180 (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180) where it calls getattr(). A possible fix to the tab completion issue might be to add to/expand the warning about evaluating arbitrary C code (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L145) when using tab to autocomplete. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:06:03 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 28 Jul 2021 00:06:03 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627430763.65.0.87537178157.issue44600@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +25929 pull_request: https://github.com/python/cpython/pull/27396 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:17:11 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 00:17:11 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1627431431.25.0.681742508948.issue44681@roundup.psfhosted.org> Steve Dower added the comment: > Maybe it would be useful to implement something like this in time.sleep() itself, but I don't know whether the need in a few cases warrants the increased complexity and cost in general. It certainly wouldn't be worth the power and CPU usage impact that people would inevitable get tricked into causing ("why is Python always using 100% of my CPU!?"). So as long as I'm around, feel free to consider that idea rejected ;) We'll improve the resolution of sleep when the operating system does. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:20:48 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 00:20:48 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627431648.23.0.902577382277.issue44479@roundup.psfhosted.org> Steve Dower added the comment: > Would it be OK to run python in externals folder instead ? No, because it needs to freeze with the current build. However, we should definitely not regenerate anything when "$(Configuration) == 'PGUpdate'". Checking that in regen.targets should prevent the issue. ---------- resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:24:29 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 00:24:29 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1627431869.02.0.000503587487891.issue44070@roundup.psfhosted.org> Steve Dower added the comment: > do you know what the correct usage of importlib.util.spec_from_file_location is to match importlib.import_module ? Maybe I'm misreading your example, but isn't the correct usage here to pass an absolute location= argument? Or are you suggesting that spec_from_file_location should also make it absolute (in 3.10 and later, since this change has already been reverted in 3.8-9). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:52:08 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 00:52:08 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627433528.85.0.366740945021.issue44600@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25930 pull_request: https://github.com/python/cpython/pull/27397 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 20:51:58 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 28 Jul 2021 00:51:58 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627433518.98.0.654516104398.issue44600@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 38ddc8beb38d9a685de296a58b0741850e4853e5 by Brandt Bucher in branch 'main': bpo-44600: Refactor new tracing tests (GH-27396) https://github.com/python/cpython/commit/38ddc8beb38d9a685de296a58b0741850e4853e5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:02:05 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 01:02:05 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627434125.36.0.919281906067.issue44754@roundup.psfhosted.org> Dennis Sweeney added the comment: The [square brackets] are used to denote *optional* arguments throughout the documentation. A tutorial page (https://docs.python.org/3/tutorial/controlflow.html#id1) has this to say: list.pop([i]) Remove the item at the given position in the list, and return it. If no index is specified, a.pop() removes and returns the last item in the list. (The square brackets around the i in the method signature denote that the parameter is optional, not that you should type square brackets at that position. You will see this notation frequently in the Python Library Reference.) I can open a PR to try to make the "Built-in Types" page you looked at a little clearer. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:05:16 2021 From: report at bugs.python.org (David Duffy) Date: Wed, 28 Jul 2021 01:05:16 +0000 Subject: [issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem? Message-ID: <1627434316.29.0.740067816285.issue44755@roundup.psfhosted.org> New submission from David Duffy : https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html led me to change to lo+(lo+hi)/2 - would this affect bisect.py??? ---------- components: Library (Lib) messages: 398337 nosy: David.Duffy priority: normal severity: normal status: open title: cpython Lib bisect.py overflow (lo + hi) // 2 a problem? type: behavior versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:15:29 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 01:15:29 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627434929.07.0.159097208838.issue44754@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +25931 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27398 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:21:40 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 01:21:40 +0000 Subject: [issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem? In-Reply-To: <1627434316.29.0.740067816285.issue44755@roundup.psfhosted.org> Message-ID: <1627435300.61.0.49526751978.issue44755@roundup.psfhosted.org> Dennis Sweeney added the comment: This is a good idea for languages where integers are bounded, but in Python, integers can be as large as you want, so there's no reason to worry about overflow: >>> lo = 1 * 10**100 >>> hi = 2 * 10**100 >>> (lo + hi) // 2 15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:25:19 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 01:25:19 +0000 Subject: [issue44755] cpython Lib bisect.py overflow (lo + hi) // 2 a problem? In-Reply-To: <1627434316.29.0.740067816285.issue44755@roundup.psfhosted.org> Message-ID: <1627435519.97.0.890064627927.issue44755@roundup.psfhosted.org> Dennis Sweeney added the comment: Thanks for the concern, but I'll close this as "not a bug". Feel free to re-open if you can give an example where the current code fails. ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:52:10 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 28 Jul 2021 01:52:10 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627437130.72.0.479074299473.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7 by Jason R. Coombs in branch 'main': bpo-44461: Check early that a pdb target is valid for execution. (#27227) https://github.com/python/cpython/commit/ee03bad25e83b00ba5fc2a0265b48c6286e6b3f7 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 21:59:37 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 28 Jul 2021 01:59:37 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627437577.55.0.971925940091.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25932 pull_request: https://github.com/python/cpython/pull/27399 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 22:02:36 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 28 Jul 2021 02:02:36 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627437756.49.0.820536721757.issue44461@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25933 pull_request: https://github.com/python/cpython/pull/27400 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 22:41:49 2021 From: report at bugs.python.org (Benjamin Peterson) Date: Wed, 28 Jul 2021 02:41:49 +0000 Subject: [issue37715] 2to3 set default encoding In-Reply-To: <1564467105.65.0.60061017687.issue37715@roundup.psfhosted.org> Message-ID: <1627440109.64.0.964140525548.issue37715@roundup.psfhosted.org> Change by Benjamin Peterson : ---------- resolution: -> wont fix stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 23:02:36 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 03:02:36 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627441356.59.0.344374337688.issue44752@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27401 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Tue Jul 27 23:12:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 03:12:33 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627441953.65.0.339685440421.issue44752@roundup.psfhosted.org> Jack DeVries added the comment: > Now that I see hasattr() uses getattr(), it looks like the tab completion issue might not stem from line 155, but from line 180 (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180) where it calls getattr(). That is correct! I was able to fix the undesirable behavior by adding an early exit condition if we appear to have a property object. I checked for the existence of a property object like this: class Foo: @property def bar(self): return 'baz' def is_property(object, attr): return isinstance(getattr(type(object), attr, None), property) assert is_property(Foo(), 'bar') The code that follows line 180 in the loop just checks if ``object.attribute`` is callable, and whether the callable takes arguments in order to determine whether to add parenthesis to the completion. In my opinion, we never really want to add parenthesis when providing completion for a property attribute anyway, so there's no reason to go through that code block if we are dealing with a property. I opened a GitHub PR. Let me know what you think! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:10:56 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 04:10:56 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627445456.33.0.0343746273763.issue42167@roundup.psfhosted.org> Dennis Sweeney added the comment: Opcodes change from one version to another. You linked the Python 3.9 documentation. Python 3.9 opcodes are listed here: https://github.com/python/cpython/blob/3.9/Lib/opcode.py (and you can browse the branches and commit history for that file). 3.9 has SETUP_WITH, but not WITH_CLEANUP_START, so that particular doc entry is all that needs to change (assuming I'm not missing anything), since it wasn't updated during GH-6641. I'll open a PR against the 3.9 docs. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:33:39 2021 From: report at bugs.python.org (Ryan Pecor) Date: Wed, 28 Jul 2021 04:33:39 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627446819.05.0.0167383612944.issue44752@roundup.psfhosted.org> Ryan Pecor added the comment: Wow, that was quick and the code looks clean too! Thanks for fixing that up! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:40:27 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 04:40:27 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627447227.0.0.151239310413.issue42167@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- keywords: +patch pull_requests: +25935 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27402 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:47:26 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 04:47:26 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" Message-ID: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> New submission from Jack DeVries : In Doc/Makefile, all of the build rules should be dependent on the existence of a virtual environment. I could see this being controversial, because folks who have these tools installed elsewhere might prefer not to have a venv made for them, but my personal workflow is to strive to keep my system site-packages folder as empty as possible and to use virtual environments frequently. In any case, I'm interested to hear what we think. Momentarily, I will attach a PR where I went ahead and made these changes. Here is a summary of the changes: - venv rule is now conditional, and only does anything if $VENVDIR does not exist - add rule "clean-venv". This can be removed ??what do you all think? - build rule is dependent on venv - as a result, rules dependent on build are dependent on venv - html - latex - etc. - update Doc/README.rst appropriately. Now users only need to type ``make html`` ??nice! Let me know what you think. I may have a blind spot to others' workflows! Also, I'm not a Windows user, so I have no insight as to whether ``make.bat`` needs to be updated as well. ---------- assignee: docs at python components: Demos and Tools, Documentation messages: 398344 nosy: docs at python, jack__d priority: normal severity: normal status: open title: In ./Doc, "make html" and "make build" should depend on "make venv" type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:55:22 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Wed, 28 Jul 2021 04:55:22 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627448122.71.0.0453105291402.issue42167@roundup.psfhosted.org> Dennis Sweeney added the comment: GH-24334 already applied the necessary change for 3.10. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:57:31 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 04:57:31 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627448251.3.0.129253469721.issue44756@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25936 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27403 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 00:57:55 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 04:57:55 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627448275.65.0.995161659845.issue44600@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25937 pull_request: https://github.com/python/cpython/pull/27404 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 01:01:19 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Wed, 28 Jul 2021 05:01:19 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1627448479.41.0.00879948855797.issue44098@roundup.psfhosted.org> Serhiy Storchaka added the comment: I am writing a patch which generalizes and significantly simplifies the code for type variables and parameter specifications substitution, and opens a way for more runtime validation. But it is incompatible with these changes. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 02:37:24 2021 From: report at bugs.python.org (=?utf-8?b?8J+WpEJsYWNrIEpva2Vy8J+WpA==?=) Date: Wed, 28 Jul 2021 06:37:24 +0000 Subject: [issue44757] Insecure Deserialization Message-ID: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org> New submission from ?Black Joker? : There are a number of techniques for reading external files and loading their content into (de/serializing) Python objects. Pickle is one such powerful serialization technique that is inherently risky, especially when an attacker tampers with serialized data. Data from external sources is never secure. As a rule of thumb, never unpickle or parse data from an untrusted source into Python objects. This is because an attacker can use a subprocess module to execute arbitrary commands during pickling. Additionally, YAML files from user input can leave your application open to attacks. To avoid this, use PyYAML safe_loadfunction (yaml.safe_load) to handle YAML serialization. Here is a simple custom code that can be used to find all unsafe yaml.load functions in your codebase. ---------- components: Tests messages: 398347 nosy: joker priority: normal severity: normal status: open title: Insecure Deserialization versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 02:39:12 2021 From: report at bugs.python.org (Thomas Grainger) Date: Wed, 28 Jul 2021 06:39:12 +0000 Subject: [issue44070] __file__ is now fully qualified in 3.8 and 3.9 In-Reply-To: <1620417589.1.0.903069874446.issue44070@roundup.psfhosted.org> Message-ID: <1627454352.38.0.884918171314.issue44070@roundup.psfhosted.org> Thomas Grainger added the comment: Yep that's the fix I went for in the end https://github.com/twisted/twisted/pull/1628/files#diff-81177770fe13865c1f305bb999e82cd7514b2e7269f41087bd7ef39c3d6de508R105 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 02:39:00 2021 From: report at bugs.python.org (=?utf-8?b?8J+WpEJsYWNrIEpva2Vy8J+WpA==?=) Date: Wed, 28 Jul 2021 06:39:00 +0000 Subject: [issue44757] Insecure Deserialization In-Reply-To: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org> Message-ID: <1627454340.03.0.501207241957.issue44757@roundup.psfhosted.org> Change by ?Black Joker? : Added file: https://bugs.python.org/file50188/1_9WKsHGuOMbSsXo24PZepuw.png _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 02:51:30 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 28 Jul 2021 06:51:30 +0000 Subject: [issue44757] Insecure Deserialization In-Reply-To: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org> Message-ID: <1627455090.09.0.054529422805.issue44757@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Joker. Please don't post screenshots and images of code. It is difficult or impossible for the visually impaired and blind to view with a screen reader, and as we don't use Photoshop to edit code, it makes it hard to copy and run the code. Your code is full of syntax errors. Out of three lines of code, I count that two of them will fail with a SyntaxError and the third is probably going to fail with ImportError. What if, instead of calling `yaml.load`, I use something like `from yaml import load` or `import yaml as y` instead? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 02:52:17 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 28 Jul 2021 06:52:17 +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: <1627455137.77.0.652318870664.issue42853@roundup.psfhosted.org> Change by Inada Naoki : ---------- keywords: +patch pull_requests: +25938 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27405 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 03:04:52 2021 From: report at bugs.python.org (=?utf-8?b?8J+WpEJsYWNrIEpva2Vy8J+WpA==?=) Date: Wed, 28 Jul 2021 07:04:52 +0000 Subject: [issue44757] Insecure Deserialization In-Reply-To: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org> Message-ID: <1627455892.34.0.478466177717.issue44757@roundup.psfhosted.org> ?Black Joker? added the comment: Hi Steven D'Aprano, well first of all thank you to posting reply on this. Could please fix this follwoing errors of the code? import python from CallNode call where call = value::named("yaml.load").getACall() where call.getrNode(), "yaml.load function is unsafe when loading data from untrusted sources. Use yaml.safe_load instead" ---------- resolution: -> wont fix _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 03:14:58 2021 From: report at bugs.python.org (=?utf-8?b?8J+WpEJsYWNrIEpva2Vy8J+WpA==?=) Date: Wed, 28 Jul 2021 07:14:58 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627456498.84.0.455548757783.issue44748@roundup.psfhosted.org> ?Black Joker? added the comment: I would like to use argparse to parse boolean command-line arguments written as "--foo True" or "--foo False". For example: my_program --my_boolean_flag False However, the following test code does not do what I would like: import argparse parser = argparse.ArgumentParser(description="My parser") parser.add_argument("--my_bool", type=bool) cmd_line = ["--my_bool", "False"] parsed_args = parser.parse(cmd_line) ---------- components: +Tests -Library (Lib) nosy: +joker versions: +Python 3.9 -Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 03:19:50 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 28 Jul 2021 07:19:50 +0000 Subject: [issue44681] time.sleep(0.001) not working properly In-Reply-To: <1626750279.58.0.537841916177.issue44681@roundup.psfhosted.org> Message-ID: <1627456790.35.0.616639381865.issue44681@roundup.psfhosted.org> Eryk Sun added the comment: > It certainly wouldn't be worth the power and CPU usage > impact that people would inevitable get tricked into > causing To clarify, only short waits such as time.sleep(0.001) would busy loop. Waits longer than say 50 ms would call WaitForSingleObjectEx() or Sleep() with the wait time minus 50, and then busy loop until the deadline. So time.sleep(1) would wait the thread for 95% of the interval. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 03:20:21 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 28 Jul 2021 07:20:21 +0000 Subject: [issue44757] Insecure Deserialization In-Reply-To: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org> Message-ID: <1627456821.67.0.839357938187.issue44757@roundup.psfhosted.org> Steven D'Aprano added the comment: This is a bug tracker, not a community help desk or forum to discuss code you would like to write but don't know how. I suggest you subscribe to the Python-List mailing list, or go to Reddit's r/learnpython, as post there to discuss this. But you might want to do the Python tutorial first, because the code you have written is not even close to valid Python. https://mail.python.org/mailman/listinfo/python-list https://www.reddit.com/r/learnpython/ https://docs.python.org/3/tutorial/index.html ---------- resolution: wont fix -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 03:37:45 2021 From: report at bugs.python.org (Antel) Date: Wed, 28 Jul 2021 07:37:45 +0000 Subject: [issue44758] Why " True != 3 in [3] " is True? Message-ID: <1627457865.31.0.843205234519.issue44758@roundup.psfhosted.org> New submission from Antel <410828726 at qq.com>: >>> (True != 3) in [3] False >>> True != (3 in [3]) False >>> True != 3 in [3] True ---------- components: Tests messages: 398354 nosy: Antelx priority: normal severity: normal status: open title: Why " True != 3 in [3] " is True? type: performance versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 04:24:50 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 28 Jul 2021 08:24:50 +0000 Subject: [issue43377] _PyErr_Display should be available in the CPython-specific API In-Reply-To: <1614717737.06.0.355391552087.issue43377@roundup.psfhosted.org> Message-ID: <1627460690.35.0.106694358561.issue43377@roundup.psfhosted.org> Petr Viktorin added the comment: PyErr_Display (without underscore) is already exposed. This issue is about adding a variant with an additional output file argument. The function formats an exception "just as Python would". The exact output will naturally be different between versions, but the function is still useful. I'm also not sold on the "the arguments it may take" restriction: - exceptions generally carry all of their context around - even if they don't in the future, we'll always need a function that takes "just" an exception, for cases where some additional context isn't available ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 04:51:13 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Wed, 28 Jul 2021 08:51:13 +0000 Subject: [issue43377] _PyErr_Display should be available in the CPython-specific API In-Reply-To: <1614717737.06.0.355391552087.issue43377@roundup.psfhosted.org> Message-ID: <1627462273.18.0.808312066691.issue43377@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > PErr_Display (without underscore) is already exposed. > This issue is about adding a variant with an additional output file argument. Oh, I was not aware of that :( Apologies for the confusion! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 04:55:12 2021 From: report at bugs.python.org (=?utf-8?q?Stephan_B=C3=B6kelmann?=) Date: Wed, 28 Jul 2021 08:55:12 +0000 Subject: [issue44759] ctype generates misleading error-msg opening lib.so when compiled for wrong arch Message-ID: <1627462512.53.0.0502908883439.issue44759@roundup.psfhosted.org> New submission from Stephan B?kelmann : When trying to open a lib.so that has been compiled for a different architecture an error-msg is emitted saying. "no such file or directory" this is misleading behavior. changing the error-msg to. "library not compatible with architecture" would have saved me an hour of work ;) ---------- components: ctypes messages: 398357 nosy: stephan.boekelmann priority: normal severity: normal status: open title: ctype generates misleading error-msg opening lib.so when compiled for wrong arch type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 04:55:37 2021 From: report at bugs.python.org (Thermi) Date: Wed, 28 Jul 2021 08:55:37 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627462537.44.0.832617682424.issue44748@roundup.psfhosted.org> Thermi added the comment: joker, that is a different issue from the one described here. Please open your own. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 05:10:48 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 28 Jul 2021 09:10:48 +0000 Subject: [issue44758] Why " True != 3 in [3] " is True? In-Reply-To: <1627457865.31.0.843205234519.issue44758@roundup.psfhosted.org> Message-ID: <1627463448.83.0.376214237424.issue44758@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Antel, thank you for your submission but this is not a bug. This is a bug tracker for reporting bugs, not a help desk to ask for help understanding code. There are many forums where you can ask for help, I suggest that you could try places like the Python-List mailing list or Reddit. https://mail.python.org/mailman/listinfo/python-list https://www.reddit.com/r/learnpython/ The three code snippets you show are all correct. In the first case, you are comparing True != 3, which is True, and then testing whether True is in [3], which it is not. In the second you compute (3 in [3]), which is True, then test True != True, which is False. Lastly you do a *chained comparison* `True != 3 in [3]` which is equivalent to `(True != 3) and (3 in [3])` which is True. ---------- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 05:14:20 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 28 Jul 2021 09:14:20 +0000 Subject: [issue44758] Why " True != 3 in [3] " is True? In-Reply-To: <1627457865.31.0.843205234519.issue44758@roundup.psfhosted.org> Message-ID: <1627463660.0.0.836240205417.issue44758@roundup.psfhosted.org> Steven D'Aprano added the comment: BTW, chained comparisons are usually written like this: 0 <= x <= 100 a == b == c spam is eggs is None or similar. They do look weird and confusing when they include the `in` operator. Best not to write chained comparisons involving the `in` operator or other strange combinations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 05:15:30 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 28 Jul 2021 09:15:30 +0000 Subject: [issue44747] Refactor usage of sys._getframe at typing module In-Reply-To: <1627376689.96.0.280713555823.issue44747@roundup.psfhosted.org> Message-ID: <1627463730.9.0.100974543654.issue44747@roundup.psfhosted.org> Change by Ken Jin : ---------- title: Reduce usage of sys._getframe at typing module -> Refactor usage of sys._getframe at typing module _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 05:31:01 2021 From: report at bugs.python.org (Ray Kinane) Date: Wed, 28 Jul 2021 09:31:01 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict Message-ID: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> New submission from Ray Kinane : In the Turtle module, there are 2 methods named "clear", one for turtle objects and one for screen objects. In the Turtle module documentation, in the contents section, in the "Turtle methods" section, under "More drawing control" the clear() method hyperlink does not point to the correct section in the article. It points to the section for the clear method for screen objects. There is another identical hyperlink issue in the same article due to 2 methods with the same name: "reset" ---------- assignee: docs at python components: Documentation messages: 398361 nosy: docs at python, ray_giraffe priority: normal severity: normal status: open title: Turtle Documentation - Contents Hyperlink conflict 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 Jul 28 05:37:10 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Jul 2021 09:37:10 +0000 Subject: [issue44759] ctype generates misleading error-msg opening lib.so when compiled for wrong arch In-Reply-To: <1627462512.53.0.0502908883439.issue44759@roundup.psfhosted.org> Message-ID: <1627465030.44.0.25952225134.issue44759@roundup.psfhosted.org> Eric V. Smith added the comment: I don't think we get enough information from the operating system in order to generate the message that you'd like to see, unfortunately. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 05:52:14 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 09:52:14 +0000 Subject: [issue43344] RotatingFileHandler breaks file type associations In-Reply-To: <1614465857.24.0.529577943251.issue43344@roundup.psfhosted.org> Message-ID: <1627465934.41.0.230132275345.issue43344@roundup.psfhosted.org> Vinay Sajip added the comment: > the problem with namer solution is that it will stop respecting backupCount parameter Not necessarily, as far as I can tell. Can you give a specific rationale for your statement - how does that happen, if the namer has been implemented carefully enough? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:03:45 2021 From: report at bugs.python.org (=?utf-8?q?Stephan_B=C3=B6kelmann?=) Date: Wed, 28 Jul 2021 10:03:45 +0000 Subject: [issue44759] ctype generates misleading error-msg opening lib.so when compiled for wrong arch In-Reply-To: <1627462512.53.0.0502908883439.issue44759@roundup.psfhosted.org> Message-ID: <1627466625.7.0.870385125011.issue44759@roundup.psfhosted.org> Stephan B?kelmann added the comment: my fault! I am running Ubuntu 18 in WSL >> uname -a Linux 4.4.0-22000-Microsoft #1-Microsoft Fri Jun 04 16:28:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:06:10 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 28 Jul 2021 10:06:10 +0000 Subject: [issue44761] NewType __module__ name Message-ID: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: This issue related to https://bugs.python.org/issue44353 By default `__module__` attribute of a `NewType` is set to "typing" but in other typing classes it set to "__main__". ---------- components: Library (Lib) messages: 398365 nosy: kj, uriyyo priority: normal severity: normal status: open title: NewType __module__ name type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:06:21 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 28 Jul 2021 10:06:21 +0000 Subject: [issue44761] NewType __module__ name default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627466781.9.0.659335137928.issue44761@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- title: NewType __module__ name -> NewType __module__ name default value _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:12:11 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 28 Jul 2021 10:12:11 +0000 Subject: [issue44761] NewType __module__ name default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627467131.62.0.858628282424.issue44761@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25939 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27406 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:23:18 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:23:18 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627467798.05.0.5682818226.issue44399@roundup.psfhosted.org> Change by Vinay Sajip : ---------- pull_requests: +25940 pull_request: https://github.com/python/cpython/pull/27407 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:46:03 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:46:03 +0000 Subject: [issue44473] logging.handlers.QueueHandler acts unexpected In-Reply-To: <1624280678.3.0.314490541758.issue44473@roundup.psfhosted.org> Message-ID: <1627469163.62.0.258685134842.issue44473@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:47:09 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:47:09 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627469229.46.0.454296730626.issue44399@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 174fbd85f60d7877d3a4f58214a852209f8dfbea by Vinay Sajip in branch 'main': bpo-44399: Document another example of unexpected behavior. (GH-27407) https://github.com/python/cpython/commit/174fbd85f60d7877d3a4f58214a852209f8dfbea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:48:11 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:48:11 +0000 Subject: [issue44399] log rotator cookbook example might waste disk space In-Reply-To: <1623441016.81.0.46745114.issue44399@roundup.psfhosted.org> Message-ID: <1627469291.93.0.911566768499.issue44399@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:48:50 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:48:50 +0000 Subject: [issue43184] Missing docs for LoggerAdapter manager and name property In-Reply-To: <1612946231.77.0.582069652374.issue43184@roundup.psfhosted.org> Message-ID: <1627469330.4.0.503113572887.issue43184@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 06:49:34 2021 From: report at bugs.python.org (Vinay Sajip) Date: Wed, 28 Jul 2021 10:49:34 +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: <1627469374.5.0.885029508256.issue44388@roundup.psfhosted.org> Change by Vinay Sajip : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 07:19:26 2021 From: report at bugs.python.org (=?utf-8?q?Stephan_B=C3=B6kelmann?=) Date: Wed, 28 Jul 2021 11:19:26 +0000 Subject: [issue44759] ctype generates misleading error-msg opening lib.so when compiled for wrong arch In-Reply-To: <1627462512.53.0.0502908883439.issue44759@roundup.psfhosted.org> Message-ID: <1627471166.54.0.647322513904.issue44759@roundup.psfhosted.org> Stephan B?kelmann added the comment: Fail. Didn't read your reply carefully enough. You wasn't asking for my info. Thanks anyway ---------- stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 07:42:11 2021 From: report at bugs.python.org (Yurii Karabas) Date: Wed, 28 Jul 2021 11:42:11 +0000 Subject: [issue44761] NewType __module__ attr default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627472531.62.0.0991057611996.issue44761@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- title: NewType __module__ name default value -> NewType __module__ attr default value _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 08:38:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 12:38:57 +0000 Subject: [issue44600] match/case statements trace incorrectly in 3.10.0b4 In-Reply-To: <1626037375.68.0.596111226116.issue44600@roundup.psfhosted.org> Message-ID: <1627475937.46.0.218305131739.issue44600@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 5502ee052fb4257ad7438dd1130c80e1a9c4bc7f by Miss Islington (bot) in branch '3.10': bpo-44600: Refactor new tracing tests (GH-27396) (GH-27404) https://github.com/python/cpython/commit/5502ee052fb4257ad7438dd1130c80e1a9c4bc7f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:04:50 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:04:50 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627477490.49.0.422662664275.issue44461@roundup.psfhosted.org> miss-islington added the comment: New changeset 684eb5cb8016546f1f8652dae8febd5c6571193e by Jason R. Coombs in branch '3.10': [3.10] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) (GH-27399) https://github.com/python/cpython/commit/684eb5cb8016546f1f8652dae8febd5c6571193e ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:08:08 2021 From: report at bugs.python.org (jan matejek) Date: Wed, 28 Jul 2021 13:08:08 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad Message-ID: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> New submission from jan matejek : The fallback detection for `win_getpass` checks that `sys.stdin` is different from `sys.__stdin__`. If yes, it assumes that it's incapable of disabling echo, and calls `default_getpass` which reads from stdin. If they are the same object, it assumes it's in a terminal and uses `msvcrt` to read characters. I was not able to find any rationale for this check, it seems to have been introduced, oh wow, in 2001, to fix something IDLE-related. Anyway, the check is trivially incorrect. It fails when such script is launched from `subprocess.Popen(stdin=PIPE)`, where both `sys.stdin` and `sys.__stdin__` are the same instance of `TextIOWrapper`. Same actually happens in MinTTY (Git Bash etc.) which is not a true terminal as far as I was able to find out? It seems that a better check would be, e.g., `sys.stdin.isatty()`, which correctly returns `False` both in subprocesses and in MinTTY. ---------- components: Library (Lib) messages: 398370 nosy: matejcik priority: normal severity: normal status: open title: getpass.getpass on Windows fallback detection is bad type: behavior versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:10:43 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 28 Jul 2021 13:10:43 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627477843.72.0.1006951928.issue44657@roundup.psfhosted.org> Dong-hee Na added the comment: New changeset ddf8ae31a0f371eff2db14c7f7a45976b86d56ea by Dong-hee Na in branch 'main': bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION (GH-27202) https://github.com/python/cpython/commit/ddf8ae31a0f371eff2db14c7f7a45976b86d56ea ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:10:47 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:10:47 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627477847.18.0.54213113665.issue44657@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25941 pull_request: https://github.com/python/cpython/pull/27408 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:10:52 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:10:52 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627477852.88.0.129355415437.issue44657@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25942 pull_request: https://github.com/python/cpython/pull/27409 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:12:11 2021 From: report at bugs.python.org (jan matejek) Date: Wed, 28 Jul 2021 13:12:11 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627477931.04.0.603881151944.issue44762@roundup.psfhosted.org> jan matejek added the comment: ...this is a problem because: When the check incorrectly infers that it can use `msvcrt` while its stdin is a pipe, the calls to `putwch` and `getwch` are going into the void and the program effectively freezes waiting for input that never comes. See also: https://stackoverflow.com/questions/49858821/python-getpass-doesnt-work-on-windows-git-bash-mingw64/54046572 https://github.com/ipython/ipython/issues/854 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:13:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:13:42 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627478022.79.0.548809054636.issue44756@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25944 pull_request: https://github.com/python/cpython/pull/27411 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:13:34 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:13:34 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627478014.26.0.432329967704.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d22c876d5ac5fa464337d2e82654b8d87a83cb1b by Jack DeVries in branch 'main': bpo-44756: in ./Doc, `make build` depends on `make html` (#27403) https://github.com/python/cpython/commit/d22c876d5ac5fa464337d2e82654b8d87a83cb1b ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:13:37 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:13:37 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627478017.16.0.551622734467.issue44756@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25943 pull_request: https://github.com/python/cpython/pull/27410 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:14:28 2021 From: report at bugs.python.org (jan matejek) Date: Wed, 28 Jul 2021 13:14:28 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627478068.44.0.631534151478.issue44762@roundup.psfhosted.org> jan matejek added the comment: For that matter, in standard Windows Command Prompt `sys.stdin` and `sys.__stdin__` are also identical, but `isatty()` reports True. I suspect is that the code has drifted and `sys.stdin` is _always_ identical to `sys.__stdin__` ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:17:29 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Wed, 28 Jul 2021 13:17:29 +0000 Subject: [issue40001] ignore errors in SimpleCookie In-Reply-To: <1584533209.73.0.816552573912.issue40001@roundup.psfhosted.org> Message-ID: <1627478249.54.0.0161180444255.issue40001@roundup.psfhosted.org> Andrei Kulakov added the comment: Aviram: see issue https://bugs.python.org/issue17340 , there is a lot of old discussions along the same lines. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:22:45 2021 From: report at bugs.python.org (jan matejek) Date: Wed, 28 Jul 2021 13:22:45 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627478565.17.0.963545001898.issue44762@roundup.psfhosted.org> Change by jan matejek : ---------- 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 Jul 28 09:23:04 2021 From: report at bugs.python.org (jan matejek) Date: Wed, 28 Jul 2021 13:23:04 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627478584.53.0.379308876647.issue44762@roundup.psfhosted.org> Change by jan matejek : ---------- versions: +Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:27:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:27:57 +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: <1627478877.37.0.0382279930731.issue42853@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 153365d864c411f6fb523efa752ccb3497d815ca by Inada Naoki in branch '3.9': [3.9] bpo-42853: Fix http.client fails to download >2GiB data over TLS (GH-27405) https://github.com/python/cpython/commit/153365d864c411f6fb523efa752ccb3497d815ca ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:27:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:27:57 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627478877.3.0.462368991904.issue36050@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 153365d864c411f6fb523efa752ccb3497d815ca by Inada Naoki in branch '3.9': [3.9] bpo-42853: Fix http.client fails to download >2GiB data over TLS (GH-27405) https://github.com/python/cpython/commit/153365d864c411f6fb523efa752ccb3497d815ca ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:28:20 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:28:20 +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: <1627478900.74.0.35870391159.issue42853@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:29:21 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:29:21 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627478961.22.0.530101536706.issue44657@roundup.psfhosted.org> miss-islington added the comment: New changeset c558e12695e5fe39778eb3eead9df48870356800 by Miss Islington (bot) in branch '3.10': bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION (GH-27202) https://github.com/python/cpython/commit/c558e12695e5fe39778eb3eead9df48870356800 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:32:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:32:42 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627479162.83.0.362854013643.issue44754@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25946 pull_request: https://github.com/python/cpython/pull/27413 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:32:35 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:32:35 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627479155.72.0.415058869941.issue44754@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25945 pull_request: https://github.com/python/cpython/pull/27412 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:32:51 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:32:51 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627479171.75.0.971714123246.issue44754@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25947 pull_request: https://github.com/python/cpython/pull/27414 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:33:07 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:33:07 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627479187.8.0.255993870004.issue44657@roundup.psfhosted.org> miss-islington added the comment: New changeset c48720576d63f9a7de15a6e46b07262dd3d04a8d by Miss Islington (bot) in branch '3.9': bpo-44657: Fix instancemethod_call to use PyInstanceMethod_GET_FUNCTION (GH-27202) https://github.com/python/cpython/commit/c48720576d63f9a7de15a6e46b07262dd3d04a8d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:33:38 2021 From: report at bugs.python.org (Dong-hee Na) Date: Wed, 28 Jul 2021 13:33:38 +0000 Subject: [issue44657] instancemethod_call should use PyInstanceMethod_GET_FUNCTION macro In-Reply-To: <1626464638.16.0.397539197321.issue44657@roundup.psfhosted.org> Message-ID: <1627479218.24.0.624772036785.issue44657@roundup.psfhosted.org> Dong-hee Na added the comment: Thank you Sam for the valuable report!! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:35:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:35:26 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627479326.56.0.844246437969.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f113195ac85d58bdde348b5bb74eb97e6485e408 by Miss Islington (bot) in branch '3.10': bpo-44756: in ./Doc, `make build` depends on `make html` (GH-27403) (GH-27410) https://github.com/python/cpython/commit/f113195ac85d58bdde348b5bb74eb97e6485e408 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:37:56 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 28 Jul 2021 13:37:56 +0000 Subject: [issue44561] Some expired hyperlinks in Python documentation In-Reply-To: <1625405618.41.0.0286590833037.issue44561@roundup.psfhosted.org> Message-ID: <1627479476.22.0.251033402504.issue44561@roundup.psfhosted.org> ?ric Araujo added the comment: Python has thousands of open issues and PRs, so that?s why the one you opened didn?t have comments at first. For cases like this, there is a 'skip-news' label to satisfy the robotic checks. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:38:56 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 13:38:56 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1627479536.77.0.275739045618.issue44711@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25948 pull_request: https://github.com/python/cpython/pull/27416 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:40:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:40:27 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627479627.4.0.164274507326.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset fd2c2465d49a8bcb32eeda82d694eed48e57ba79 by Miss Islington (bot) in branch '3.9': bpo-44756: in ./Doc, `make build` depends on `make html` (GH-27403) (GH-27411) https://github.com/python/cpython/commit/fd2c2465d49a8bcb32eeda82d694eed48e57ba79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:41:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:41:14 +0000 Subject: [issue44756] In ./Doc, "make html" and "make build" should depend on "make venv" In-Reply-To: <1627447646.0.0.0697423351064.issue44756@roundup.psfhosted.org> Message-ID: <1627479674.82.0.437895601712.issue44756@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Jack! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:47:09 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Wed, 28 Jul 2021 13:47:09 +0000 Subject: [issue44701] Create a @deprecated decorator (annotation) In-Reply-To: <1626894458.82.0.833124063655.issue44701@roundup.psfhosted.org> Message-ID: <1627480029.89.0.119516260898.issue44701@roundup.psfhosted.org> ?ric Araujo added the comment: You should propose this on python-ideas! ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 09:57:48 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 13:57:48 +0000 Subject: [issue44754] Documentation for pop in Built-in Types In-Reply-To: <1627428187.16.0.834558477955.issue44754@roundup.psfhosted.org> Message-ID: <1627480668.89.0.834197928419.issue44754@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Dennis! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:11:08 2021 From: report at bugs.python.org (Bruce Merry) Date: Wed, 28 Jul 2021 14:11:08 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627481468.53.0.388329169634.issue36050@roundup.psfhosted.org> Bruce Merry added the comment: Re-opening because the patch to fix this has just been reverted due to bpo-42853. ---------- status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:15:45 2021 From: report at bugs.python.org (Bruce Merry) Date: Wed, 28 Jul 2021 14:15:45 +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: <1627481745.92.0.668821585157.issue42853@roundup.psfhosted.org> Bruce Merry added the comment: This fix is going to cause a regression of bpo-36050. Would it not be possible to fix this in _ssl.c (by breaking a large read into multiple smaller calls to SSL_read)? It seems like fixing this at the SSL layer is more appropriate than trying to work around it at the HTTP layer, and thus impacting the performance of all HTTP fetches (whether using TLS or not, and whether >2GB or not). ---------- nosy: +bmerry _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:15:55 2021 From: report at bugs.python.org (Inada Naoki) Date: Wed, 28 Jul 2021 14:15:55 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627481755.11.0.956481959464.issue36050@roundup.psfhosted.org> Inada Naoki added the comment: Note that it was reverted only in 3.9 branch. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:28:25 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 14:28:25 +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: <1627482505.26.0.569283979721.issue27827@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25949 pull_request: https://github.com/python/cpython/pull/27421 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:28:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 14:28:23 +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: <1627482503.5.0.901546657508.issue27827@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 56c1f6d7edad454f382d3ecb8cdcff24ac898a50 by Barney Gale in branch 'main': bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) https://github.com/python/cpython/commit/56c1f6d7edad454f382d3ecb8cdcff24ac898a50 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:28:30 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 14:28: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: <1627482510.76.0.553299599804.issue27827@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25950 pull_request: https://github.com/python/cpython/pull/27422 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:40:51 2021 From: report at bugs.python.org (Gregory P. Smith) Date: Wed, 28 Jul 2021 14:40:51 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627483251.45.0.23360737664.issue36050@roundup.psfhosted.org> Change by Gregory P. Smith : ---------- resolution: fixed -> stage: resolved -> needs patch _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:48:13 2021 From: report at bugs.python.org (Leonardo Freua) Date: Wed, 28 Jul 2021 14:48:13 +0000 Subject: [issue44701] Create a @deprecated decorator (annotation) In-Reply-To: <1626894458.82.0.833124063655.issue44701@roundup.psfhosted.org> Message-ID: <1627483693.76.0.425688765499.issue44701@roundup.psfhosted.org> Leonardo Freua added the comment: Ok thanks, I'll do it. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:56:18 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 14:56:18 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. Message-ID: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> New submission from Jack DeVries : The phrase "width defaults to 70." in the documentation for textwrap.wrap is repetitive, because that information is already communicated in the function signature. The desire to fix this came up this discussion around this PR: https://github.com/python/cpython/pull/26999#discussion_r678322870 I will attach a PR momentarily. ---------- assignee: docs at python components: Documentation messages: 398392 nosy: docs at python, jack__d priority: normal severity: normal status: open title: "width defaults to 70." in textwrap.wrap documentation is repetitive. type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:57:33 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 14:57:33 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627484253.11.0.406443349427.issue44763@roundup.psfhosted.org> Change by Jack DeVries : ---------- keywords: +patch pull_requests: +25951 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27423 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:58:28 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 14:58:28 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627484308.13.0.573657696023.issue44763@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25952 pull_request: https://github.com/python/cpython/pull/26999 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 10:59:14 2021 From: report at bugs.python.org (Ken Jin) Date: Wed, 28 Jul 2021 14:59:14 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1627484354.08.0.397909132228.issue44098@roundup.psfhosted.org> Ken Jin added the comment: @Serhiy, could you please briefly describe what you are planning? I'm guessing you're generalizing for _TypeVarLike? My main concern is that we should have as few differences between builtin and typing types as possible. typing.List is deprecated and set to remove in Python 3.13/14, so I'm hoping the transition will be fairly painless. Originally, the builtin types supported ParamSpec, but I removed that in GH-25449 for various reasons listed in that PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:01:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 15:01:56 +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: <1627484516.03.0.12111311635.issue27827@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8789add99164177f29a8cd319a834187c65ab16c by Miss Islington (bot) in branch '3.10': bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) (GH-27421) https://github.com/python/cpython/commit/8789add99164177f29a8cd319a834187c65ab16c ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:15:04 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 15:15:04 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627485304.77.0.834339569233.issue44544@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25953 pull_request: https://github.com/python/cpython/pull/27424 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:15:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 15:15:02 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627485302.87.0.691669634222.issue44544@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1 by Jack DeVries in branch 'main': bpo-44544: [doc] list all textwrap func kwargs (GH-26999) https://github.com/python/cpython/commit/c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:15:10 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 15:15:10 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627485310.32.0.770688614705.issue44544@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25954 pull_request: https://github.com/python/cpython/pull/27425 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:15:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 15:15:56 +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: <1627485356.0.0.598979908744.issue27827@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset debb751f11f5221eafcdf07a14c7e9408350ad9a by Miss Islington (bot) in branch '3.9': bpo-27827: identify a greater range of reserved filename on Windows. (GH-26698) (#27422) https://github.com/python/cpython/commit/debb751f11f5221eafcdf07a14c7e9408350ad9a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:17:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 15:17:51 +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: <1627485471.39.0.822461260966.issue27827@roundup.psfhosted.org> ?ukasz Langa added the comment: Barney, thanks for pushing this across the finish line! ? ? ? And of course, Eryk for the report and original patch. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:24:37 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 15:24:37 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627485877.11.0.598761205121.issue44763@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25955 pull_request: https://github.com/python/cpython/pull/27426 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:24:37 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 15:24:37 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627485877.88.0.772192226806.issue44763@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset cb1d76f10ab33dddd0dbd64e6506bf7c065d499b by Jack DeVries in branch 'main': bpo-44763: [doc] remove repetitive sentence from textwrap.wrap (GH-27423) https://github.com/python/cpython/commit/cb1d76f10ab33dddd0dbd64e6506bf7c065d499b ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:24:42 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 15:24:42 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627485882.15.0.697802045439.issue44763@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25956 pull_request: https://github.com/python/cpython/pull/27427 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 11:52:59 2021 From: report at bugs.python.org (Eryk Sun) Date: Wed, 28 Jul 2021 15:52:59 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627487579.75.0.15257382984.issue44762@roundup.psfhosted.org> Eryk Sun added the comment: > When the check incorrectly infers that it can use `msvcrt` while > its stdin is a pipe, the calls to `putwch` and `getwch` are going > into the void and the program effectively freezes waiting for > input that never comes. The C runtime's getwch() and putwch() functions use the console I/O files "CONIN$" and "CONOUT$". If "CONIN$" can't be opened because the process has no console, then getwch() fails and returns U+FFFF. But mintty does have a console, albeit with a hidden window, which gets inherited by bash and child processes. So getwch() ends up waiting for a key to be pressed in an inaccessible, hidden window. It should suffice to check that sys.stdin isn't None and that sys.stdin.isatty() is True, since it's reasonable to assume that the console has a visible window in this case. Currently this isn't a bulletproof check, however, because the Windows C runtime doesn't implement isatty() correctly. It returns true for any character device, which includes the common case of redirecting standard I/O to the "NUL" device. io.FileIO.isatty() could be updated to return True only if both C isatty() is true and GetConsoleMode() succeeds. This would filter out false positives for non-console character devices, particularly "NUL". ---------- nosy: +eryksun _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 12:18:43 2021 From: report at bugs.python.org (Ilian Iliev) Date: Wed, 28 Jul 2021 16:18:43 +0000 Subject: [issue44764] Handling interruption in async tasks Message-ID: <1627489123.42.0.553634869406.issue44764@roundup.psfhosted.org> New submission from Ilian Iliev : The idea is to provide a way for graceful shutdown so that if an interruption occurs all async tasks are given a certain time to finish before we exit the process. Please take a look at the provided example -> https://gist.github.com/IlianIliev/9aba04a74a4faddf0749533205d3b001 If the interruption happens during an await (if we use `await asyncio.sleep(5)`), all works correctly. The exception is raised to the root level and we do the graceful shutdown on line 37. But if the interruption happens during a normal execution (`time.sleep()`) it is raised at the currently running line and this way breaks the function without any chances or recovery. While `time.sleep` is not that widely used, the same problem occurs if we have any other long-running code e.g. iterating over a big list. This was found while looking for a way to provide a graceful shutdown for the grpcio server -> https://github.com/grpc/grpc/issues/26123 Is it possible to change the behaviour so the exception is raised on a higher level when sync tasks are executed in async context? ---------- hgrepos: 407 messages: 398400 nosy: ilian priority: normal severity: normal status: open title: Handling interruption in async tasks type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 12:18:54 2021 From: report at bugs.python.org (Ilian Iliev) Date: Wed, 28 Jul 2021 16:18:54 +0000 Subject: [issue44764] Handling interruption in async tasks In-Reply-To: <1627489123.42.0.553634869406.issue44764@roundup.psfhosted.org> Message-ID: <1627489134.87.0.378698649186.issue44764@roundup.psfhosted.org> Change by Ilian Iliev : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 12:55:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 16:55:23 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint In-Reply-To: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> Message-ID: <1627491323.86.0.73231178629.issue44682@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 53b9458f2e9314703a5406ca817d757f1509882a by andrei kulakov in branch 'main': bpo-44682: Handle invalid arg to pdb's "commands" directive (#27252) https://github.com/python/cpython/commit/53b9458f2e9314703a5406ca817d757f1509882a ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 12:56:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 16:56:30 +0000 Subject: [issue44682] Pdb commands allows to add commands to invalid breakpoint In-Reply-To: <1626754145.37.0.320226064648.issue44682@roundup.psfhosted.org> Message-ID: <1627491390.75.0.421110075635.issue44682@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:14:57 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 28 Jul 2021 17:14:57 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627492497.85.0.568220269963.issue43897@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 31bec6f1b178dadec3cb43353274b4e958a8f015 by Batuhan Taskaya in branch 'main': bpo-43897: AST validation for pattern matching nodes (GH24771) https://github.com/python/cpython/commit/31bec6f1b178dadec3cb43353274b4e958a8f015 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:29:41 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:29:41 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627493381.68.0.990134053004.issue44544@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 97af790495f580a60253f9d8c50b26eeb53d9926 by Miss Islington (bot) in branch '3.10': bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424) https://github.com/python/cpython/commit/97af790495f580a60253f9d8c50b26eeb53d9926 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:29:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:29:51 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627493391.24.0.142906393458.issue44544@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 019a8b08fa28b26e009fd10395c7b767848b4e77 by Miss Islington (bot) in branch '3.9': bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27425) https://github.com/python/cpython/commit/019a8b08fa28b26e009fd10395c7b767848b4e77 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:30:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:30:27 +0000 Subject: [issue44544] Add full list of possible args to textwrap: wrap, fill, shorten In-Reply-To: <1625156659.02.0.858532247331.issue44544@roundup.psfhosted.org> Message-ID: <1627493427.78.0.922121831743.issue44544@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:31:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:31:04 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627493464.47.0.112175116919.issue44763@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 369d1480b7d51b65c08664ecd63c970fb0d573e1 by Miss Islington (bot) in branch '3.10': bpo-44763: [doc] remove repetitive sentence from textwrap.wrap (GH-27423) (GH-27426) https://github.com/python/cpython/commit/369d1480b7d51b65c08664ecd63c970fb0d573e1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:31:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:31:22 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627493482.76.0.938865790165.issue44763@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 9337c60ba8da897f74bddef072d12093cc8c82c5 by Miss Islington (bot) in branch '3.9': bpo-44763: [doc] remove repetitive sentence from textwrap.wrap (GH-27423) (GH-27427) https://github.com/python/cpython/commit/9337c60ba8da897f74bddef072d12093cc8c82c5 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:31:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Wed, 28 Jul 2021 17:31:45 +0000 Subject: [issue44763] "width defaults to 70." in textwrap.wrap documentation is repetitive. In-Reply-To: <1627484178.54.0.800781204335.issue44763@roundup.psfhosted.org> Message-ID: <1627493505.25.0.801165066909.issue44763@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:34:54 2021 From: report at bugs.python.org (jakirkham) Date: Wed, 28 Jul 2021 17:34:54 +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: <1627493694.59.0.0986103632118.issue42853@roundup.psfhosted.org> jakirkham added the comment: Agree with Bruce. It seems like we could have support for OpenSSL 1.1.1 at that level with a compile time fallback for previous OpenSSL versions that break up the work. Would hope this solution also yields something we can backport more easily ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:46:45 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 28 Jul 2021 17:46:45 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match In-Reply-To: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> Message-ID: <1627494405.82.0.00941218706226.issue44658@roundup.psfhosted.org> Brandt Bucher added the comment: Evaluating every key in every mapping pattern and checking them for duplicates every time a match block is entered would be prohibitively expensive, for negligible gain. The length check exists to avoid this step, replacing it with a much cheaper O(1) trapdoor. Imagine the overhead of validating this match statement, for example: https://github.com/brandtbucher/patmaperformance/blob/2fe8b79691d4f11b18d65b957ed36a85cb4761a4/bm_patma_holdem.py#L54-L95 > Consider if some other code is mutating the value of `A.a`. This could create some very strange and flaky bugs where the state of `A.a` can change and make the pattern invalid, but nonetheless not cause an exception until much later, or not at all. That's okay with me; it's not the VM's job to check the runtime validity of branches that aren't taken. > Another option if this problem is isolated to mapping patterns, we could introduce a new op-code: BUILD_MATCH_MAP, which is essentially a wrapper around BUILD_MAP that disallows duplicate key values. I'm not sure what you mean by this. We don't call BUILD_MAP when evaluating mapping patterns... in fact, we don't build any dictionaries at all (except for collecting remaining items using **rest). Unless others disagree, I'm probably going to close this as "not a bug". ---------- assignee: -> brandtbucher _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 13:55:24 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Wed, 28 Jul 2021 17:55:24 +0000 Subject: [issue44765] Misspelled Word In Docs Message-ID: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> New submission from Eesa Ibrahim Khokhar : Quote Official docs: "For e.g. server can **chose** to send 417 Expectation Failed as a response header and return False." Above, choose is misspelled. ---------- messages: 398410 nosy: khokhareesa.home priority: normal severity: normal status: open title: Misspelled Word In Docs _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 14:07:12 2021 From: report at bugs.python.org (hai shi) Date: Wed, 28 Jul 2021 18:07:12 +0000 Subject: [issue44766] [easy doc] Remove redundant info in README.valgrind Message-ID: <1627495632.91.0.703562512799.issue44766@roundup.psfhosted.org> New submission from hai shi : Objects/obmalloc.c hasn't use the Py_USING_MEMORY_DEBUGGER macro now. So this line can be deleted. https://github.com/python/cpython/blob/31bec6f1b178dadec3cb43353274b4e958a8f015/Misc/README.valgrind#L17. ---------- assignee: docs at python components: Documentation messages: 398411 nosy: docs at python, shihai1991 priority: normal severity: normal status: open title: [easy doc] Remove redundant info in README.valgrind type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 14:09:24 2021 From: report at bugs.python.org (Bruce Merry) Date: Wed, 28 Jul 2021 18:09:24 +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: <1627495764.08.0.133260768929.issue42853@roundup.psfhosted.org> Bruce Merry added the comment: > It seems like we could have support for OpenSSL 1.1.1 at that level with a compile time fallback for previous OpenSSL versions that break up the work. Would hope this solution also yields something we can backport more easily I'd have to look at exactly how the SSL_read API works, but I think once we're in C land and can read into regions of a buffer, reading in 2GB chunks is unlikely to cause a performance hit (unlike the original bpo-36050, where Python had to read a bunch of separate buffers then join them together). So trying to have 3.9 support both SSL_read_ex AND have a fallback sounds like it's adding complexity and risking inconsistency if the fallback doesn't perfectly mimic the SSL_read_ex path, for very little gain. If no-one else steps up sooner I can probably work on a patch, but before sinking time into it I'd like to hear if there is agreement that this is a reasonable approach and ideally have a volunteer to review it (hopefully someone who is familiar with OpenSSL, since I've only briefly dealt with it years ago and crypto isn't somewhere you want to make mistakes). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 14:13:06 2021 From: report at bugs.python.org (hai shi) Date: Wed, 28 Jul 2021 18:13:06 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627495986.55.0.856138552296.issue44748@roundup.psfhosted.org> Change by hai shi : ---------- nosy: +paul.j3, rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 14:46:29 2021 From: report at bugs.python.org (Chandrakant Naik) Date: Wed, 28 Jul 2021 18:46:29 +0000 Subject: [issue44767] python -m flask run gives OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions Message-ID: <1627497989.44.0.166759062012.issue44767@roundup.psfhosted.org> New submission from Chandrakant Naik : Attached is teh app.py program. I tried runnign it in VS Code via the cmd - python -m flask run. It gives me the below error OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions Tried changing the port and executing it still no luck ---------- components: Library (Lib) files: app.py messages: 398413 nosy: Jimbofbx, chandrakant.rvce, loewis, pitrou, tim.golden priority: normal severity: normal status: open title: python -m flask run gives OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions type: behavior versions: Python 3.9 Added file: https://bugs.python.org/file50189/app.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:07:07 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Jul 2021 19:07:07 +0000 Subject: [issue44767] python -m flask run gives OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions In-Reply-To: <1627497989.44.0.166759062012.issue44767@roundup.psfhosted.org> Message-ID: <1627499227.75.0.0944435783462.issue44767@roundup.psfhosted.org> Eric V. Smith added the comment: This sounds like a flask problem, not a python bug. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:16:09 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 28 Jul 2021 19:16:09 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627499769.24.0.202324758337.issue44765@roundup.psfhosted.org> Zachary Ware added the comment: This is at https://docs.python.org/3/library/http.server.html#http.server.BaseHTTPRequestHandler.handle_expect_100, which can be found in Doc/library/http.server.rst ---------- assignee: -> docs at python components: +Documentation keywords: +easy, newcomer friendly nosy: +docs at python, zach.ware stage: -> needs patch versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:16:39 2021 From: report at bugs.python.org (Zachary Ware) Date: Wed, 28 Jul 2021 19:16:39 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627499799.11.0.116779630565.issue44762@roundup.psfhosted.org> Change by Zachary Ware : ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware stage: -> needs patch versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:16:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Jul 2021 19:16:54 +0000 Subject: [issue42167] Documentation for SETUP_WITH opcode is wrong In-Reply-To: <1603792488.66.0.729213845644.issue42167@roundup.psfhosted.org> Message-ID: <1627499814.54.0.748441258097.issue42167@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:47:35 2021 From: report at bugs.python.org (paul j3) Date: Wed, 28 Jul 2021 19:47:35 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627501655.76.0.00294733419455.issue44748@roundup.psfhosted.org> paul j3 added the comment: I've explored something similar in https://bugs.python.org/issue11588 Add "necessarily inclusive" groups to argparse There is a local variable in parser._parse_known_args seen_non_default_actions that's a set of the actions that have been seen. It is used for testing for required actions, and for mutually_exclusive groups. But making it available to users without altering user API code is awkward. My latest idea was to add it as an attribute to the parser, or (conditionally) as attribute of the namespace https://bugs.python.org/issue11588#msg265734 I've also thought about tweaking the interface between parser._parse_known_args parser.parse_known_args to do of more of the error checking in the caller, and give the user more opportunity to do their checks. This variable would be part of _parse_known_args output. Usually though when testing like this comes up on SO, I suggest leaving the defaults as None, and then just using a if args.foobar is None: # not seen Defaults are written to the namespace at the start of parsing, and seen arguments overwrite those values (with an added type 'eval' step of remaining defaults at the end). Keep in mind, though, that the use of subparsers could complicate any of these tweaks. In reading my posts on https://bugs.python.org/issue26394, I remembered the IPython uses argparse (subclassed) with config. I believe it uses config inputs (default and user) to define the arguments for the parser. So unless someone comes up with a really clever idea, this is bigger request than it first impressions suggest. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:51:44 2021 From: report at bugs.python.org (paul j3) Date: Wed, 28 Jul 2021 19:51:44 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627501904.22.0.220109361522.issue44748@roundup.psfhosted.org> paul j3 added the comment: Joker 'type=bool' has been discussed in other issues. 'bool' is an existing python function. Only 'bool("")' returns False. Write your own 'type' function if you want to test for specific strings. It's too language-specific to add as a general purpose function. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:58:16 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 19:58:16 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627502296.65.0.270371059118.issue40263@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +25957 pull_request: https://github.com/python/cpython/pull/27428 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:58:22 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 19:58:22 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627502302.71.0.979148141664.issue40263@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25958 pull_request: https://github.com/python/cpython/pull/27429 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 15:58:36 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 19:58:36 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627502316.06.0.983872351424.issue40263@roundup.psfhosted.org> Steve Dower added the comment: New changeset 92b5dc780db968f6277f42cb06926dddb7475dc6 by Ray Donnelly in branch 'main': bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501) https://github.com/python/cpython/commit/92b5dc780db968f6277f42cb06926dddb7475dc6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:00:26 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 20:00:26 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627502426.72.0.972583431941.issue40263@roundup.psfhosted.org> Steve Dower added the comment: Fixed, better late than never. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:11:08 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 28 Jul 2021 20:11:08 +0000 Subject: [issue3783] dbm.sqlite proof of concept In-Reply-To: <1220572652.24.0.256023256295.issue3783@psf.upfronthosting.co.za> Message-ID: <1627503068.12.0.0645866210839.issue3783@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:18:09 2021 From: report at bugs.python.org (miss-islington) Date: Wed, 28 Jul 2021 20:18:09 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627503489.39.0.822909781832.issue40263@roundup.psfhosted.org> miss-islington added the comment: New changeset bccb7b9509e875ef23ec3225d03214ca047e5b1a by Miss Islington (bot) in branch '3.10': bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501) https://github.com/python/cpython/commit/bccb7b9509e875ef23ec3225d03214ca047e5b1a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:42:31 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 20:42:31 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing Message-ID: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> New submission from pavel-lexyr : PEP 20 states: > There should be one-- and preferably only one --obvious way to do it. As of right now, two very similar constructions for making a lightweight dataclass exist in Python. collections.namedtuple is one of them. dataclasses.dataclass is the other*. The behaviour they provide is very similar. And with the functions .astuple() and the `frozen` constructor argument of the dataclass, one could consider it to be almost a direct superset of the namedtuple. Having two different classes with very similar behaviour is not considered a good practice. I propose merging the two classes' features into one and to deprecate the other, to prevent unnecessary ambiguity. * To get deeper into semantics, we might consider types.SimpleNamespace to be the third. This is out of this issue's scope - the reader is welcome to follow up in another one. ---------- components: Library (Lib) messages: 398421 nosy: eric.smith, pavel-lexyr, rhettinger priority: normal severity: normal status: open title: dataclasses.dataclass and collections.namedtuple do the same thing 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 Jul 28 16:47:42 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Jul 2021 20:47:42 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627505262.93.0.848078432651.issue44768@roundup.psfhosted.org> Eric V. Smith added the comment: They are very different. I don?t see how they could be combined. PEP 557 goes in to some of the differences. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:49:44 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 20:49:44 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627505384.71.0.697430339605.issue44765@roundup.psfhosted.org> Change by pavel-lexyr : ---------- keywords: +patch nosy: +pavel-lexyr nosy_count: 3.0 -> 4.0 pull_requests: +25959 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27430 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 16:56:00 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Wed, 28 Jul 2021 20:56:00 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627505760.16.0.0445731392198.issue31746@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- nosy: +erlendaasland nosy_count: 1.0 -> 2.0 pull_requests: +25960 pull_request: https://github.com/python/cpython/pull/27431 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:08:02 2021 From: report at bugs.python.org (Alexander Smirnov) Date: Wed, 28 Jul 2021 21:08:02 +0000 Subject: [issue43344] RotatingFileHandler breaks file type associations In-Reply-To: <1614465857.24.0.529577943251.issue43344@roundup.psfhosted.org> Message-ID: <1627506482.39.0.466100343675.issue43344@roundup.psfhosted.org> Alexander Smirnov added the comment: the namer was implemented to add "*.log" extension, to avoid broken file association problem. ``` log_handler.namer = lambda name: name.replace(".log", "") + ".log" ``` >implemented carefully enough Could you please share best practices, looks like this documentation is missing. I created a separate issue related to disregarding of backupCount configuration - https://bugs.python.org/issue44753 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:20:36 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 21:20:36 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627507236.39.0.445848797038.issue44768@roundup.psfhosted.org> pavel-lexyr added the comment: Most of the differences are direct upgrades added in the dataclass module. Deprecating dataclass in favour of nametuple would be counterproductive, I agree - what about vice versa? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:24:57 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Jul 2021 21:24:57 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627507497.22.0.0428092244333.issue44768@roundup.psfhosted.org> Eric V. Smith added the comment: namedtuples have features like true immutability, being smaller, and being faster. ---------- 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 Jul 28 17:31:17 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 21:31:17 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627507877.16.0.921596467159.issue44768@roundup.psfhosted.org> pavel-lexyr added the comment: Touche. Another advantage a namedtuple has is that it can expand out of the box - i.e., can write something like > for x, y, z in namedtuple_list: without any list comprehensions. Can we bring those advantages into the dataclass while also preserving the interface? Maybe a special version of the implementation behind the scenes, something similar to what C++ does with bool vectors. ---------- 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 Jul 28 17:32:09 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 21:32:09 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627507929.13.0.985920514104.issue44768@roundup.psfhosted.org> Change by pavel-lexyr : ---------- 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 Jul 28 17:32:39 2021 From: report at bugs.python.org (Petr Viktorin) Date: Wed, 28 Jul 2021 21:32:39 +0000 Subject: [issue44769] socketserver.shutdown should stop serve_forever() immediately Message-ID: <1627507959.35.0.467924205833.issue44769@roundup.psfhosted.org> New submission from Petr Viktorin : Currently, socketserver.serve_forever() sets a variable and serve_forever() polls for it, with a configurable interval. A comment in the code already says: # XXX: Consider using another file descriptor or connecting to the # socket to wake this up instead of polling. Polling reduces our # responsiveness to a shutdown request and wastes cpu at all other # times. ---------- components: Library (Lib) messages: 398427 nosy: petr.viktorin priority: normal severity: normal status: open title: socketserver.shutdown should stop serve_forever() immediately _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:35:25 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Wed, 28 Jul 2021 21:35:25 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627508125.99.0.906182771191.issue44768@roundup.psfhosted.org> Steven D'Aprano added the comment: Hi Pavel. Thank you for your submission, but your request is based on a serious misunderstanding of the koan from PEP 20. You might consider that Python has, for example, both for loops and while loops; it has lists and tuples; it has ints and floats and Decimals. Even if they were "the same", we would not remove one or the other just to satisfy PEP 20. Even if we did decide to do so, but the process could only *start* in 3.11 or later, 3.6 through 3.10 are all in feature-freeze and no changes except bug-fixes are permitted. Before we could make such a major change, you would need to discuss this on the Python-Ideas mailing list to gather feedback and support for the idea. You would need to get at least one core developer willing to act as champion for it, and write a PEP. The bug tracker is not the place for this. ---------- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:37:09 2021 From: report at bugs.python.org (Eric V. Smith) Date: Wed, 28 Jul 2021 21:37:09 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627508229.69.0.514866376157.issue44768@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Steven, but since I have this typed up I'll post it here. Yes, iterability is another namedtuple feature. Although that would actually be easy to add to dataclasses, so I didn't mention it. I don't really see the point of combining them, except for some conceptual purity argument. You can already write a wrapper decorator which, given the various parameters to @dataclass, decides if it will produce a dataclass or a namedtuple. For example, there couldn't be any fields with init=False, or kwonly=True, the class would have to have frozen=True, etc. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:45:00 2021 From: report at bugs.python.org (Josh Haberman) Date: Wed, 28 Jul 2021 21:45:00 +0000 Subject: [issue15870] PyType_FromSpec should take metaclass as an argument In-Reply-To: <1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> Message-ID: <1627508700.92.0.663681174459.issue15870@roundup.psfhosted.org> Josh Haberman added the comment: I know this is quite an old bug that was closed almost 10 years ago. But I am wishing this had been accepted; it would have been quite useful for my case. I'm working on a new iteration of the protobuf extension for Python. At runtime we create types dynamically, one for each message defined in a .proto file, eg. from "message Foo" we dynamically construct a "class Foo". I need to support class variables like Foo.BAR_FIELD_NUMBER, but I don't want to put all these class variables into tp_dict because there are a lot of them and they are rarely used. So I want to implement __getattr__ for the class, which requires having a metaclass. This is where the proposed PyType_FromSpecEx() would have come in very handy. The existing protobuf extension gets around this by directly calling PyType_Type.tp_new() to create a type with a given metaclass: https://github.com/protocolbuffers/protobuf/blob/53365065d9b8549a5c7b7ef1e7e0fd22926dbd07/python/google/protobuf/pyext/message.cc#L278-L279 It's unclear to me if PyType_Type.tp_new() is intended to be a supported/public API. But in any case, it's not available in the limited API, and I am trying to restrict myself to the limited API. (I also can't use PyType_GetSlot(PyType_Type, Py_tp_new) because PyType_Type is not a heap type.) Put more succinctly, I do not see any way to use a metaclass from the limited C API. Possible solutions I see: 1. Add PyType_FromSpecEx() (or similar with a better name) to allow a metaclass to be specified. But I want to support back to at least Python 3.6, so even if this were merged today it wouldn't be viable for a while. 2. Use eval from C to create the class with a metaclass, eg. class Foo(metaclass=MessageMeta) 3. Manually set FooType->ob_type = &MetaType, as recommended here: https://stackoverflow.com/a/52957978/77070 . Since PyObject.ob_type is part of the limited API, I think this might be possible! ---------- nosy: +jhaberman _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:51:41 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 21:51:41 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627509101.25.0.169158162432.issue44762@roundup.psfhosted.org> Steve Dower added the comment: We could also provide a better check in WindowsConsoleIO.isatty, since that should have already handled most of the previous checks (I wouldn't want to do a typecheck in getpass, though). But yeah, this seems like "sys.stdin and sys.stdin.isatty()" is the right condition. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:52:15 2021 From: report at bugs.python.org (Steve Dower) Date: Wed, 28 Jul 2021 21:52:15 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627509135.62.0.320833136695.issue40263@roundup.psfhosted.org> Steve Dower added the comment: New changeset 899e37b202c8b096d55e2e3c300c9759ebfe7f7a by Miss Islington (bot) in branch '3.9': bpo-40263: Fixes an off-by-one error in _winapi_WaitForMultipleObjects_impl (GH-19501) https://github.com/python/cpython/commit/899e37b202c8b096d55e2e3c300c9759ebfe7f7a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:52:16 2021 From: report at bugs.python.org (Brandt Bucher) Date: Wed, 28 Jul 2021 21:52:16 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627509136.97.0.211005764711.issue43897@roundup.psfhosted.org> Change by Brandt Bucher : ---------- pull_requests: +25961 pull_request: https://github.com/python/cpython/pull/27432 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 17:55:48 2021 From: report at bugs.python.org (Ivan Borshchov) Date: Wed, 28 Jul 2021 21:55:48 +0000 Subject: [issue38902] image/webp support in mimetypes In-Reply-To: <1574548382.26.0.67471558876.issue38902@roundup.psfhosted.org> Message-ID: <1627509348.66.0.136110965004.issue38902@roundup.psfhosted.org> Ivan Borshchov added the comment: Very uncomfortable to work with webp without it And webp is now pretty hyped due to Google's Core Web Vitals update. E.g. pretty popular Django Storages relies on python native mimetype module, so because of this bug it always sets default application/octet-stream to AWS headers, so in the end when users click Open Image on new tab they get webp downloaded ??? https://github.com/jschneier/django-storages/blob/6071ac3410ee6ecd498b5691f1b45d376374bffc/storages/backends/s3boto.py#L391 ---------- nosy: +ivan2 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:21:25 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 28 Jul 2021 22:21:25 +0000 Subject: [issue15787] [meta issue] PEP 3121, 384 Refactoring In-Reply-To: <1346038565.61.0.980658052428.issue15787@psf.upfronthosting.co.za> Message-ID: <1627510885.31.0.198790461693.issue15787@roundup.psfhosted.org> Alexander Belopolsky added the comment: > The work is now tracked at bpo-1635741. Which work? bpo-1635741 does not appear to be a meta-issue and in msg381432 it loops back here. ---------- versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:27:55 2021 From: report at bugs.python.org (Alexander Belopolsky) Date: Wed, 28 Jul 2021 22:27:55 +0000 Subject: [issue15870] PyType_FromSpec should take metaclass as an argument In-Reply-To: <1346946566.36.0.583610018294.issue15870@psf.upfronthosting.co.za> Message-ID: <1627511275.36.0.101368218249.issue15870@roundup.psfhosted.org> Alexander Belopolsky added the comment: I'll reopen this issue to resume the discussion. The motivating case - PEP 3121 refactoring of the ctypes module - is still open. See bpo-15884. ---------- resolution: rejected -> stage: resolved -> patch review status: closed -> open versions: +Python 3.11 -Python 3.4 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:34:25 2021 From: report at bugs.python.org (Christian Heimes) Date: Wed, 28 Jul 2021 22:34:25 +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: <1627511665.29.0.153622769.issue42853@roundup.psfhosted.org> Christian Heimes added the comment: A patch would not land in Python 3.9 since this would be a new feature and out-of-scope for a released version. Do you really want to store gigabytes of downloads in RAM instead of doing chunked reads and store them on disk? If you cannot or don't want to write to disk, then there are easier and better ways to deal with large buffers. You could either mmap() or you could use a memoryview of a bytearray buffer: buf = bytearray(4 * 1024**3) view = memoryview(buf) pos = 0 while True: read = conn.recv_into(view[pos:pos+1048576]) if not read: break pos += read ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:48:57 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 28 Jul 2021 22:48:57 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627512537.4.0.22835539269.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 49b5e20fa8c091f9158ccd26f9a12fc1e91cfc93 by Jason R. Coombs in branch '3.9': [3.9] bpo-44461: Check early that a pdb target is valid for execution. (GH-27227) (GH-27400) https://github.com/python/cpython/commit/49b5e20fa8c091f9158ccd26f9a12fc1e91cfc93 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:50:05 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Wed, 28 Jul 2021 22:50:05 +0000 Subject: [issue44461] 'Pdb' object has no attribute 'botframe' In-Reply-To: <1624118124.56.0.165481666817.issue44461@roundup.psfhosted.org> Message-ID: <1627512605.06.0.575518653762.issue44461@roundup.psfhosted.org> Jason R. Coombs added the comment: This issue is solved. Thanks Irit for taking the time to investigate the issue and do the hard part of developing a test. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:56:15 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Jul 2021 22:56:15 +0000 Subject: [issue43548] RecursionError depth exceptions break pdb's interactive tracing. In-Reply-To: <1616121895.83.0.21835485789.issue43548@roundup.psfhosted.org> Message-ID: <1627512975.96.0.985069744383.issue43548@roundup.psfhosted.org> Irit Katriel added the comment: What do you mean by "it handles them as would be expected"? What is expected? Ideally, can you provide a script with another exception type that shows it? Specify also how you are running the script and what output you get. (I tried to modify your script but didn't see different behavior with other exceptions). ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:56:12 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 22:56:12 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627512972.52.0.51729103786.issue44752@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25962 pull_request: https://github.com/python/cpython/pull/27433 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 18:58:30 2021 From: report at bugs.python.org (Irit Katriel) Date: Wed, 28 Jul 2021 22:58:30 +0000 Subject: [issue43497] SyntaxWarning for "assertion is always true, perhaps remove parentheses?" does not work with constants In-Reply-To: <1615793485.02.0.990067169214.issue43497@roundup.psfhosted.org> Message-ID: <1627513110.39.0.19536705913.issue43497@roundup.psfhosted.org> Change by Irit Katriel : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:00:03 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 23:00:03 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1627513203.4.0.381540684377.issue19217@roundup.psfhosted.org> Jack DeVries added the comment: I'm going to go ahead and submit my PR under the assumption that Lukasz will probably prefer to actually be able to review it when he takes a look at this, and additionally we haven't heard from @eamanu. @eamanu, I'll close it if you would like to continue; just let me know! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:02:17 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 23:02:17 +0000 Subject: [issue19217] Calling assertEquals for moderately long list takes too long In-Reply-To: <1381410286.72.0.514206486634.issue19217@psf.upfronthosting.co.za> Message-ID: <1627513337.68.0.284604398738.issue19217@roundup.psfhosted.org> Change by Jack DeVries : ---------- pull_requests: +25963 pull_request: https://github.com/python/cpython/pull/27434 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:16:33 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 23:16:33 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627514193.39.0.740993607832.issue44768@roundup.psfhosted.org> Change by pavel-lexyr : ---------- resolution: -> rejected _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:16:05 2021 From: report at bugs.python.org (pavel-lexyr) Date: Wed, 28 Jul 2021 23:16:05 +0000 Subject: [issue44768] dataclasses.dataclass and collections.namedtuple do the same thing In-Reply-To: <1627504951.63.0.727220170445.issue44768@roundup.psfhosted.org> Message-ID: <1627514165.88.0.0568404501895.issue44768@roundup.psfhosted.org> pavel-lexyr added the comment: Thank you all for your input! Migrating the discussion to https://mail.python.org/archives/list/python-ideas at python.org/thread/UQRCDWMFNC5NRLLQCTYPOEGWJOIV7BGJ/ for now, if anyone wants to continue. ---------- resolution: rejected -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:23:10 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 23:23:10 +0000 Subject: [issue43548] RecursionError depth exceptions break pdb's interactive tracing. In-Reply-To: <1616121895.83.0.21835485789.issue43548@roundup.psfhosted.org> Message-ID: <1627514590.22.0.546431269358.issue43548@roundup.psfhosted.org> Jack DeVries added the comment: @behindthebrain, I noticed that this script behaves weirdly when I try to set breakpoints at various places. However, the problem goes away when I raise the recursion limit. Things in python will not work right if you set the recursion limit to a low value. For example, this hello, world program does not run at a recursion depth of four:: import sys sys.setrecursionlimit(4) print('hello, world') ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:27:23 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 23:27:23 +0000 Subject: [issue44393] segfault with sys.setrecursionlimit In-Reply-To: <1623403621.34.0.625867974474.issue44393@roundup.psfhosted.org> Message-ID: <1627514843.4.0.213092367642.issue44393@roundup.psfhosted.org> Jack DeVries added the comment: What about low recursion limits? This program causes a segfault for me:: import sys sys.setrecursionlimit(4) print('goodbye, world') ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:34:46 2021 From: report at bugs.python.org (Jack DeVries) Date: Wed, 28 Jul 2021 23:34:46 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match In-Reply-To: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> Message-ID: <1627515286.08.0.784729197427.issue44658@roundup.psfhosted.org> Jack DeVries added the comment: @brandtbucher yeah, you can close it, this was a silly idea. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 19:56:14 2021 From: report at bugs.python.org (Michel Hidalgo) Date: Wed, 28 Jul 2021 23:56:14 +0000 Subject: [issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor In-Reply-To: <1610487833.61.0.883604582572.issue42913@roundup.psfhosted.org> Message-ID: <1627516574.41.0.679106802446.issue42913@roundup.psfhosted.org> Michel Hidalgo added the comment: Circling back. I've been giving some thought to this. While this could be fixed within asyncio.proactor_events.ProactorEventLoop and asyncio.unix_events._UnixSelectorEventLoop implementations (e.g. calling signal.set_wakeup_fd once and forwarding signal numbers to subsequent instances through file descriptors or direct reference), I can't help thinking I've encountered this issue of contending signal API calls too many times already. Rarely two call sites cooperate with each other. So... how do people feel about changing the signal API module to enable multiple file descriptors and multiple signal handlers per signal? It'd be much simpler to use, and not only in asyncio. Implementation-wise, a lock-free singly linked list could be used to store them (may need to expose compare-and-swap atomic primitives in pycore_atomic.h). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 20:24:38 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 00:24:38 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627518278.51.0.249197355013.issue43897@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25964 pull_request: https://github.com/python/cpython/pull/27435 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 20:24:49 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Jul 2021 00:24:49 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627518289.39.0.665254479737.issue43897@roundup.psfhosted.org> Brandt Bucher added the comment: New changeset 8d0647485db5af2a0f0929d6509479ca45f1281b by Brandt Bucher in branch 'main': bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) https://github.com/python/cpython/commit/8d0647485db5af2a0f0929d6509479ca45f1281b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 21:02:18 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 01:02:18 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627520538.19.0.0137901560999.issue43897@roundup.psfhosted.org> miss-islington added the comment: New changeset 405f5c54914483607194a3ba6d4e50533d92bad1 by Miss Islington (bot) in branch '3.10': [3.10] bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432) (GH-27435) https://github.com/python/cpython/commit/405f5c54914483607194a3ba6d4e50533d92bad1 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 21:03:10 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Jul 2021 01:03:10 +0000 Subject: [issue43897] Implement support for validation of pattern matching ASTs In-Reply-To: <1618947333.54.0.307745509696.issue43897@roundup.psfhosted.org> Message-ID: <1627520590.26.0.82025807633.issue43897@roundup.psfhosted.org> Change by Brandt Bucher : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 21:06:36 2021 From: report at bugs.python.org (Marty) Date: Thu, 29 Jul 2021 01:06:36 +0000 Subject: [issue44770] float('nan') is True Message-ID: <1627520796.5.0.36513663962.issue44770@roundup.psfhosted.org> New submission from Marty : I know that there is numpy.isnan() for checking if a value is float('nan') but I think that native python should logically return False in bool(float('nan')). ---------- messages: 398448 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: float('nan') is True type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 21:45:40 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 29 Jul 2021 01:45:40 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627505384.74.0.594896525951.issue44765@roundup.psfhosted.org> Message-ID: Eesa Ibrahim Khokhar added the comment: Thanks! On Wed, Jul 28, 2021 at 4:50 PM pavel-lexyr wrote: > > Change by pavel-lexyr : > > > ---------- > keywords: +patch > nosy: +pavel-lexyr > nosy_count: 3.0 -> 4.0 > pull_requests: +25959 > stage: needs patch -> patch review > pull_request: https://github.com/python/cpython/pull/27430 > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 21:57:59 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Thu, 29 Jul 2021 01:57:59 +0000 Subject: [issue44770] float('nan') is True In-Reply-To: <1627520796.5.0.36513663962.issue44770@roundup.psfhosted.org> Message-ID: <1627523879.71.0.372169022542.issue44770@roundup.psfhosted.org> Dennis Sweeney added the comment: Do you have a particular use case for this? This is a backwards-incompatible change, and the existing behavior (the only false-y float being 0.0) is very old and well-established. If this change was implemented, I suspect almost every use of it would benefit from a clarifying comment like if x: # check for NaNs ... ...so that is a hint to me that using the existing math.isnan() (or numpy.isnan() if you have numpy) is more explicit and therefore more readable. I also think it would be confusing to have two different floats (0.0 and NaN) both be false-y. ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:21:28 2021 From: report at bugs.python.org (Tim Peters) Date: Thu, 29 Jul 2021 02:21:28 +0000 Subject: [issue44770] float('nan') is True In-Reply-To: <1627520796.5.0.36513663962.issue44770@roundup.psfhosted.org> Message-ID: <1627525288.66.0.30104719945.issue44770@roundup.psfhosted.org> Tim Peters added the comment: Sorry, I'm just going to close this. For values of all numeric types now, `bool(x)` returns the same as `x != type(x)(0)`. Besides being backward-incompatible, making an exception for NaN would be jarringly inconsistent. Note that you don't need numpy to conveniently check for a NaN anyway; Python's math.isnan() does the same. If you want to persist, please bring it up on the python-ideas mailing list. If it gains traction there, feel free to re-open this report. ---------- nosy: +tim.peters resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:27:14 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 29 Jul 2021 02:27:14 +0000 Subject: [issue42119] Error when debugging logging.FileHandler subclass __init__ method In-Reply-To: <1603384667.68.0.88562918356.issue42119@roundup.psfhosted.org> Message-ID: <1627525634.53.0.0879593221789.issue42119@roundup.psfhosted.org> Andrei Kulakov added the comment: Fran?oise: You can simply set the two attrs required by __repr__ in the pdb session: ./python.exe ~/temp/a.py --INS-- > /Users/ak/opensource/cpython/Lib/logging/__init__.py(1152)__init__() -> filename = os.fspath(filename) (Pdb) self.level=1 (Pdb) self.baseFilename='test.log' (Pdb) a self = filename = 'test.log' mode = 'a' encoding = None delay = False errors = None (Pdb) I think this can be closed as it's not a bug and there's a workaround as shown above. ---------- nosy: +andrei.avk versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:48:53 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 02:48:53 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 Message-ID: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> New submission from Jason R. Coombs : Importlib_resources 5.1 and 5.2 introduced the following changes (more details at https://importlib-resources.readthedocs.io/en/latest/history.html#v5-2-1): - Added ``simple`` module implementing adapters from a low-level resources reader interface to a ``TraversableResources`` interface. - Legacy API (``path``, ``contents``, ...) is now supported entirely by the ``.files()`` API with a compatibility shim supplied for resource loaders without that functionality. Let's incorporate those into the stdlib version. ---------- assignee: jaraco components: Library (Lib) messages: 398453 nosy: jaraco priority: normal severity: normal status: open title: Adopt changes from importlib_resources 5.2 versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:54:00 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 02:54:00 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627527240.71.0.231625425263.issue44771@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25965 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:54:00 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 02:54:00 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627527240.78.0.473749012835.issue40263@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +jaraco nosy_count: 8.0 -> 9.0 pull_requests: +25966 pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 22:59:21 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 02:59:21 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627527561.0.0.727049566004.issue44771@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 23:03:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 03:03:11 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627527791.7.0.95350616629.issue44771@roundup.psfhosted.org> Jason R. Coombs added the comment: I've put together a patch based on python/importlib_resources at 3b24bd6307, and interestingly, the tests pass... which is a little concerning because in https://github.com/python/importlib_resources/pull/221#discussion_r659214483, I describe a compatibility concern that I believe will be present only on the CPython implementation. Before we merge the changes, I'd like to (a) address that concern and (b) ideally write a test that captures that concern. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 23:14:23 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 03:14:23 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627528463.3.0.973897685658.issue44771@roundup.psfhosted.org> Jason R. Coombs added the comment: On further consideration, the concern I had may not be manifest in the implementation. It may be the _adapters.wrap_spec provides all the compatibility that's needed. I'll see if I can concoct an idiomatic case, but I may find that there's no concern at all. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 23:16:15 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 03:16:15 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627528575.09.0.99539773271.issue40263@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: -25966 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Wed Jul 28 23:16:30 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 03:16:30 +0000 Subject: [issue40263] ValueError exception on _winapi.WaitForMultipleObjects In-Reply-To: <1586715582.96.0.679053084097.issue40263@roundup.psfhosted.org> Message-ID: <1627528590.33.0.883805487725.issue40263@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: -jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 00:33:21 2021 From: report at bugs.python.org (paul j3) Date: Thu, 29 Jul 2021 04:33:21 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627533201.0.0.262929288529.issue44748@roundup.psfhosted.org> paul j3 added the comment: More on the refactoring of error handling in _parse_known_args https://bugs.python.org/issue29670#msg288990 This is in a issue wanting better handling of the pre-populated "required" arguments, https://bugs.python.org/issue29670 argparse: does not respect required args pre-populated into namespace ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 01:27:36 2021 From: report at bugs.python.org (Guido van Rossum) Date: Thu, 29 Jul 2021 05:27:36 +0000 Subject: [issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor In-Reply-To: <1610487833.61.0.883604582572.issue42913@roundup.psfhosted.org> Message-ID: <1627536456.59.0.159266928661.issue42913@roundup.psfhosted.org> Guido van Rossum added the comment: Have you investigated how that could be implemented and what the new API would look like? Personally I don't really like signals (they're not portable and code using them is super hard to get right) and I hesitate to add to their API. OTOH maybe you'll be able to find a champion for such a change among other core devs. I doubt that anyone is going to put any time in this based on a few messages from you though -- you must do the work. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 02:00:32 2021 From: report at bugs.python.org (Brandt Bucher) Date: Thu, 29 Jul 2021 06:00:32 +0000 Subject: [issue44658] No ValueError for duplicate key value in mapping patern when lengths do not match In-Reply-To: <1626467520.14.0.17639663764.issue44658@roundup.psfhosted.org> Message-ID: <1627538432.65.0.201052471122.issue44658@roundup.psfhosted.org> Change by Brandt Bucher : ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 02:05:21 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 06:05:21 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass In-Reply-To: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> Message-ID: <1627538721.53.0.884773709554.issue44749@roundup.psfhosted.org> Inada Naoki added the comment: Is this issue duplicate of https://bugs.python.org/issue32615 and https://bugs.python.org/issue1402289 ? ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 02:22:15 2021 From: report at bugs.python.org (Tarun Johar) Date: Thu, 29 Jul 2021 06:22:15 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627539735.39.0.493519171307.issue41103@roundup.psfhosted.org> Tarun Johar added the comment: Also filed under https://bugs.python.org/issue44609 PEP 384 and PEP 652 define a stable ABI to be used with Python 3.2 and later. On Windows, symbols for the stable ABI are exported from the python3.dll shared library. The following functions are present in Python 3.9 but have been removed from Python 3.10b3: PyObject_AsCharBuffer() PyObject_AsReadBuffer() PyObject_AsWriteBuffer() PyObject_CheckReadBuffer() Without these functions, an extension cannot utilize the stable ABI to access the buffer memory of data structures. The buffer protocol is suggested as an alternative, but the buffer functions PyObject_GetBuffer() and PyBuffer_Release() are not present in the stable ABI. While these two functions may be added to the stable ABI, removal of the four functions above makes Python 3.10 incompatible with previous versions. It is requested that the four functions be reinstated and maintained as described in PEP 652. ---------- nosy: +tarun.johar _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 02:48:34 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 06:48:34 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627541314.1.0.226876860845.issue41103@roundup.psfhosted.org> Inada Naoki added the comment: Oh, I didn't notice that APIs deprecated in Python 3.0 are included in stable ABIs defined at Python 3.2! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:03:04 2021 From: report at bugs.python.org (Pierre Quentel) Date: Thu, 29 Jul 2021 07:03:04 +0000 Subject: [issue44741] Pattern Matching - star subpattern with a subject derived from collections.abc.Sequence In-Reply-To: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> Message-ID: <1627542184.7.0.0270581795991.issue44741@roundup.psfhosted.org> Pierre Quentel added the comment: I found why len() is required, it's to avoid trying to match the subject (thus consuming a part of it) if its length is less than the number of non-star patterns, as explained in the PEP. My mistake, sorry. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:06:05 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 07:06:05 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627542365.51.0.318909400196.issue41103@roundup.psfhosted.org> Change by Inada Naoki : ---------- pull_requests: +25967 pull_request: https://github.com/python/cpython/pull/27437 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:18:20 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 07:18:20 +0000 Subject: [issue44609] Buffer support in the stable ABI In-Reply-To: <1626102302.84.0.543468149442.issue44609@roundup.psfhosted.org> Message-ID: <1627543100.14.0.28079586591.issue44609@roundup.psfhosted.org> Change by Inada Naoki : ---------- nosy: +methane _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:21:46 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 07:21:46 +0000 Subject: [issue44769] socketserver.shutdown should stop serve_forever() immediately In-Reply-To: <1627507959.35.0.467924205833.issue44769@roundup.psfhosted.org> Message-ID: <1627543306.55.0.767492663823.issue44769@roundup.psfhosted.org> Petr Viktorin added the comment: This isn't a high priority for me, but I have a WIP branch in https://github.com/encukou/cpython/tree/http-server-poll Feel free to continue it if you get to it sooner than I do. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:24:15 2021 From: report at bugs.python.org (Denis Laxalde) Date: Thu, 29 Jul 2021 07:24:15 +0000 Subject: [issue44564] DeprecationWarning in test_enum over formatting In-Reply-To: <1625459046.43.0.477755678755.issue44564@roundup.psfhosted.org> Message-ID: <1627543455.75.0.423845505902.issue44564@roundup.psfhosted.org> Denis Laxalde added the comment: The assertion at stake looks redundant since we already check that `'{}'.format(OkayEnum.one) == '1'` (the line above) and that `OkayEnum.one == '1'` (3 lines above). ---------- nosy: +dlax _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:30:32 2021 From: report at bugs.python.org (Bruce Merry) Date: Thu, 29 Jul 2021 07:30:32 +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: <1627543832.83.0.771914124611.issue42853@roundup.psfhosted.org> Bruce Merry added the comment: > A patch would not land in Python 3.9 since this would be a new feature and out-of-scope for a released version. I see it as a fix for this bug. While there is already a fix, it regresses another bug (bpo-36050), so this would be a better fix. > Do you really want to store gigabytes of downloads in RAM instead of doing chunked reads and store them on disk? I work on HPC applications where large quantities of data are stored in an S3-compatible object store and fetched over HTTP at 25Gb/s for processing. The data access layer tries very hard to avoid even making extra copies in memory (which is what caused me to file bpo-36050 in the first place) as it make a significant difference at those speeds. Buffering to disk would be right out. > then there are easier and better ways to deal with large buffers Your example code is probably fine if one is working directly on an SSLSocket, but http.client wraps it in a buffered reader (via `socket.makefile`), and that implements `readinto` by reading into a temporary and copying it (https://github.com/python/cpython/blob/8d0647485db5af2a0f0929d6509479ca45f1281b/Modules/_io/bufferedio.c#L88), which would add overhead. I appreciate that what I'm proposing is a relatively complex change for a released version. A less intrusive option would to be change MAXAMOUNT in http.client from 1MiB to 2GiB-1byte (as suggested by @matan1008). That would still leave 3.9 slower than 3.8 when reading >2GiB responses over plain HTTP, but at least everything in the range [1MiB, 2GiB) would operate at full speed (which is the region I actually care about). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:37:04 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 07:37:04 +0000 Subject: [issue25702] Link Time Optimizations support for GCC and CLANG In-Reply-To: <1448269180.86.0.895879966461.issue25702@psf.upfronthosting.co.za> Message-ID: <1627544224.9.0.814090483041.issue25702@roundup.psfhosted.org> Change by Inada Naoki : ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:48:15 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 07:48:15 +0000 Subject: [issue44688] [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation() In-Reply-To: <1626815639.0.0.124949004074.issue44688@roundup.psfhosted.org> Message-ID: <1627544895.3.0.688067492591.issue44688@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 5269c091458c5ea76eb625e4fabc9980b6309266 by Erlend Egeberg Aasland in branch 'main': bpo-44688: Remove ASCII limitation from `sqlite3` collation names (GH-27395) https://github.com/python/cpython/commit/5269c091458c5ea76eb625e4fabc9980b6309266 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:57:09 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 07:57:09 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627545429.2.0.173575616798.issue41103@roundup.psfhosted.org> Inada Naoki added the comment: Should I resurrect only function implementation and symbol? Or may I resurrect definitions in header files too? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:56:49 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 07:56:49 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627545409.86.0.211788013338.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: > Can we create PyType_GetDataSlot function to return the data pointer? No, see the borrowed pointer issues above. > I will create another PR after PR-23903 merged. Great, thank you! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:57:13 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 07:57:13 +0000 Subject: [issue42035] [C API] PyType_GetSlot cannot get tp_name In-Reply-To: <1602683525.08.0.938781399322.issue42035@roundup.psfhosted.org> Message-ID: <1627545433.33.0.457225201815.issue42035@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset a390ebea17a96d1c93fc5f75b1e19916090a4561 by Hai Shi in branch 'main': bpo-42035: Add a PyType_GetName() to get type's short name. (GH-23903) https://github.com/python/cpython/commit/a390ebea17a96d1c93fc5f75b1e19916090a4561 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 03:57:26 2021 From: report at bugs.python.org (Inada Naoki) Date: Thu, 29 Jul 2021 07:57:26 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627545446.76.0.26071277688.issue41103@roundup.psfhosted.org> Change by Inada Naoki : ---------- resolution: fixed -> stage: resolved -> status: closed -> open versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:10:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 09:10:19 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627549819.67.0.415808966533.issue43565@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25969 pull_request: https://github.com/python/cpython/pull/27440 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:10:13 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 09:10:13 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627549813.84.0.634872713058.issue43565@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25968 pull_request: https://github.com/python/cpython/pull/27439 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:10:29 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 09:10:29 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627549829.4.0.850992174511.issue43565@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 47fd4726a2ce8599cc397ddeae40f70eb471e868 by Ammar Askar in branch 'main': bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) https://github.com/python/cpython/commit/47fd4726a2ce8599cc397ddeae40f70eb471e868 ---------- nosy: +petr.viktorin _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:21:59 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 09:21: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: <1627550519.08.0.963828171378.issue42064@roundup.psfhosted.org> miss-islington added the comment: New changeset d542742128b634264d5b6796297613975211b43b by Erlend Egeberg Aasland in branch 'main': bpo-42064: Optimise `sqlite3` state access, part 1 (GH-27273) https://github.com/python/cpython/commit/d542742128b634264d5b6796297613975211b43b ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:28:33 2021 From: report at bugs.python.org (Douglas Raillard) Date: Thu, 29 Jul 2021 09:28:33 +0000 Subject: [issue44749] LOAD_NAME not using PyObject_GetItem when globals() is a dict subclass In-Reply-To: <1627395215.45.0.945166676554.issue44749@roundup.psfhosted.org> Message-ID: <1627550913.03.0.917767916124.issue44749@roundup.psfhosted.org> Douglas Raillard added the comment: Looks like it is, for some reason I did not find these previous issues when looking for existing ones. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:31:07 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 09:31:07 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627551067.97.0.857069364349.issue43565@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset b5bdc0c407d2d0587e591989e390ada9b9709502 by Miss Islington (bot) in branch '3.10': bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27439) https://github.com/python/cpython/commit/b5bdc0c407d2d0587e591989e390ada9b9709502 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:33:20 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 09:33:20 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627551200.69.0.558562628984.issue43565@roundup.psfhosted.org> Petr Viktorin added the comment: New changeset 7922546859e746a0f20f53bc80ce0581b72030aa by Miss Islington (bot) in branch '3.9': bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27440) https://github.com/python/cpython/commit/7922546859e746a0f20f53bc80ce0581b72030aa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 05:33:38 2021 From: report at bugs.python.org (Petr Viktorin) Date: Thu, 29 Jul 2021 09:33:38 +0000 Subject: [issue43565] PyUnicode_KIND macro does not has specified return type In-Reply-To: <1616202653.73.0.639291876959.issue43565@roundup.psfhosted.org> Message-ID: <1627551218.6.0.357926633979.issue43565@roundup.psfhosted.org> Petr Viktorin added the comment: Thank you for your attention to detail! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 06:28:09 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Jul 2021 10:28:09 +0000 Subject: [issue44772] Regression in memory use of instances due to dictionary ordering Message-ID: <1627554489.64.0.275505717552.issue44772@roundup.psfhosted.org> New submission from Mark Shannon : class C: def __init__(self, cond): if cond: self.a = 1 self.b = 2 c1 = C(True) c2 = C(False) In Python 3.5, the dictionary keys are shared --------------------------------------------- >>> sys.getsizeof(c2) 56 >>> sys.getsizeof(c1.__dict__) 96 >>> sys.getsizeof(c2.__dict__) 96 In Python 3.9, the keys are not shared -------------------------------------- >>> sys.getsizeof(c2) 48 >>> sys.getsizeof(c1.__dict__) 272 >>> sys.getsizeof(c2.__dict__) 232 This represents an increase of memory use for c1 of 110%. (48+272)/(56+96) == 2.1 With compact object layout (https://github.com/faster-cpython/ideas/issues/69), any failure to share keys will result in a tripling of memory use per object. It is not an uncommon pattern for some attributes to initialized lazily, which causes also prevents key-sharing. Not only does it increase memory use, it prevents optimizations that attempt to specialize attribute access for instances of a class, as different instances will have different layouts. The purpose of compact dicts was to save memory, but in this case we are using a lot more memory by preventing PEP 412 from working. ---------- keywords: 3.9regression messages: 398475 nosy: Mark.Shannon priority: normal severity: normal status: open title: Regression in memory use of instances due to dictionary ordering _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 06:31:08 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Jul 2021 10:31:08 +0000 Subject: [issue44590] Create frame objects lazily when needed In-Reply-To: <1625828020.36.0.429011373838.issue44590@roundup.psfhosted.org> Message-ID: <1627554668.82.0.497200967924.issue44590@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 Jul 29 06:46:56 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 10:46:56 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627555616.93.0.701576521796.issue41103@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25970 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27441 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 06:46:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 10:46:54 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627555614.58.0.72159072732.issue41103@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ce5e1a6809b714eb0383219190a076d9f883e008 by Inada Naoki in branch 'main': bpo-41103: Resurrect the old buffer protocol. (GH-27437) https://github.com/python/cpython/commit/ce5e1a6809b714eb0383219190a076d9f883e008 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 06:59:01 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 29 Jul 2021 10:59:01 +0000 Subject: [issue44688] [sqlite3] Remove ASCII limitation from sqlite3.Connection.create_collation() In-Reply-To: <1626815639.0.0.124949004074.issue44688@roundup.psfhosted.org> Message-ID: <1627556341.19.0.0874387024059.issue44688@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 Jul 29 07:32:13 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 11:32:13 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627558333.04.0.619620258509.issue41103@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6b922dae6cae9f212d678a36e8b41f2287cf5441 by Miss Islington (bot) in branch '3.10': bpo-41103: Resurrect the old buffer protocol. (GH-27437) (GH-27441) https://github.com/python/cpython/commit/6b922dae6cae9f212d678a36e8b41f2287cf5441 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:36:32 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Jul 2021 11:36:32 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627558592.36.0.496876326982.issue44707@roundup.psfhosted.org> Mark Shannon added the comment: New changeset e5c8ddb1714fb51ab1defa24352c98e0f01205dc by Serhiy Storchaka in branch 'main': bpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) https://github.com/python/cpython/commit/e5c8ddb1714fb51ab1defa24352c98e0f01205dc ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:36:38 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 11:36:38 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627558598.82.0.20841366423.issue44707@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25972 pull_request: https://github.com/python/cpython/pull/27443 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:36:33 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 11:36:33 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627558593.0.0.986680793833.issue44707@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25971 pull_request: https://github.com/python/cpython/pull/27442 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:40:39 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 11:40:39 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627558839.7.0.747412545492.issue44752@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +25973 pull_request: https://github.com/python/cpython/pull/27444 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:40:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 11:40:33 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627558833.6.0.0894355958918.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 50de8f74f8e92b20e76438c22b6a8f91afd6df75 by Jack DeVries in branch 'main': bpo-44752: Make rlcompleter not call `@property` methods (GH-27401) https://github.com/python/cpython/commit/50de8f74f8e92b20e76438c22b6a8f91afd6df75 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:40:45 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 11:40:45 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627558845.19.0.412808601707.issue44752@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25974 pull_request: https://github.com/python/cpython/pull/27445 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 07:46:27 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 11:46:27 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1627559187.51.0.296815230239.issue44711@roundup.psfhosted.org> ?ukasz Langa added the comment: Due to a non-zero (even if close to zero) likelihood that the change from type() comparison to an isinstance() check will change behavior, I merged it to 3.11 and 3.10 as 3.9 is already pretty far out in its bugfix releases. Thanks, Anton! ? ? ? ---------- nosy: +lukasz.langa resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:06:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 12:06:08 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627560368.37.0.641180019502.issue44707@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 761c641f19838517bcf8df5b91d2eb46880efe68 by Miss Islington (bot) in branch '3.10': bpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) (GH-27442) https://github.com/python/cpython/commit/761c641f19838517bcf8df5b91d2eb46880efe68 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:06:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 12:06:05 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627560365.56.0.20852372594.issue44707@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:06:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 12:06:08 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627560368.1.0.578866391548.issue44707@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 12fc0d28fcdeca32314d0755d3b30c7d96907440 by Miss Islington (bot) in branch '3.9': bpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) (GH-27443) https://github.com/python/cpython/commit/12fc0d28fcdeca32314d0755d3b30c7d96907440 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:07:09 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 12:07:09 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627560429.88.0.154609014252.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset d20f1095a6a51ee8f41ef445a009d26256e1fa61 by Miss Islington (bot) in branch '3.10': bpo-44752: Make rlcompleter not call `@property` methods (GH-27401) (GH-27444) https://github.com/python/cpython/commit/d20f1095a6a51ee8f41ef445a009d26256e1fa61 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:06:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 12:06:08 +0000 Subject: [issue44707] runtime error: applying zero offset to null pointer in Objects/listobject.c In-Reply-To: <1626938169.25.0.820707570973.issue44707@roundup.psfhosted.org> Message-ID: <1627560368.1.0.578866391548.issue44707@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 12fc0d28fcdeca32314d0755d3b30c7d96907440 by Miss Islington (bot) in branch '3.9': bpo-44707: Fix an undefined behavior of the null pointer arithmetic (GH-27292) (GH-27443) https://github.com/python/cpython/commit/12fc0d28fcdeca32314d0755d3b30c7d96907440 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 08:57:36 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Thu, 29 Jul 2021 12:57:36 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627563456.21.0.372085557449.issue44771@roundup.psfhosted.org> Jason R. Coombs added the comment: In [this comment](https://github.com/python/importlib_resources/pull/221#discussion_r679124389), I did more analysis and assuaged my own concerns about the implementation. Everything seems to be working as intended, thanks to the strong work by FFY00. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 09:53:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 13:53:51 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627566831.97.0.726474152006.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset acaf3b959492e7a84dcc9d46101ed6dc313768c8 by Miss Islington (bot) in branch '3.9': bpo-44752: Make rlcompleter not call `@property` methods (GH-27401) (#27445) https://github.com/python/cpython/commit/acaf3b959492e7a84dcc9d46101ed6dc313768c8 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:01:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 14:01:35 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627567295.62.0.0671255187072.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6741794dd420c6b9775a188690dbf265037cd69f by Jack DeVries in branch 'main': bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433) https://github.com/python/cpython/commit/6741794dd420c6b9775a188690dbf265037cd69f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:01:42 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 14:01:42 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627567302.14.0.271106685202.issue44752@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25975 pull_request: https://github.com/python/cpython/pull/27446 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:01:47 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 14:01:47 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627567307.57.0.543717138943.issue44752@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25976 pull_request: https://github.com/python/cpython/pull/27447 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:03:48 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 29 Jul 2021 14:03:48 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627567428.05.0.203801443153.issue44753@roundup.psfhosted.org> Change by Vinay Sajip : ---------- nosy: +vinay.sajip _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:03:24 2021 From: report at bugs.python.org (Vinay Sajip) Date: Thu, 29 Jul 2021 14:03:24 +0000 Subject: [issue43344] RotatingFileHandler breaks file type associations In-Reply-To: <1614465857.24.0.529577943251.issue43344@roundup.psfhosted.org> Message-ID: <1627567404.08.0.723084257111.issue43344@roundup.psfhosted.org> Vinay Sajip added the comment: > Could you please share best practices, looks like this documentation is missing. I don't think so, because the implementation of the namer is up to the user. Note that this specific issue relates to RotatingFileHandler, not TimedRotatingFileHandler. I will take a look at the other issue you raised. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 10:58:59 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 14:58:59 +0000 Subject: [issue32280] Expose `_PyRuntime` through a section name In-Reply-To: <1513034681.19.0.213398074469.issue32280@psf.upfronthosting.co.za> Message-ID: <1627570739.69.0.0940064967759.issue32280@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 12.0 -> 13.0 pull_requests: +25977 pull_request: https://github.com/python/cpython/pull/27448 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:05:39 2021 From: report at bugs.python.org (Joakim Nilsson) Date: Thu, 29 Jul 2021 15:05:39 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1607795510.65.0.341487246406.issue42626@roundup.psfhosted.org> Message-ID: <1627571139.27.0.248144949781.issue42626@roundup.psfhosted.org> Joakim Nilsson added the comment: Sorry, my mistake. If you remove the last line "input()" from readline.py, it should be reproducible. Tested on Python 3.9.2. Link to video demonstration of the bug: http://nijoakim.com/readline-example.mp4. ---------- Added file: https://bugs.python.org/file50190/readline-example.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:21:19 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 15:21:19 +0000 Subject: [issue32280] Expose `_PyRuntime` through a section name In-Reply-To: <1513034681.19.0.213398074469.issue32280@psf.upfronthosting.co.za> Message-ID: <1627572079.58.0.655095477631.issue32280@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset ebba286709bdb9401df8e5eb196b50008d3b09d2 by Miss Islington (bot) in branch '3.10': bpo-32280: Store _PyRuntime in a named section (GH-4802) (#27448) https://github.com/python/cpython/commit/ebba286709bdb9401df8e5eb196b50008d3b09d2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:44:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 15:44:54 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627573494.07.0.278226284434.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f8e13e35d12bee6e3447c791199522249ba7f05a by Miss Islington (bot) in branch '3.10': bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433) (GH-27447) https://github.com/python/cpython/commit/f8e13e35d12bee6e3447c791199522249ba7f05a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:46:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 15:46:11 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627573571.39.0.993706190313.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 93d90871d216625b8d9db0fa59693953353d19ae by Miss Islington (bot) in branch '3.9': bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433) (GH-27446) https://github.com/python/cpython/commit/93d90871d216625b8d9db0fa59693953353d19ae ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:48:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 15:48:38 +0000 Subject: [issue44752] Tab completion executes @property getter function In-Reply-To: <1627422107.77.0.358238210778.issue44752@roundup.psfhosted.org> Message-ID: <1627573718.59.0.965195249673.issue44752@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Jack! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 11:57:11 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 15:57:11 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627574231.89.0.0111532536318.issue36050@roundup.psfhosted.org> ?ukasz Langa added the comment: Inadasan is right, this is still fixed in 3.10 and 3.11. The 3.9 revert is due to 3.9 supporting OpenSSL older than 1.1.1. 3.10+ requires OpenSSL 1.1.1+ per PEP 644. There is nothing to do here. ---------- resolution: -> fixed stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:08:26 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 16:08:26 +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: <1627574906.16.0.720768349468.issue42853@roundup.psfhosted.org> ?ukasz Langa added the comment: > This fix is going to cause a regression of bpo-36050. Would it not be possible to fix this in _ssl.c (by breaking a large read into multiple smaller calls to SSL_read)? It seems like fixing this at the SSL layer is more appropriate than trying to work around it at the HTTP layer, and thus impacting the performance of all HTTP fetches (whether using TLS or not, and whether >2GB or not). Bruce, you're discussing the *revert* of the bpo-36050 change as if it was a new change. It isn't, it is literally returning to a state that was previously tested and worked fine since Python 3.5. By reverting, we're choosing correctness over performance here. Introducing a new implementation for bpo-36050 is now out of scope for 3.9 as it's a performance-oriented change which we cannot accept in a bugfix release. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:12:33 2021 From: report at bugs.python.org (Bruce Merry) Date: Thu, 29 Jul 2021 16:12:33 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627575153.1.0.656399872806.issue36050@roundup.psfhosted.org> Bruce Merry added the comment: > There is nothing to do here. Will you accept patches to fix this for 3.9? I'm not clear whether the "bug fixes only" status of 3.9 allows for fixing performance regressions. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:22:53 2021 From: report at bugs.python.org (Bruce Merry) Date: Thu, 29 Jul 2021 16:22:53 +0000 Subject: [issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT In-Reply-To: <1550667343.87.0.589252473583.issue36050@roundup.psfhosted.org> Message-ID: <1627575773.08.0.538419686031.issue36050@roundup.psfhosted.org> Bruce Merry added the comment: > Will you accept patches to fix this for 3.9? I'm not clear whether the "bug fixes only" status of 3.9 allows for fixing performance regressions. Never mind, I see your already answered this on bpo-42853 (as a no). Thanks for taking the time to answer my questions; I'll just have to skip Python 3.9 for this particular application and go straight to 3.10. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:27:12 2021 From: report at bugs.python.org (Mark Shannon) Date: Thu, 29 Jul 2021 16:27:12 +0000 Subject: [issue44725] Expose specialization stats in python In-Reply-To: <1627049048.24.0.175321998203.issue44725@roundup.psfhosted.org> Message-ID: <1627576032.87.0.886089916066.issue44725@roundup.psfhosted.org> Mark Shannon added the comment: New changeset ddd1c418c05da0de978c75dfb3e4a5b8d27e1d9f by Irit Katriel in branch 'main': bpo-44725 : expose specialization stats in python (GH-27192) https://github.com/python/cpython/commit/ddd1c418c05da0de978c75dfb3e4a5b8d27e1d9f ---------- nosy: +Mark.Shannon _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:30:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 29 Jul 2021 16:30:47 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1607795510.65.0.341487246406.issue42626@roundup.psfhosted.org> Message-ID: <1627576247.23.0.756602863644.issue42626@roundup.psfhosted.org> Andrei Kulakov added the comment: I was able to reproduce something very similar, and I believe essentially the same issue perhaps varying due to config. I think I've actually seen similar glitches with python command line readline handling of k. So, entering 1234 always works fine. The issue starts with 5 chars: 1234 12345 12345 12345 As you can see, the line is duplicated and going up to it shifts cursor to the right, at first the duplication on the right side is blank but if I move the cursor to the right, the '1234' are revealed. '5' is still hidden. Then I have to press 'a' to see the '5' revealed and go into insert mode. There's no way to go to the left of the duplicated string. I hope someone more experienced in readline or more motivated can look more into this. I duplicated it in 3.11 built from source, on MacOS Big Sur (on M1 cpu, but that shouldn't matter). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:38:11 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 29 Jul 2021 16:38:11 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1607795510.65.0.341487246406.issue42626@roundup.psfhosted.org> Message-ID: <1627576691.12.0.186774033805.issue42626@roundup.psfhosted.org> Andrei Kulakov added the comment: Also this bug happens on both iterm2 and terminal on MacOS, but note that on 'terminal', it's impossible to ctrl-c or ctrl-z out of the test script, so if you test it, you will need to close the window or the tab, and lose shell history and background jobs, so beware. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:55:23 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 16:55:23 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627577723.41.0.276694804035.issue44765@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25979 pull_request: https://github.com/python/cpython/pull/27451 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:55:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 16:55:17 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627577717.21.0.988748457393.issue44765@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25978 pull_request: https://github.com/python/cpython/pull/27450 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 12:55:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 16:55:17 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627577717.53.0.307234775583.issue44765@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ccefa8a905c797e4a60078d5e1de846f929c6928 by Pavel in branch 'main': bpo-44765: [doc] fix typo (GH-27430) https://github.com/python/cpython/commit/ccefa8a905c797e4a60078d5e1de846f929c6928 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:08:17 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 17:08:17 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1627578497.67.0.521140047653.issue37224@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25980 pull_request: https://github.com/python/cpython/pull/27452 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:10:44 2021 From: report at bugs.python.org (Nimboss) Date: Thu, 29 Jul 2021 17:10:44 +0000 Subject: [issue44773] case_insensitive kwarg to str.replace() Message-ID: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> New submission from Nimboss : Currently str.replace() has 3 arguments: old, new and count. This issue suggests the new addition of another argument called case_insensitive (type bool, defaulted to False) which determines whether to ignore case when replacing said text or not. Currently we have to use regex or logic (see https://stackoverflow.com/questions/919056/case-insensitive-replace), but it would just be a nice QoL feature to have a case_insensitive kwarg. ---------- components: Parser messages: 398501 nosy: lys.nikolaou, nimit.grover24, pablogsal priority: normal severity: normal status: open title: case_insensitive kwarg to str.replace() type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:14:45 2021 From: report at bugs.python.org (Nimboss) Date: Thu, 29 Jul 2021 17:14:45 +0000 Subject: [issue44773] case_insensitive kwarg in str.replace() In-Reply-To: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> Message-ID: <1627578885.93.0.841913092794.issue44773@roundup.psfhosted.org> Change by Nimboss : ---------- title: case_insensitive kwarg to str.replace() -> case_insensitive kwarg in str.replace() _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:23:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 17:23:04 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627579384.42.0.619691058065.issue44765@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 86545bd94cc0ae05334a2d775257ee38937c420d by Miss Islington (bot) in branch '3.10': bpo-44765: [doc] fix typo (GH-27430) (GH-27450) https://github.com/python/cpython/commit/86545bd94cc0ae05334a2d775257ee38937c420d ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:23:21 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 17:23:21 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627579401.76.0.675222346155.issue44765@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6d4af4dfd6a361014e9a59d12b9f0b5a56061d22 by Miss Islington (bot) in branch '3.9': bpo-44765: [doc] fix typo (GH-27430) (GH-27451) https://github.com/python/cpython/commit/6d4af4dfd6a361014e9a59d12b9f0b5a56061d22 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:23:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 17:23:52 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627579432.78.0.481574400498.issue44765@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:28:06 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 17:28:06 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1627579686.46.0.384779788166.issue37224@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +25981 pull_request: https://github.com/python/cpython/pull/27453 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:32:05 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 17:32:05 +0000 Subject: [issue37224] [subinterpreters] test__xxsubinterpreters fails randomly In-Reply-To: <1560214681.61.0.906498246375.issue37224@roundup.psfhosted.org> Message-ID: <1627579925.02.0.817510549714.issue37224@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:38:25 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 29 Jul 2021 17:38:25 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627579432.78.0.481574400498.issue44765@roundup.psfhosted.org> Message-ID: Eesa Ibrahim Khokhar added the comment: You're welcome! It's an honor to be emailed by the core developer of the Python interpreter and standard library! On Thu, Jul 29, 2021 at 1:23 PM ?ukasz Langa wrote: > > ?ukasz Langa added the comment: > > Thanks! ? ? ? > > ---------- > resolution: -> fixed > stage: patch review -> resolved > status: open -> closed > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:39:21 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 17:39:21 +0000 Subject: [issue44773] case_insensitive kwarg in str.replace() In-Reply-To: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> Message-ID: <1627580361.46.0.9875819394.issue44773@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: -pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:40:38 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 29 Jul 2021 17:40:38 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: Message-ID: Eesa Ibrahim Khokhar added the comment: Messaged, not emailed ? On Thu, Jul 29, 2021 at 1:38 PM Eesa Ibrahim Khokhar < khokhareesa.home at gmail.com> wrote: > You're welcome! > > It's an honor to be emailed by the core developer of the Python > interpreter and standard library! > > On Thu, Jul 29, 2021 at 1:23 PM ?ukasz Langa > wrote: > >> >> ?ukasz Langa added the comment: >> >> Thanks! ? ? ? >> >> ---------- >> resolution: -> fixed >> stage: patch review -> resolved >> status: open -> closed >> >> _______________________________________ >> Python tracker >> >> _______________________________________ >> > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:41:35 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 29 Jul 2021 17:41:35 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: Message-ID: Eesa Ibrahim Khokhar added the comment: Also an honor to be messaged by the primary author of the following approved Python enhancement proposals: PEP 443, PEP 541, PEP 563, PEP 585, PEP 602! On Thu, Jul 29, 2021 at 1:40 PM Eesa Ibrahim Khokhar < khokhareesa.home at gmail.com> wrote: > Messaged, not emailed ? > > On Thu, Jul 29, 2021 at 1:38 PM Eesa Ibrahim Khokhar < > khokhareesa.home at gmail.com> wrote: > >> You're welcome! >> >> It's an honor to be emailed by the core developer of the Python >> interpreter and standard library! >> >> On Thu, Jul 29, 2021 at 1:23 PM ?ukasz Langa >> wrote: >> >>> >>> ?ukasz Langa added the comment: >>> >>> Thanks! ? ? ? >>> >>> ---------- >>> resolution: -> fixed >>> stage: patch review -> resolved >>> status: open -> closed >>> >>> _______________________________________ >>> Python tracker >>> >>> _______________________________________ >>> >> ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 13:44:47 2021 From: report at bugs.python.org (Eesa Ibrahim Khokhar) Date: Thu, 29 Jul 2021 17:44:47 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: Message-ID: Eesa Ibrahim Khokhar added the comment: And further honor to be messaged by the Co-chair of the Python Language! On Thu, Jul 29, 2021 at 1:41 PM Eesa Ibrahim Khokhar wrote: > > Eesa Ibrahim Khokhar added the comment: > > Also an honor to be messaged by the primary author of the following > approved Python enhancement proposals: PEP 443, PEP 541, PEP 563, PEP 585, > PEP 602! > > On Thu, Jul 29, 2021 at 1:40 PM Eesa Ibrahim Khokhar < > khokhareesa.home at gmail.com> wrote: > > > Messaged, not emailed ? > > > > On Thu, Jul 29, 2021 at 1:38 PM Eesa Ibrahim Khokhar < > > khokhareesa.home at gmail.com> wrote: > > > >> You're welcome! > >> > >> It's an honor to be emailed by the core developer of the Python > >> interpreter and standard library! > >> > >> On Thu, Jul 29, 2021 at 1:23 PM ?ukasz Langa > >> wrote: > >> > >>> > >>> ?ukasz Langa added the comment: > >>> > >>> Thanks! ? ? ? > >>> > >>> ---------- > >>> resolution: -> fixed > >>> stage: patch review -> resolved > >>> status: open -> closed > >>> > >>> _______________________________________ > >>> Python tracker > >>> > >>> _______________________________________ > >>> > >> > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:03:58 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 29 Jul 2021 19:03:58 +0000 Subject: [issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489) In-Reply-To: <1602963425.44.0.576962569847.issue42064@roundup.psfhosted.org> Message-ID: <1627585438.33.0.817643441761.issue42064@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25982 pull_request: https://github.com/python/cpython/pull/27456 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:14:24 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Jul 2021 19:14:24 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627586064.84.0.718381034272.issue44762@roundup.psfhosted.org> Eryk Sun added the comment: It should be noted that changing win_getpass() to check sys.stdin.isatty() makes it inconsistent with unix_getpass(). The latter tries to open "/dev/tty" regardless of sys.stdin. To be consistent, win_getpass() would be implemented to call fallback_getpass() only if "CONIN$" is inaccessible. We'd still have the problem that's reported here. A classic console session (not ConPTY) can have no window, or an invisible window, and thus no way for a user to enter text. I don't see any reports that reading from "/dev/tty" makes getpass() wait forever in POSIX, so this situation is probably unique to Windows, or at least it's far more likely in Windows, which may justify introducing an inconsistency. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:15:41 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Jul 2021 19:15:41 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627586141.37.0.683340419086.issue44762@roundup.psfhosted.org> Eryk Sun added the comment: > We could also provide a better check in WindowsConsoleIO.isatty, For isatty(), my concern is a false positive if the file is the "NUL" device, which should be an io.FileIO object. I suppose checking the file type in io._WindowsConsoleIO.isatty() could be useful in case the file descriptor gets reassigned to a non-console file (e.g. via os.close or os.dup2). I'd prefer to implement the check in a common _Py_isatty() function that supports the optional errno values EBADF and ENOTTY [1]. For example: int _Py_isatty(int fd) { DWORD mode; HANDLE handle = _Py_get_osfhandle_noraise(fd); if (handle == INVALID_HANDLE_VALUE) { errno = EBADF; return 0; } switch (GetFileType(handle)) { case FILE_TYPE_CHAR: break; case FILE_TYPE_DISK: case FILE_TYPE_PIPE: errno = ENOTTY; return 0; default: errno = EBADF; return 0; } if (!GetConsoleMode(handle, &mode) && GetLastError() != ERROR_ACCESS_DENIED) { errno = ENOTTY; return 0; } return 1; } --- [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/isatty.html ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:24:43 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 19:24:43 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627586683.69.0.556577304756.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25983 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27460 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:32:04 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 19:32:04 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627587124.53.0.408804225346.issue44762@roundup.psfhosted.org> Steve Dower added the comment: > I suppose checking the file type in io._WindowsConsoleIO.isatty() could be useful in case the file descriptor gets reassigned to a non-console file (e.g. via os.close or os.dup2). Pretty sure we currently don't support these anyway. WindowsConsoleIO doesn't actually use the standard file descriptors for stdin/out/err - it creates new ones based on the real handles just in case a caller requests them. In my opinion, correctness of "write to console" outweighs correctness of "manually close the console FD and wait for a new one with the same number to be opened" ;) If we have WindowsConsoleIO as the type, it shouldn't be possible for it to refer to any kind of file other than the console or it would be a FileIO. If that's no longer true, we should fix that first. WindowsConsoleIO.isatty ought to be "return True". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:44:55 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Thu, 29 Jul 2021 19:44:55 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1627587895.95.0.287079060727.issue44662@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 8182c8329c709f42218a8a17d81639ece5b7b627 by Yurii Karabas in branch 'main': bpo-44662: Add ability to annotate types.Union (#27214) https://github.com/python/cpython/commit/8182c8329c709f42218a8a17d81639ece5b7b627 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:46:19 2021 From: report at bugs.python.org (miss-islington) Date: Thu, 29 Jul 2021 19:46:19 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1627587979.39.0.28087029057.issue44662@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25984 pull_request: https://github.com/python/cpython/pull/27461 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:53:32 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 19:53:32 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627588412.88.0.559801135454.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset 3edec5d142365f2340865b4f12652e6aa627818a by Steve Dower in branch 'main': bpo-44479: Do not regenerate files during a PGO build as it will invalidate the profile. (GH-27460) https://github.com/python/cpython/commit/3edec5d142365f2340865b4f12652e6aa627818a ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 15:45:36 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 19:45:36 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627587936.46.0.717419852458.issue31746@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 7e311e496b0e26b3d3c62fe9b0ed2a4677c37ee9 by Erlend Egeberg Aasland in branch 'main': bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431) https://github.com/python/cpython/commit/7e311e496b0e26b3d3c62fe9b0ed2a4677c37ee9 ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:01:53 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 20:01:53 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627588913.98.0.261284891115.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- pull_requests: +25985 pull_request: https://github.com/python/cpython/pull/27462 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:14:46 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 20:14:46 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627589686.03.0.0108819540195.issue31746@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25986 pull_request: https://github.com/python/cpython/pull/27463 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:25:46 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 29 Jul 2021 20:25:46 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627590346.21.0.770592505092.issue31746@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25987 pull_request: https://github.com/python/cpython/pull/27464 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:35:27 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Thu, 29 Jul 2021 20:35:27 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627590927.79.0.566621774939.issue31746@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25988 pull_request: https://github.com/python/cpython/pull/27465 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:47:31 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 20:47:31 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627591651.82.0.72614928737.issue31746@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 2d34664051bd014d3b807e51ac7c53f37d90f444 by Erlend Egeberg Aasland in branch 'main': bpo-31746: Fix broken call in GH-27431 (GH-27464) https://github.com/python/cpython/commit/2d34664051bd014d3b807e51ac7c53f37d90f444 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:50:24 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 29 Jul 2021 20:50:24 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627591824.21.0.802861849502.issue43596@roundup.psfhosted.org> Irit Katriel added the comment: What you are suggesting replaces the type of the exception being raised. If it's something like a MemoryError or KeyboardInterrupt you don't want that, you want your test process to terminate. ---------- nosy: +iritkatriel _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 16:50:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Thu, 29 Jul 2021 20:50:36 +0000 Subject: [issue43596] change assertRaises message when wrong exception is raised In-Reply-To: <1616429766.92.0.297524624601.issue43596@roundup.psfhosted.org> Message-ID: <1627591836.3.0.392415894423.issue43596@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Library (Lib) _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 17:13:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Thu, 29 Jul 2021 21:13:11 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627593191.89.0.283473580538.issue31746@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 0bc17658f5724ce60c3f75acc01e7526f1720efe by Erlend Egeberg Aasland in branch '3.9': [3.9] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431) (GH-27465) https://github.com/python/cpython/commit/0bc17658f5724ce60c3f75acc01e7526f1720efe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 17:15:56 2021 From: report at bugs.python.org (Jack Humphries) Date: Thu, 29 Jul 2021 21:15:56 +0000 Subject: [issue44745] Manual for python 3.9.6 will not let me search In-Reply-To: <1627337354.47.0.497539026172.issue44745@roundup.psfhosted.org> Message-ID: <1627593356.07.0.511801243132.issue44745@roundup.psfhosted.org> Jack Humphries added the comment: This may be a build system problem. Building the v3.9.6 tag locally on Windows 10.0.19043 produces a help file that can properly search. On top of that locally built python396.chm file output is 3MB larger (around the same size as the 3.9.5 help file). ---------- nosy: +distroJack _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 17:16:25 2021 From: report at bugs.python.org (Eryk Sun) Date: Thu, 29 Jul 2021 21:16:25 +0000 Subject: [issue44762] getpass.getpass on Windows fallback detection is bad In-Reply-To: <1627477688.83.0.954525196129.issue44762@roundup.psfhosted.org> Message-ID: <1627593385.24.0.249112465538.issue44762@roundup.psfhosted.org> Eryk Sun added the comment: > WindowsConsoleIO doesn't actually use the standard file descriptors > for stdin/out/err To resolve bpo-30555, _WindowsConsoleIO was changed to eliminate self->handle and get the underlying handle dynamically via _get_osfhandle(). It's thus susceptible to close() and dup2() calls in Python or a C library. This consequence was noted. The alternative was to duplicate the OS handle that self->fd wraps, isolating it from self->handle. But then self->fd could get closed, or duped to another file. Either way there are file and file-type sync problems. It's not going to work in the seamless way that people are used to in POSIX, which only uses a single io.FileIO type. I think a better resolution will be possible in the context of your side project, if you're still working on it... ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 17:29:38 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Thu, 29 Jul 2021 21:29:38 +0000 Subject: [issue44773] case_insensitive kwarg in str.replace() In-Reply-To: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> Message-ID: <1627594178.49.0.748746636724.issue44773@roundup.psfhosted.org> Raymond Hettinger added the comment: I don't think this should be done. If case doesn't matter at all, the input can be casefolded before the replacement: s.casefold().replace('hippo', 'giraffe'). If it can't be casefolded in advance because the case actually matters, then ?it doesn't make sense to mix a case-insensitive search step with a case-sensitive replacement. Presumably if case matters at all in the original string, then the new text would need to match the case of the old text. With the example in the selected StackOverflow answer, we get undesirable output for most of the case variants: ?strings = [ ?'I WANT A HIPPO FOR MY BIRTHDAY!', # lowercase giraffe doesn't fit ?'I want a hippo for my birthday.', # only makes sense when the case matches ?'I Want A Hippo for My Birthday', # lowercase giraffe doesn't fit ?'I want a hIPpo for my birthday', # desired outcome unknown ?] ?for s in strings: ?print(s.replace('hippo', 'giraffe', case_insensitive=True) ISTM that every answer in the StackOverflow entry has only a toy examples and wouldn't make sense for real text where case is retained everywhere except for the substitutions. ---------- nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 18:18:36 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 22:18:36 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627597116.38.0.00772908376147.issue44479@roundup.psfhosted.org> Steve Dower added the comment: New changeset 0b984d1cccc9547c2c16203e9ab2b2959fbabcde by Steve Dower in branch '3.10': bpo-44479: Do not regenerate files during a PGO build as it will invalidate the profile. (GH-27462) https://github.com/python/cpython/commit/0b984d1cccc9547c2c16203e9ab2b2959fbabcde ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 18:19:01 2021 From: report at bugs.python.org (Steve Dower) Date: Thu, 29 Jul 2021 22:19:01 +0000 Subject: [issue44479] Windows build doesn't regenerate some files In-Reply-To: <1624316698.29.0.317613694967.issue44479@roundup.psfhosted.org> Message-ID: <1627597141.59.0.966663194579.issue44479@roundup.psfhosted.org> Change by Steve Dower : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 18:44:49 2021 From: report at bugs.python.org (=?utf-8?q?Anton_Gr=C3=BCbel?=) Date: Thu, 29 Jul 2021 22:44:49 +0000 Subject: [issue44711] Optimize type check in pipes.py In-Reply-To: <1626983428.37.0.292600316.issue44711@roundup.psfhosted.org> Message-ID: <1627598689.86.0.215443650232.issue44711@roundup.psfhosted.org> Anton Gr?bel added the comment: I'm still super happy to had the chance to contribute a bit to Python and it will be available already in version 3.10 <3 Thanks Serhiy & Lukasz! ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 19:34:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Thu, 29 Jul 2021 23:34:45 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1607795510.65.0.341487246406.issue42626@roundup.psfhosted.org> Message-ID: <1627601685.51.0.548800508315.issue42626@roundup.psfhosted.org> Andrei Kulakov added the comment: Joakim: by the way, what I was able to reproduce is just a visual bug. IOW, the text is still the same and all there in the buffer, but it shows up only after a combination of rightward movement and 'a', and a copy of it shows up on the left side. So it's not as serious as if the text was garbled or impossible to enter or change. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 21:05:13 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 01:05:13 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627607113.73.0.623694286622.issue44771@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset aaa83cdfab6817446285e631232f64b394ac6791 by Jason R. Coombs in branch 'main': bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) https://github.com/python/cpython/commit/aaa83cdfab6817446285e631232f64b394ac6791 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 21:05:58 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 01:05:58 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627607158.02.0.165445945881.issue41911@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +25989 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27470 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 21:06:29 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 01:06:29 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627607189.5.0.272622255603.issue44771@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 Thu Jul 29 21:07:40 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 01:07:40 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627607260.09.0.0807977328928.issue41911@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up a PR here: https://github.com/python/cpython/pull/27470/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 22:14:55 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 02:14:55 +0000 Subject: [issue44195] importlib.abc.TraversableReader is not implemented In-Reply-To: <1621538392.98.0.999702978705.issue44195@roundup.psfhosted.org> Message-ID: <1627611295.06.0.566676311315.issue44195@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 Thu Jul 29 23:23:35 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 03:23:35 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627615415.75.0.51308772915.issue41737@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +25990 pull_request: https://github.com/python/cpython/pull/27471 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Thu Jul 29 23:24:47 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 03:24:47 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627615487.19.0.231442886983.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up a PR that expands the docs for NotADirectoryError here: https://github.com/python/cpython/pull/27471/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 01:29:50 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 30 Jul 2021 05:29:50 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627622990.3.0.224175069008.issue31746@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- pull_requests: +25991 pull_request: https://github.com/python/cpython/pull/27472 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 03:30:27 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 30 Jul 2021 07:30:27 +0000 Subject: [issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak In-Reply-To: <1565194972.64.0.065323919799.issue37788@roundup.psfhosted.org> Message-ID: <1627630227.46.0.449144603759.issue37788@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +25992 pull_request: https://github.com/python/cpython/pull/27473 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 03:37:08 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 30 Jul 2021 07:37:08 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627630628.06.0.679911620374.issue31746@roundup.psfhosted.org> Change by Erlend E. Aasland : ---------- assignee: -> erlendaasland status: open -> pending versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 03:59:04 2021 From: report at bugs.python.org (Danny Lin) Date: Fri, 30 Jul 2021 07:59:04 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627631944.52.0.947403439869.issue41737@roundup.psfhosted.org> Danny Lin added the comment: > I've put up a PR that expands the docs for NotADirectoryError here: > https://github.com/python/cpython/pull/27471/files Thank you. Wouldn't it be more clear if an example is provided? Like: (e.g. `/path/to` does not exist when running `open('/path/to/file')`) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 04:52:55 2021 From: report at bugs.python.org (Pierre Carbonnelle) Date: Fri, 30 Jul 2021 08:52:55 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer Message-ID: <1627635175.38.0.412704828047.issue44774@roundup.psfhosted.org> New submission from Pierre Carbonnelle : The following code print("outside:", sys.stdout.encoding) with redirect_stdout(io.StringIO()) as f: print("inside: ", sys.stdout.encoding) print(f.getvalue()) yields: outside: utf-8 inside: None Because StringIO is a string buffer, the expected result is: outside: utf-8 inside: utf-8 This creates problem when using packages whose output depends on the sys.stdout.encoding, such as z3-solver. ---------- components: Library (Lib) messages: 398528 nosy: pcarbonn priority: normal severity: normal status: open title: incorrect sys.stdout.encoding within a io.StringIO buffer type: behavior versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:28:49 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 30 Jul 2021 09:28:49 +0000 Subject: [issue44775] Speed-up typing.cast by implementing it in C Message-ID: <1627637329.45.0.691022355252.issue44775@roundup.psfhosted.org> New submission from Yurii Karabas <1998uriyyo at gmail.com>: In scope of https://github.com/python/cpython/pull/27262 we have introduce `_typing` module with typing related helper functions. It will be great to speedup `typing.cast` function by implementing it in C. I have already done it and here is results: ``` import timeit import typing import _typing def _timeit(m): print(m.__name__, timeit.timeit("cast(int, 1)", globals={"cast": m.cast})) _timeit(typing) _timeit(_typing) ``` ``` typing 0.0702372890082188 _typing 0.033294505992671475 ``` ---------- components: Library (Lib) messages: 398529 nosy: kj, uriyyo priority: normal severity: normal status: open title: Speed-up typing.cast by implementing it in C type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:29:04 2021 From: report at bugs.python.org (Joakim Nilsson) Date: Fri, 30 Jul 2021 09:29:04 +0000 Subject: [issue42626] readline history, vi-editingmode and ANSI color codes bug In-Reply-To: <1627601685.51.0.548800508315.issue42626@roundup.psfhosted.org> Message-ID: Joakim Nilsson added the comment: Yes, I have noticed that too, and I agree, not as bad as if it was garbled, but still an annoyance. On Fri, Jul 30, 2021 at 1:34 AM Andrei Kulakov wrote: > > Andrei Kulakov added the comment: > > Joakim: by the way, what I was able to reproduce is just a visual bug. > IOW, the text is still the same and all there in the buffer, but it shows > up only after a combination of rightward movement and 'a', and a copy of it > shows up on the left side. So it's not as serious as if the text was > garbled or impossible to enter or change. > > ---------- > > _______________________________________ > Python tracker > > _______________________________________ > ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:32:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 09:32:03 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1627637523.49.0.815564051246.issue44662@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 472997659b9c73089cdc22bd7eded6f6fdcffdfe by Miss Islington (bot) in branch '3.10': bpo-44662: Add ability to annotate types.Union (GH-27214) (GH-27461) https://github.com/python/cpython/commit/472997659b9c73089cdc22bd7eded6f6fdcffdfe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:33:17 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 09:33:17 +0000 Subject: [issue44662] Add ability to annotate types.Union In-Reply-To: <1626518013.71.0.944961363748.issue44662@roundup.psfhosted.org> Message-ID: <1627637597.71.0.237707696767.issue44662@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Yurii! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:37:01 2021 From: report at bugs.python.org (Yurii Karabas) Date: Fri, 30 Jul 2021 09:37:01 +0000 Subject: [issue44775] Speed-up typing.cast by implementing it in C In-Reply-To: <1627637329.45.0.691022355252.issue44775@roundup.psfhosted.org> Message-ID: <1627637821.79.0.922964493509.issue44775@roundup.psfhosted.org> Change by Yurii Karabas <1998uriyyo at gmail.com>: ---------- keywords: +patch pull_requests: +25993 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27474 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 05:58:11 2021 From: report at bugs.python.org (Alex) Date: Fri, 30 Jul 2021 09:58:11 +0000 Subject: [issue44776] Docs on mobile do not use monospace font for code snippets, misaligning carets of improved error messages Message-ID: <1627639091.83.0.138517548588.issue44776@roundup.psfhosted.org> New submission from Alex : Now that the docs are mobile-friendly (nice!), I noticed that the code snippets are not using a monospace font (at least on my Android 10 + Chrome 92 device). This misaligns the carets of the improved errors messages, for example on the "what's new": https://docs.python.org/3.10/whatsnew/3.10.html I attached an example on how this renders on my device. ---------- assignee: docs at python components: Documentation files: E7EuL0KWQAI19nx.jpg messages: 398533 nosy: alexprengere, docs at python priority: normal severity: normal status: open title: Docs on mobile do not use monospace font for code snippets, misaligning carets of improved error messages versions: Python 3.10, Python 3.11 Added file: https://bugs.python.org/file50191/E7EuL0KWQAI19nx.jpg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 06:21:48 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 30 Jul 2021 10:21:48 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer In-Reply-To: <1627635175.38.0.412704828047.issue44774@roundup.psfhosted.org> Message-ID: <1627640508.33.0.318857149301.issue44774@roundup.psfhosted.org> Steven D'Aprano added the comment: Why do you expect UTF-8 inside the redirect_stdout block? io.StringIO doesn't have an encoding - it stores strings, not bytes. If z3-solver cannot deal with StringIO, then surely that's a bug in z3-solver? ---------- nosy: +steven.daprano _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 06:24:32 2021 From: report at bugs.python.org (Alex) Date: Fri, 30 Jul 2021 10:24:32 +0000 Subject: [issue44776] Docs on mobile do not use monospace font for code snippets, misaligning carets of improved error messages In-Reply-To: <1627639091.83.0.138517548588.issue44776@roundup.psfhosted.org> Message-ID: <1627640672.37.0.289933245588.issue44776@roundup.psfhosted.org> Alex added the comment: It looks this is already being tracked at: https://github.com/python/pythondotorg/issues/1708 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 06:47:50 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 10:47:50 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627642070.13.0.797041410161.issue44753@roundup.psfhosted.org> Change by Vinay Sajip : ---------- keywords: +patch pull_requests: +25994 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27475 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 06:51:14 2021 From: report at bugs.python.org (Felix C. Stegerman) Date: Fri, 30 Jul 2021 10:51:14 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1627642274.04.0.162203970132.issue37596@roundup.psfhosted.org> Change by Felix C. Stegerman : ---------- nosy: +obfusk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 07:09:39 2021 From: report at bugs.python.org (Pierre Carbonnelle) Date: Fri, 30 Jul 2021 11:09:39 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer In-Reply-To: <1627635175.38.0.412704828047.issue44774@roundup.psfhosted.org> Message-ID: <1627643379.31.0.496654971234.issue44774@roundup.psfhosted.org> Pierre Carbonnelle added the comment: I expect sys.stdout to have utf-8 encoding inside the redirect because the buffer accepts unicode code points (not bytes), just as it does outside of the redirect. In other words, I expect the 'encoding' attribute of sys.stdout to have the same value inside and outside this redirect. It so happens that sys.stdout is an io.StringIO() object inside the redirect. The getvalue() method on this object returns a string (not a bytes), i.e. a sequence of unicode points. StringIO inherits from TextIOBase, which has an 'encoding' attribute. For some reason, the encoding of a StringIO object is None, which is inconsistent with its semantics: it should be 'uft-8'. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 07:48:58 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 11:48:58 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627645738.69.0.806969770102.issue44753@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 6ff890380971752299325bd28eab80ec936975cf by Vinay Sajip in branch 'main': bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475) https://github.com/python/cpython/commit/6ff890380971752299325bd28eab80ec936975cf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 07:53:17 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 11:53:17 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627645997.13.0.880447757507.issue44753@roundup.psfhosted.org> Vinay Sajip added the comment: Should be fixed in main, leaving open until backports are done. ---------- versions: +Python 3.10, Python 3.9 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 07:56:44 2021 From: report at bugs.python.org (Steven D'Aprano) Date: Fri, 30 Jul 2021 11:56:44 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer In-Reply-To: <1627643379.31.0.496654971234.issue44774@roundup.psfhosted.org> Message-ID: <20210730115243.GV3540@ando.pearwood.info> Steven D'Aprano added the comment: > I expect sys.stdout to have utf-8 encoding inside the redirect because > the buffer accepts unicode code points (not bytes) And the buffer stores unicode code points, not bytes, so why would there be an encoding? Just to get this out of the way, in case you are thinking along these lines. Python strings are not arrays of UTF-8 bytes, like Go runes. Python strings are arrays of abstract code points. The specific details will vary from interpreter to interpreter, and from version to version, but current versions of CPython use a flexible in-memory representation where the width of the code points (1, 2 or 4 bytes) depend on the string. This is not UTF-8: the bytes are encoded as Latin-1, UCS-2, or UTF-32 depending on the string. > For some reason, the encoding of a StringIO object is None Because StringIO objects store strings, not bytes. There is no encoding involved. The inputs are strings, and the storage is strings. > which is inconsistent with its semantics: it should be 'uft-8'. It is completely consistent: the encoding should be None, because there is no encoding. > I expect the 'encoding' attribute of sys.stdout to have the same value > inside and outside this redirect. Why? If you redirect to an actual file using, let's say Mac-Roman encoding, or ASCII, or UTF-32, or any one of dozens of other encodings, you should expect the encoding inside the block to reflect the actual encoding used inside the block. The encoding outside the block is the encoding used by the original stdout; the encoding inside the block is the encoding used by the replacement stdout. Why would you expect them to always be the same? >>> print("outside:", sys.stdout.encoding) outside: utf-8 >>> with open("/tmp/junk.txt", "w", encoding="ascii") as f: ... with redirect_stdout(f): ... print("inside:", sys.stdout.encoding) ... >>> with open("/tmp/junk.txt", encoding="ascii") as f: ... print(f.read()) ... inside: ascii > It so happens that sys.stdout is an io.StringIO() object inside the > redirect. The getvalue() method on this object returns a string (not > a bytes), i.e. a sequence of unicode points. Exactly. And that is why there is no encoding involved. It is purely a sequence of Unicode code points, not bytes, and at no point was a Unicode string encoded to bytes to go to the filesystem. > StringIO inherits from TextIOBase, which has an 'encoding' attribute. And StringIO has an encoding attribute because of inheritance, and it is set to None because there is no actual encoding codec used. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:01:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 12:01:32 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627646492.21.0.906085418407.issue31746@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0cb470e622ba37920c72e4d8f284741b9fbaea8b by Erlend Egeberg Aasland in branch '3.10': [3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431). (GH-27472) https://github.com/python/cpython/commit/0cb470e622ba37920c72e4d8f284741b9fbaea8b ---------- nosy: +lukasz.langa status: pending -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:03:10 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 30 Jul 2021 12:03:10 +0000 Subject: [issue31746] crashes in sqlite3.Connection in case it is uninitialized or partially initialized In-Reply-To: <1507645879.63.0.213398074469.issue31746@psf.upfronthosting.co.za> Message-ID: <1627646590.12.0.286045575532.issue31746@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 Jul 30 08:13:58 2021 From: report at bugs.python.org (Pierre Carbonnelle) Date: Fri, 30 Jul 2021 12:13:58 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer In-Reply-To: <1627635175.38.0.412704828047.issue44774@roundup.psfhosted.org> Message-ID: <1627647238.25.0.11961295932.issue44774@roundup.psfhosted.org> Pierre Carbonnelle added the comment: As a work around, I had to use a temporary file (instead of a memory buffer): print("outside:", sys.stdout.encoding) with open("/tmp/log.txt", mode='w', encoding='utf-8') as buf: with redirect_stdout(buf) as f: print("inside: ", sys.stdout.encoding) with open("/tmp/log.txt", mode='r', encoding='utf-8') as f: print(f.read()) and get: outside: utf-8 inside: utf-8 as expected. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:18:18 2021 From: report at bugs.python.org (Pierre Carbonnelle) Date: Fri, 30 Jul 2021 12:18:18 +0000 Subject: [issue44774] incorrect sys.stdout.encoding within a io.StringIO buffer In-Reply-To: <1627635175.38.0.412704828047.issue44774@roundup.psfhosted.org> Message-ID: <1627647498.09.0.891910221179.issue44774@roundup.psfhosted.org> Pierre Carbonnelle added the comment: I can live with the workaround, so, you can close the issue if you wish. As you say, maybe it's an issue with z3. Thank you for your time. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:23:20 2021 From: report at bugs.python.org (Erlend E. Aasland) Date: Fri, 30 Jul 2021 12:23:20 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627647800.98.0.83559382623.issue42698@roundup.psfhosted.org> Erlend E. Aasland added the comment: hydroflask, can you provide a reproducer? ---------- nosy: +erlendaasland versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:36:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 12:36:56 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627648616.33.0.553277791359.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: Danny: that would be inconsistent with the rest of the doc, it's written as a reference list for exceptions and none of them have examples currently.. It also seems fairly clear without an example. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:43:06 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 12:43:06 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627648986.37.0.219651074913.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: (in fact, there is one example (for f-string exception) but the overall pattern is to just have reference type descriptions) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:56:31 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 12:56:31 +0000 Subject: [issue44761] NewType __module__ attr default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627649791.58.0.907282868955.issue44761@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +25995 pull_request: https://github.com/python/cpython/pull/27477 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 08:56:39 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 12:56:39 +0000 Subject: [issue44761] NewType __module__ attr default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627649799.6.0.535964802471.issue44761@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 7b975f81e4dba70a42c6279539a7fcfe4211b4c0 by Yurii Karabas in branch 'main': bpo-44761: Change default value of NewType __module__ attr (GH-27406) https://github.com/python/cpython/commit/7b975f81e4dba70a42c6279539a7fcfe4211b4c0 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:29:28 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 13:29:28 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners Message-ID: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> New submission from Jason R. Coombs : In [this comment](https://github.com/python/cpython/pull/27436#issuecomment-889815333), I learned that it's possible to break the buildbots in a way that's not fixable with a simple code change. The recommendation there was to contact the buildbot owners, but as far as I can tell, there's no mechanism to do that. Reading through the documentation for [buildbots](https://devguide.python.org/buildbots/) and [enrolling buildbots](https://devguide.python.org/buildworker/), there's nothing about subscribing to any list, so it seems there's no way to reach this audience. It would be nice if there was a mailing list or other notification channel for the buildbot owners that could be used to reach out to them in an event like this. ---------- assignee: docs at python components: Documentation messages: 398547 nosy: docs at python, jaraco priority: normal severity: normal status: open title: Create mechanism to contact buildbot worker owners _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:33:35 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 13:33:35 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627652015.85.0.471381422178.issue44777@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25996 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:41:30 2021 From: report at bugs.python.org (mert) Date: Fri, 30 Jul 2021 13:41:30 +0000 Subject: [issue44778] os seperator error. str method of PureWindowsPath on Ming64 env Message-ID: <1627652490.46.0.139202126037.issue44778@roundup.psfhosted.org> New submission from mert : PureWindowsPath('C:\\Users') When I call __str__ method of PureWindowsPath on Windows,Cygwin,Linux enviroment, I get "C:\Users" as expected. But when I run the same code on MingW environment I get "C:/Users". from pathlib import PureWindowsPath, Path p = PureWindowsPath('C:\\Users') print(str(p)) ---------- messages: 398548 nosy: demirbey priority: normal severity: normal status: open title: os seperator error. str method of PureWindowsPath on Ming64 env versions: Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:48:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 13:48:14 +0000 Subject: [issue44761] NewType __module__ attr default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627652894.26.0.801782946656.issue44761@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 56122b0bba7a9e2e3ec672a6c22bfdd7ecf08cbe by Miss Islington (bot) in branch '3.10': bpo-44761: Change default value of NewType __module__ attr (GH-27406) (GH-27477) https://github.com/python/cpython/commit/56122b0bba7a9e2e3ec672a6c22bfdd7ecf08cbe ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:48:23 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 13:48:23 +0000 Subject: [issue44761] NewType __module__ attr default value In-Reply-To: <1627466770.61.0.0184173435686.issue44761@roundup.psfhosted.org> Message-ID: <1627652903.63.0.921880087917.issue44761@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:49:33 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 13:49:33 +0000 Subject: [issue44747] Refactor usage of sys._getframe at typing module In-Reply-To: <1627376689.96.0.280713555823.issue44747@roundup.psfhosted.org> Message-ID: <1627652973.5.0.640581973538.issue44747@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ea4673ed0757e9bfe8774e60cfae3313e9927b5f by Yurii Karabas in branch 'main': bpo-44747: Refactor usage of sys._getframe at typing module (#27387) https://github.com/python/cpython/commit/ea4673ed0757e9bfe8774e60cfae3313e9927b5f ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 09:50:29 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 13:50:29 +0000 Subject: [issue44747] Refactor usage of sys._getframe at typing module In-Reply-To: <1627376689.96.0.280713555823.issue44747@roundup.psfhosted.org> Message-ID: <1627653029.89.0.364308525239.issue44747@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Yurii! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:21:05 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 14:21:05 +0000 Subject: [issue44779] Checkouts stale following changes to .gitattributes Message-ID: <1627654865.8.0.668589058029.issue44779@roundup.psfhosted.org> New submission from Jason R. Coombs : In [this comment](https://github.com/python/cpython/pull/27436#issuecomment-889815333), I learned that it's possible to get repo clones into a bad state by: - commit a text file to main (merge a PR) - customize the newline handling for that file in .gitattributes (in a separate PR) Users (including buildbots) that pulled the code between these two steps will be stuck with the files at the state checked out in the first step. Example (must be run on Windows): PS C:\> git clone https://github.com/python/cpython --depth 100 Cloning into 'cpython'... remote: Enumerating objects: 5946, done. remote: Counting objects: 100% (5946/5946), done. remote: Compressing objects: 100% (5079/5079), done. Receiving objects: 100% (5946/5946), 24.99 MiB | 9.18 MiB/s, done. remote: Total 5946 (delta 1382), reused 2314 (delta 758), pack-reused 0 Resolving deltas: 100% (1382/1382), done. Updating files: 100% (4699/4699), done. PS C:\> cd cpython PS C:\cpython> git checkout aaa83cd^1 HEAD is now at 851cca8 Add missing gdbm dependencies to the UNIX CI (GH-27467) PS C:\cpython> # simulate as if this rev was the the initial checkout PS C:\cpython> git rm -r :/ > $null ; git checkout HEAD -- :/ PS C:\cpython> python -c "import pathlib; print(repr(pathlib.Path('Lib/test/test_importlib/namespacedata01/utf-8.file').read_bytes()))" b'Hello, UTF-8 world!\r\n' PS C:\cpython> git checkout -q aaa83cd HEAD is now at aaa83cd bpo-44771: Apply changes from importlib_resources 5.2.1 (GH-27436) PS C:\cpython> python -c "import pathlib; print(repr(pathlib.Path('Lib/test/test_importlib/namespacedata01/utf-8.file').read_bytes()))" b'Hello, UTF-8 world!\r\n' PS C:\cpython> git rm -r :/ > $null ; git checkout HEAD -- :/ PS C:\cpython> python -c "import pathlib; print(repr(pathlib.Path('Lib/test/test_importlib/namespacedata01/utf-8.file').read_bytes()))" b'Hello, UTF-8 world!\n' This issue doesn't exist on other repos (the file has Unix newlines in all checkouts): PS C:\> git clone https://github.com/python/importlib_resources Cloning into 'importlib_resources'... remote: Enumerating objects: 2811, done. remote: Counting objects: 100% (732/732), done. remote: Compressing objects: 100% (400/400), done. eceiving objects: 1% (29/2811) remote: Total 2811 (delta 456), reused 556 (delta 309), pack-reused 2079 Receiving objects: 100% (2811/2811), 446.21 KiB | 7.44 MiB/s, done. Resolving deltas: 100% (1796/1796), done. PS C:\> cd importlib_resources PS C:\importlib_resources> python -c "import pathlib; print(repr(pathlib.Path('importlib_resources/tests/namespacedata01/utf-8.file').read_bytes()))" b'Hello, UTF-8 world!\n' I'm not sure there's much this project can do, except maybe consider minimizing the number of files that need customization. As a former Windows enthusiast, I found the CRLF changes to be annoying an not particularly useful, so I sought to use LF for newlines wherever possible, for simplicity and consistency. Some editors (notably Notepad) would not handle these newlines well, but almost all other editors would handle them just fine. This project could consider standardizing on Unix newlines with a small number of exceptions rather than allowing files by default to be converted to platform-specific newlines. I'm yet unsure what setting it is about the CPython repo that causes newlines to be customized per platform but importlib_resources does not. ---------- assignee: docs at python components: Documentation messages: 398552 nosy: docs at python, jaraco priority: normal severity: normal status: open title: Checkouts stale following changes to .gitattributes _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:22:11 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 14:22:11 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627654931.68.0.809329694462.issue44777@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: -25996 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:22:20 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 14:22:20 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627654940.26.0.867880337235.issue44777@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- stage: patch review -> _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:24:45 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 14:24:45 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627655085.22.0.993244899161.issue44777@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +25997 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:24:45 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 14:24:45 +0000 Subject: [issue44779] Checkouts stale following changes to .gitattributes In-Reply-To: <1627654865.8.0.668589058029.issue44779@roundup.psfhosted.org> Message-ID: <1627655085.3.0.0342844209434.issue44779@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +25998 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:30:14 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 14:30:14 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627655414.42.0.212321324789.issue44771@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems that PR 27436 has broken several buildbots. For instance: https://buildbot.python.org/all/#/builders/350/builds/474 Following our buildbot policy, we will sadly need to revert in 24 if is not fixed. ---------- nosy: +pablogsal resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:29:52 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Fri, 30 Jul 2021 14:29:52 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627655392.47.0.62669491256.issue44777@roundup.psfhosted.org> Jeremy Kloth added the comment: There is a list `python-buildbots at python.org` that all buildbot owners have been subscribed. ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:35:59 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 30 Jul 2021 14:35:59 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627655759.97.0.860313179574.issue44777@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:38:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 14:38:17 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627655897.35.0.642211795991.issue44771@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +25999 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/27483 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:42:03 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 14:42:03 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627656123.71.0.94463029321.issue44777@roundup.psfhosted.org> ?ukasz Langa added the comment: Let me add the contact information to devguide.python.org. ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:52:34 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 30 Jul 2021 14:52:34 +0000 Subject: [issue44780] Incorrect message: "Invalid decimal literal" (python 3.10) Message-ID: <1627656754.25.0.173168289644.issue44780@roundup.psfhosted.org> New submission from Andre Roberge : Consider the following: >>> a = (1? 2) # not a comma, but unicode character. Using Python 3.9 (and earlier), we get the following correct information >>> a = (1? 2) File "", line 1 a = (1? 2) ^ SyntaxError: invalid character '?' (U+201A) Using Python 3.10, we get the following incorrect information instead: >>> a = (1? 2) File "", line 1 a = (1? 2) ^ SyntaxError: invalid decimal literal ---------- messages: 398556 nosy: aroberge, pablogsal priority: normal severity: normal status: open title: Incorrect message: "Invalid decimal literal" (python 3.10) versions: Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 10:55:15 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 30 Jul 2021 14:55:15 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627656915.54.0.51958052497.issue44771@roundup.psfhosted.org> Change by Filipe La?ns : ---------- pull_requests: +26000 pull_request: https://github.com/python/cpython/pull/27484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:23:47 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 15:23:47 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627658627.17.0.782006424076.issue44777@roundup.psfhosted.org> ?ukasz Langa added the comment: Done and done. See: https://devguide.python.org/buildbots/ (https://github.com/python/devguide/pull/733) ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:27:41 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Jul 2021 15:27:41 +0000 Subject: [issue44778] os seperator error. str method of PureWindowsPath on Ming64 env In-Reply-To: <1627652490.46.0.139202126037.issue44778@roundup.psfhosted.org> Message-ID: <1627658861.32.0.578316664761.issue44778@roundup.psfhosted.org> Eryk Sun added the comment: MinGW Python sets os.sep to "/" and os.altsep to "\\". It also swaps _WindowsFlavour.sep and _WindowsFlavour.altsep in pathlib. This seems dubious to me. Technically the Windows API supports both backslash and slash as path separators, but in practice many API functions only support backslash (e.g. the path functions such as PathCchSkipRoot). Anyway, it's a third-party issue. You'll have to report it to the MinGW maintainers if you want it resolved, or to at least get an informed reason why the change is necessary. ---------- components: +Windows nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware resolution: -> third party stage: -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:30:03 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 15:30:03 +0000 Subject: [issue44777] Create mechanism to contact buildbot worker owners In-Reply-To: <1627651768.22.0.661777940332.issue44777@roundup.psfhosted.org> Message-ID: <1627659003.86.0.594767207016.issue44777@roundup.psfhosted.org> Jason R. Coombs added the comment: Awesome. Thanks ?ukasz. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:32:35 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 15:32:35 +0000 Subject: [issue41103] Removing old buffer support In-Reply-To: <1593006222.66.0.567274053686.issue41103@roundup.psfhosted.org> Message-ID: <1627659155.94.0.935549469764.issue41103@roundup.psfhosted.org> ?ukasz Langa added the comment: Resolved as "wontfix" due to presence in the stable ABI. ---------- resolution: -> wont fix stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:41:26 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 15:41:26 +0000 Subject: [issue44780] Incorrect message: "Invalid decimal literal" (python 3.10) In-Reply-To: <1627656754.25.0.173168289644.issue44780@roundup.psfhosted.org> Message-ID: <1627659686.08.0.618599220687.issue44780@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:49:27 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 15:49:27 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distils Message-ID: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> New submission from Irit Katriel : The test will be removed with distutils, so for now it should suppress the deprecation warning so that we can run the tests with warnings as errors. ---------- components: Tests messages: 398561 nosy: iritkatriel priority: normal severity: normal status: open title: test_distutils emits deprecation warning about distils versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:50:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 15:50:48 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627660248.93.0.0607067953635.issue44781@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26001 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27485 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:51:34 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 15:51:34 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627660294.23.0.375561202082.issue44781@roundup.psfhosted.org> Change by Irit Katriel : ---------- title: test_distutils emits deprecation warning about distils -> test_distutils emits deprecation warning about distutils _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:53:39 2021 From: report at bugs.python.org (Danny Lin) Date: Fri, 30 Jul 2021 15:53:39 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627660419.5.0.45849483515.issue41737@roundup.psfhosted.org> Danny Lin added the comment: @Andrei Kulakov: I was commenting on the previous version. The revised version (f2ae30b0de3c4ba1f16fc2a430cf22b447c062ed) seems ok to me. Another question: would it be better if we add "on some platforms" for the part that the error may raise on a file operation? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:54:07 2021 From: report at bugs.python.org (Jeremy Kloth) Date: Fri, 30 Jul 2021 15:54:07 +0000 Subject: [issue44779] Checkouts stale following changes to .gitattributes In-Reply-To: <1627654865.8.0.668589058029.issue44779@roundup.psfhosted.org> Message-ID: <1627660447.52.0.105634493364.issue44779@roundup.psfhosted.org> Change by Jeremy Kloth : ---------- nosy: +jkloth _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:56:36 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 15:56:36 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627660596.6.0.549569845537.issue44753@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26002 pull_request: https://github.com/python/cpython/pull/27486 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 11:56:42 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 15:56:42 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627660602.11.0.146315016537.issue44753@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26003 pull_request: https://github.com/python/cpython/pull/27487 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:00:20 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 16:00:20 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1627660820.38.0.772656007242.issue37596@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: > I understand, the proposal would be to make frozensets keep the creation order. That would increase the memory consumption of all frozen set instances, which is likely not going to fly ---------- nosy: +pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:00:44 2021 From: report at bugs.python.org (Matthew Kenigsberg) Date: Fri, 30 Jul 2021 16:00:44 +0000 Subject: [issue41254] Add to/from string methods to datetime.timedelta In-Reply-To: <1594277218.28.0.16887324914.issue41254@roundup.psfhosted.org> Message-ID: <1627660844.75.0.825235828426.issue41254@roundup.psfhosted.org> Matthew Kenigsberg added the comment: I think it would be nice to have a from str method that could reverse the behavior of str(timedelta). I'm trying to parse files that contain the output of str(timedelta), and there's no easy way to get them back to timedelta's ---------- nosy: +matthewkenigsberg _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:03:28 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 16:03:28 +0000 Subject: [issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order In-Reply-To: <1563203111.95.0.786255267379.issue37596@roundup.psfhosted.org> Message-ID: <1627661008.77.0.969215283265.issue37596@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: The only way I can see here is to go with a similar strategy as Serhiy proposes, which seems that it has a non trivial complication (and a new type, which I am not very fond of) but is a bit cleaner than changing the semantics of the type, which affects much more than the storage. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:03:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 16:03:53 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627661033.24.0.564445269763.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: Danny: then it would be probably more useful to say "On POSIX systems, it will be raised when ...". I'm ambivalent on whether this is needed. Eryk: wdyt? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:14:54 2021 From: report at bugs.python.org (Danny Lin) Date: Fri, 30 Jul 2021 16:14:54 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627661694.35.0.681293552255.issue41737@roundup.psfhosted.org> Danny Lin added the comment: @Andrei Kulakov: That statement is mainly for illustration that such behavior may vary across platforms. I use a rather vague statement as I'm not totally sure it applies if (and only if) running on POSIX. A more accurate statement is welcome as long as it's proven true. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:20:32 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 16:20:32 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627662032.37.0.76669523111.issue44753@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 882e4761c63ae76d994b57bbcd7e5adbf2aa7b4f by Miss Islington (bot) in branch '3.9': bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475) (GH-27486) https://github.com/python/cpython/commit/882e4761c63ae76d994b57bbcd7e5adbf2aa7b4f ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:21:03 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 16:21:03 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627662063.31.0.492705199376.issue44753@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 6e6dc2517379289932c68fc986ee3994468374fc by Miss Islington (bot) in branch '3.10': bpo-44753: Don't use logfile extension when determining old files to be deleted (GH-27475) (GH-27487) https://github.com/python/cpython/commit/6e6dc2517379289932c68fc986ee3994468374fc ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:22:12 2021 From: report at bugs.python.org (Vinay Sajip) Date: Fri, 30 Jul 2021 16:22:12 +0000 Subject: [issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified In-Reply-To: <1627425475.0.0.681821492357.issue44753@roundup.psfhosted.org> Message-ID: <1627662132.73.0.676913713704.issue44753@roundup.psfhosted.org> Vinay Sajip added the comment: Thanks for the bug report. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:22:59 2021 From: report at bugs.python.org (Maxime LEURENT) Date: Fri, 30 Jul 2021 16:22:59 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627662179.85.0.0232804691856.issue44782@roundup.psfhosted.org> Change by Maxime LEURENT : ---------- title: LRU class given as example in OrderedDict example not work on pop -> LRU class given as example in OrderedDict docs not work on pop _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:22:34 2021 From: report at bugs.python.org (Maxime LEURENT) Date: Fri, 30 Jul 2021 16:22:34 +0000 Subject: [issue44782] LRU class given as example in OrderedDict example not work on pop Message-ID: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> New submission from Maxime LEURENT : Hello, I try to use a dictionnary with limited size, and I use class LRU given in docs on OrderedDict. Unfortunately this class is, somehow, not working on pop method. I say somehow because if I do OrderedDict pop method by hand I don't get any Exception. I do not understand how LRU.__getitem__ is call after del, and why "value = super().__getitem__(key)" work, when "self.move_to_end(key)" don't Code tested on python3.7 and python3.8: from collections import OrderedDict class LRU(OrderedDict): 'Limit size, evicting the least recently looked-up key when full' def __init__(self, maxsize=128, *args, **kwds): self.maxsize = maxsize super().__init__(*args, **kwds) def __getitem__(self, key): value = super().__getitem__(key) self.move_to_end(key) #<=== Bug here return value def __setitem__(self, key, value): if key in self: self.move_to_end(key) super().__setitem__(key, value) if len(self) > self.maxsize: oldest = next(iter(self)) del self[oldest] d = LRU() d["foo"] = "bar" d.pop("foo") #<= KeyError on mode_to_send in LRU.__getitem__ method #pop method by "hand" d["foo2"] = "bar" if "foo2" in d : result = d["foo2"] del d["foo2"] print(result) #work fine ---------- assignee: docs at python components: Documentation messages: 398571 nosy: docs at python, maximeLeurent priority: normal severity: normal status: open title: LRU class given as example in OrderedDict example not work on pop versions: Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:38:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 16:38:51 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627663131.02.0.205197701021.issue44666@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 80f07076294bc09a55ed76d9bbf307404eef25e6 by Stefan Hoelzl in branch 'main': bpo-44666: Use default encoding as fallback for compile_file (GH-27236) https://github.com/python/cpython/commit/80f07076294bc09a55ed76d9bbf307404eef25e6 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:38:57 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 16:38:57 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627663137.66.0.536409963752.issue44666@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26005 pull_request: https://github.com/python/cpython/pull/27489 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:38:52 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 16:38:52 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627663132.02.0.762597369297.issue44666@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26004 pull_request: https://github.com/python/cpython/pull/27488 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:52:53 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 16:52:53 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627663973.31.0.729690698774.issue41911@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26006 pull_request: https://github.com/python/cpython/pull/27490 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:52:52 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 16:52:52 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627663972.28.0.125895200961.issue41911@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 4bd9caafb64589288e5171087070bde726178c58 by andrei kulakov in branch 'main': bpo-41911: Update docs for various expressions (GH-27470) https://github.com/python/cpython/commit/4bd9caafb64589288e5171087070bde726178c58 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 12:52:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 16:52:58 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627663978.76.0.421430181086.issue41911@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26007 pull_request: https://github.com/python/cpython/pull/27491 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:05:58 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 17:05:58 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627664758.6.0.890861037806.issue42892@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 7.0 -> 8.0 pull_requests: +26008 pull_request: https://github.com/python/cpython/pull/27492 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:05:57 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:05:57 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627664757.17.0.363108770189.issue42892@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset e3f877c32d7cccb734f45310f26beeec793364ce by andrei kulakov in branch 'main': bpo-42892: fix email multipart attribute error (GH-26903) https://github.com/python/cpython/commit/e3f877c32d7cccb734f45310f26beeec793364ce ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:06:04 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 17:06:04 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627664764.18.0.0889927464305.issue42892@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26009 pull_request: https://github.com/python/cpython/pull/27493 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:10:45 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:10:45 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627665045.26.0.483025392789.issue43625@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset ceea579ccc51791f3e115155d6f27905bc7544a9 by andrei kulakov in branch 'main': bpo-43625: Enhance csv sniffer has_headers() to be more accurate (GH-26939) https://github.com/python/cpython/commit/ceea579ccc51791f3e115155d6f27905bc7544a9 ---------- nosy: +lukasz.langa _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:10:47 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 17:10:47 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627665047.21.0.418329300406.issue43625@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +26010 pull_request: https://github.com/python/cpython/pull/27494 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:12:08 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:12:08 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627665128.63.0.0468919497981.issue44666@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0db6c143ae5f04d223fdb2c94b820f16714b0a09 by Miss Islington (bot) in branch '3.10': bpo-44666: Use default encoding as fallback for compile_file (GH-27236) (GH-27488) https://github.com/python/cpython/commit/0db6c143ae5f04d223fdb2c94b820f16714b0a09 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:12:32 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:12:32 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627665152.86.0.64370261064.issue44666@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 73240d425b770c26d9424665259cd9a2f339b626 by Miss Islington (bot) in branch '3.9': bpo-44666: Use default encoding as fallback for compile_file (GH-27236) (GH-27489) https://github.com/python/cpython/commit/73240d425b770c26d9424665259cd9a2f339b626 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:12:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:12:54 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627665174.8.0.0279846390231.issue44666@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:13:22 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:13:22 +0000 Subject: [issue44666] compileall.compile_file fails when sys.stdout is redirected to StringIO In-Reply-To: <1626598631.59.0.122481145082.issue44666@roundup.psfhosted.org> Message-ID: <1627665202.02.0.936398370308.issue44666@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Stefan! ? ? ? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:17:50 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:17:50 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627665470.03.0.20675777587.issue44648@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 48a62559dfaf775e4f1cc56b19379c799e8e2587 by andrei kulakov in branch 'main': bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) https://github.com/python/cpython/commit/48a62559dfaf775e4f1cc56b19379c799e8e2587 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:17:55 2021 From: report at bugs.python.org (miss-islington) Date: Fri, 30 Jul 2021 17:17:55 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627665475.01.0.256953352112.issue44648@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26011 pull_request: https://github.com/python/cpython/pull/27495 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:19:30 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:19:30 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627665570.58.0.700956188217.issue44648@roundup.psfhosted.org> ?ukasz Langa added the comment: Since this is an exception type change, I'd feel more comfortable leaving 3.9 out of the backports here. That way it will be easier for application authors to differentiate between when the change was introduced or not. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:20:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:20:54 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627665654.71.0.00113773425124.issue44648@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:21:56 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:21:56 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627665716.82.0.29636966118.issue43625@roundup.psfhosted.org> ?ukasz Langa added the comment: Since this is a heuristic change, I'm thinking we shouldn't backport this to 3.9. This way it will be easier for application authors to notice the change and control it within their apps. ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:23:01 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 17:23:01 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627665781.61.0.866989703883.issue43625@roundup.psfhosted.org> Andrei Kulakov added the comment: ?ukasz: I agree. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:25:53 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:25:53 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627665953.72.0.706371242534.issue41911@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 843b3d28209b7754c51c6cc3844f66808b6dbdaf by Miss Islington (bot) in branch '3.10': bpo-41911: Update docs for various expressions (GH-27470) (GH-27490) https://github.com/python/cpython/commit/843b3d28209b7754c51c6cc3844f66808b6dbdaf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:26:04 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:26:04 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627665964.84.0.160349900857.issue41911@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset b57011d2a5375bc9f255361dc64c9e6fbc203e0e by Miss Islington (bot) in branch '3.9': bpo-41911: Update docs for various expressions (GH-27470) (GH-27491) https://github.com/python/cpython/commit/b57011d2a5375bc9f255361dc64c9e6fbc203e0e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:26:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:26:19 +0000 Subject: [issue41911] Language reference for expressions incorrectly specifies what type of object(s) are expected In-Reply-To: <1601652453.05.0.89373160388.issue41911@roundup.psfhosted.org> Message-ID: <1627665979.56.0.27652543191.issue41911@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 -Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:27:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:27:14 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627666034.42.0.202498520253.issue42892@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 6f950023c6a2168b229363d75f59a24ecdd66d19 by Miss Islington (bot) in branch '3.10': bpo-42892: fix email multipart attribute error (GH-26903) (GH-27492) https://github.com/python/cpython/commit/6f950023c6a2168b229363d75f59a24ecdd66d19 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:30:16 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:30:16 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627666216.85.0.27187859023.issue43625@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 440c9f772a9b66c1ea387c1c3efc9ff438880acf by Miss Islington (bot) in branch '3.10': bpo-43625: Enhance csv sniffer has_headers() to be more accurate (GH-26939) (GH-27494) https://github.com/python/cpython/commit/440c9f772a9b66c1ea387c1c3efc9ff438880acf ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:30:38 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:30:38 +0000 Subject: [issue43625] CSV has_headers heuristic could be improved In-Reply-To: <1616696315.22.0.477162760848.issue43625@roundup.psfhosted.org> Message-ID: <1627666238.31.0.152384368179.issue43625@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:31:02 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:31:02 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627666262.44.0.237845978425.issue42892@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset 0f42b726c87f72d522893f927b4cb592b8875641 by Miss Islington (bot) in branch '3.9': bpo-42892: fix email multipart attribute error (GH-26903) (GH-27493) https://github.com/python/cpython/commit/0f42b726c87f72d522893f927b4cb592b8875641 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:31:19 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:31:19 +0000 Subject: [issue42892] AttributeError in email.message.get_body() In-Reply-To: <1610383557.89.0.290771399006.issue42892@roundup.psfhosted.org> Message-ID: <1627666279.88.0.236979134143.issue42892@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:40:56 2021 From: report at bugs.python.org (Othmane EL BOURI) Date: Fri, 30 Jul 2021 17:40:56 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627666856.94.0.920176059274.issue44648@roundup.psfhosted.org> Othmane EL BOURI added the comment: ince this is an exception type change, I'd feel more comfortable leaving 3.9 out of the backports here. That way it will be easier for application authors to differentiate between when the change was introduced or not. ---------- nosy: +othmaneelbouri1 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:41:54 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:41:54 +0000 Subject: [issue44781] test_distutils emits deprecation warning about distutils In-Reply-To: <1627660167.89.0.985497227047.issue44781@roundup.psfhosted.org> Message-ID: <1627666914.77.0.676778627005.issue44781@roundup.psfhosted.org> Change by ?ukasz Langa : ---------- versions: +Python 3.10 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:46:51 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:46:51 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627667211.06.0.157987726056.issue44648@roundup.psfhosted.org> ?ukasz Langa added the comment: New changeset f468ede4a2b7ab5c72ae85ab04cb56904300cd23 by Miss Islington (bot) in branch '3.10': bpo-44648: Fix error type in inspect.getsource() in interactive session (GH-27171) (GH-27495) https://github.com/python/cpython/commit/f468ede4a2b7ab5c72ae85ab04cb56904300cd23 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:47:14 2021 From: report at bugs.python.org (=?utf-8?q?=C5=81ukasz_Langa?=) Date: Fri, 30 Jul 2021 17:47:14 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627667234.17.0.633288747495.issue44648@roundup.psfhosted.org> ?ukasz Langa added the comment: Thanks, Andrei! ? ? ? ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:49:12 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Jul 2021 17:49:12 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627667352.17.0.309482747448.issue41737@roundup.psfhosted.org> Eryk Sun added the comment: I'd prefer a generic wording regarding the platform, and overall simpler phrasing without examples: "On some platforms, it may also be raised if an operation attempts to open or traverse a non-directory file as if it were a directory." The latter doesn't apply to Windows generally. Attempting to traverse a non-directory fails with ERROR_PATH_NOT_FOUND (mapped to C errno ENOENT), and attempting to open a non-directory with a path that has a trailing slash fails with ERROR_INVALID_NAME (mapped to C errno EINVAL). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:53:19 2021 From: report at bugs.python.org (Philip Prindeville) Date: Fri, 30 Jul 2021 17:53:19 +0000 Subject: [issue44783] SSL needs client OCSP stapling Message-ID: <1627667599.71.0.817269151693.issue44783@roundup.psfhosted.org> New submission from Philip Prindeville : When TLS client certificates are used for authentication, servers need to ensure that the certificate is current and hasn't been revoked. In zero-trust and other architectures with heavy use of micro-services, server-side validation of the client certs repeatedly can be a significant burden. Forcing the client to present a signed, stapled OCSP response to the handshake eliminates this repetitive extra step. ---------- assignee: christian.heimes components: SSL messages: 398592 nosy: christian.heimes, pprindeville priority: normal severity: normal status: open title: SSL needs client OCSP stapling type: enhancement _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 13:56:45 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 17:56:45 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627667805.3.0.040716015709.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: Eryk: sounds good, updated the PR. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:03:10 2021 From: report at bugs.python.org (hydroflask) Date: Fri, 30 Jul 2021 18:03:10 +0000 Subject: [issue42698] Deadlock in pysqlite_connection_dealloc() In-Reply-To: <1608511484.37.0.765804145287.issue42698@roundup.psfhosted.org> Message-ID: <1627668190.26.0.537582448674.issue42698@roundup.psfhosted.org> hydroflask added the comment: Unfortunately I am currently unable to write a repro for this bug but I am 100% certain it exists from analyzing the code. In our application (which is a large multithreaded application) after I made the changes consistent with this report the deadlock vanished completely. When the deadlock occurred, the thread stacks were consistent with the information in this report. To get the deadlock to trigger, SQLite itself must take a lock on sqlite3_close() but I don't know very much about SQLite's internals to consistently provoke that behavior. I've attached my attempt at a repro which is similar enough to the pattern of our application but it was not working. ---------- Added file: https://bugs.python.org/file50192/test.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:11:04 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 30 Jul 2021 18:11:04 +0000 Subject: [issue44780] Incorrect message: "Invalid decimal literal" (python 3.10) In-Reply-To: <1627656754.25.0.173168289644.issue44780@roundup.psfhosted.org> Message-ID: <1627668664.11.0.616050073503.issue44780@roundup.psfhosted.org> Andre Roberge added the comment: Here's another related case. Python 3.9: >>> a = 1? File "", line 1 a = 1? ^ SyntaxError: invalid character '?' (U+00BD) Python 3.10 >>> a = 1? File "", line 1 a = 1? ^ SyntaxError: invalid decimal literal ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:13:20 2021 From: report at bugs.python.org (Danny Lin) Date: Fri, 30 Jul 2021 18:13:20 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627668800.86.0.729960628899.issue41737@roundup.psfhosted.org> Danny Lin added the comment: It should be emphasized that it may happen on a **file operation**... So at least be something like: "On some platforms, it may also be raised if a file operation involves an attempt to open or traverse a non-directory file as if it were a directory." ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:18:41 2021 From: report at bugs.python.org (Andre Roberge) Date: Fri, 30 Jul 2021 18:18:41 +0000 Subject: [issue44780] Incorrect message: "Invalid decimal literal" (python 3.10) In-Reply-To: <1627656754.25.0.173168289644.issue44780@roundup.psfhosted.org> Message-ID: <1627669121.29.0.166533495234.issue44780@roundup.psfhosted.org> Andre Roberge added the comment: Third case. Showing only the output for Python 3.10 >>> a = 3 ? 7 # entered with a space around ? File "", line 1 a = 3 ? 7 ^ SyntaxError: invalid character '?' (U+2044) >>> a = 3?7 # no added space File "", line 1 a = 3?7 ^ SyntaxError: invalid decimal literal = = In the terminal, the integers 3 and 7 look the same with or without spaces around the ? character, known as FRACTION SLASH. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:19:48 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:19:48 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface Message-ID: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> New submission from Irit Katriel : % ./python.exe -E -We -m test -v test_importlib .... ====================================================================== ERROR: test_entry_points_groups_get (test.test_importlib.test_metadata_api.APITests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_metadata_api.py", line 165, in test_entry_points_groups_get entry_points().get('missing', 'default') == 'default' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/importlib/metadata/__init__.py", line 400, in get self._warn() ^^^^^^^^^^^^ DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. ====================================================================== ERROR: test_entry_points_groups_getitem (test.test_importlib.test_metadata_api.APITests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_importlib/test_metadata_api.py", line 155, in test_entry_points_groups_getitem entry_points()['entries'] == entry_points(group='entries') ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/importlib/metadata/__init__.py", line 396, in __getitem__ self._warn() ^^^^^^^^^^^^ DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. ---------------------------------------------------------------------- ---------- components: Tests messages: 398598 nosy: iritkatriel priority: normal severity: normal status: open title: test_importlib uses deprecated SelectableGroups interface _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:24:44 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:24:44 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627669484.04.0.207277787962.issue44785@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:24:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:24:31 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." Message-ID: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> New submission from Irit Katriel : % ./python.exe -E -We -m test -v test_pickle ====================================================================== ERROR: test_import (test.test_pickle.CompatPickleTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 367, in getmodule return sys.modules[module] ~~~~~~~~~~~^^^^^^^^ KeyError: 'tkinter.tix' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 401, in test_import getmodule(module) ^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 370, in getmodule __import__(module) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/tkinter/tix.py", line 32, in warnings.warn( ^^^^^^^^^^^^^^ DeprecationWarning: The Tix Tk extension is unmaintained, and the tkinter.tix wrapper module is deprecated in favor of tkinter.ttk ====================================================================== ERROR: test_import_mapping (test.test_pickle.CompatPickleTests) [('tkinter.tix', 'Tix')] ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 367, in getmodule return sys.modules[module] ~~~~~~~~~~~^^^^^^^^ KeyError: 'tkinter.tix' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 409, in test_import_mapping getmodule(module3) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 370, in getmodule __import__(module) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/tkinter/tix.py", line 32, in warnings.warn( ^^^^^^^^^^^^^^ DeprecationWarning: The Tix Tk extension is unmaintained, and the tkinter.tix wrapper module is deprecated in favor of tkinter.ttk ====================================================================== ERROR: test_reverse_import_mapping (test.test_pickle.CompatPickleTests) [('Tix', 'tkinter.tix')] ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 367, in getmodule return sys.modules[module] ~~~~~~~~~~~^^^^^^^^ KeyError: 'tkinter.tix' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 440, in test_reverse_import_mapping getmodule(module3) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_pickle.py", line 370, in getmodule __import__(module) ^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/tkinter/tix.py", line 32, in warnings.warn( ^^^^^^^^^^^^^^ DeprecationWarning: The Tix Tk extension is unmaintained, and the tkinter.tix wrapper module is deprecated in favor of tkinter.ttk ---------------------------------------------------------------------- ---------- components: Tests messages: 398599 nosy: iritkatriel priority: normal severity: normal status: open title: test_pickle issues "DeprecationWarning: The Tix Tk.." _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:24:56 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:24:56 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627669496.41.0.370283598689.issue44784@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:27:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:27:57 +0000 Subject: [issue44786] test_check_c_globals "crashed" and then "FutureWarning: Possible nested set at position 12" Message-ID: <1627669677.16.0.177295366811.issue44786@roundup.psfhosted.org> New submission from Irit Katriel : % ./python.exe -E -We -m test -v test_check_c_globals ... test test_check_c_globals crashed -- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/libregrtest/runtest.py", line 335, in _runtest_inner refleak = _runtest_inner2(ns, test_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/libregrtest/runtest.py", line 280, in _runtest_inner2 the_module = importlib.import_module(abstest) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1061, in _gcd_import File "", line 1038, in _find_and_load File "", line 1015, in _find_and_load_unlocked File "", line 689, in _load_unlocked File "", line 894, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/iritkatriel/src/cpython-1/Lib/test/test_check_c_globals.py", line 6, in from cpython.__main__ import main ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Tools/c-analyzer/cpython/__main__.py", line 18, in from c_parser.info import KIND ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Tools/c-analyzer/c_parser/__init__.py", line 1, in from .parser import parse as _parse ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Tools/c-analyzer/c_parser/parser/__init__.py", line 119, in from ..info import ParsedItem ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Tools/c-analyzer/c_parser/info.py", line 10, in import c_common.tables as _tables ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Tools/c-analyzer/c_common/tables.py", line 236, in _COLSPEC_RE = re.compile(textwrap.dedent(r''' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/re.py", line 229, in compile return _compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/re.py", line 281, in _compile p = sre_compile.compile(pattern, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_compile.py", line 764, in compile p = sre_parse.parse(p, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_parse.py", line 948, in parse p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_parse.py", line 443, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_parse.py", line 834, in _parse p = _parse_sub(source, state, sub_verbose, nested + 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_parse.py", line 443, in _parse_sub itemsappend(_parse(source, state, verbose, nested + 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/sre_parse.py", line 540, in _parse warnings.warn( ^^^^^^^^^^^^^^ FutureWarning: Possible nested set at position 12 test_check_c_globals failed (uncaught exception) ---------- messages: 398600 nosy: iritkatriel priority: normal severity: normal status: open title: test_check_c_globals "crashed" and then "FutureWarning: Possible nested set at position 12" versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:28:18 2021 From: report at bugs.python.org (Irit Katriel) Date: Fri, 30 Jul 2021 18:28:18 +0000 Subject: [issue44786] test_check_c_globals "crashed" and then "FutureWarning: Possible nested set at position 12" In-Reply-To: <1627669677.16.0.177295366811.issue44786@roundup.psfhosted.org> Message-ID: <1627669698.66.0.730184858827.issue44786@roundup.psfhosted.org> Change by Irit Katriel : ---------- components: +Tests _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:46:22 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 30 Jul 2021 18:46:22 +0000 Subject: [issue44773] case_insensitive kwarg in str.replace() In-Reply-To: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> Message-ID: <1627670782.08.0.800330800995.issue44773@roundup.psfhosted.org> Eric V. Smith added the comment: I agree with Raymond that this should be rejected. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 14:53:49 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Jul 2021 18:53:49 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627671229.27.0.381054737422.issue41737@roundup.psfhosted.org> Eryk Sun added the comment: > It should be emphasized that it may happen on a **file operation** I think it's adequately covered by "attempts to open or traverse a non-directory file". The reader should know that opening "/path/to/file/somename.txt" requires traversing the components in the path. So if "file" isn't a directory, raising NotADirectoryError should be expected in POSIX. --- If someone can verify the behavior on common non-Linux POSIX systems such as macOS, FreeBSD, and OpenBSD, then the wording could be narrowed down to "on most POSIX platforms" instead of "on some platforms". For example, given "spam" is a regular file in the current directory, check os.open('spam', os.O_DIRECTORY); os.open('spam/', 0); and os.open('spam/eggs', 0). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 15:04:20 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Fri, 30 Jul 2021 19:04:20 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627671860.61.0.768639566284.issue41737@roundup.psfhosted.org> Andrei Kulakov added the comment: Eryk: On MacOS, I get Not a directory error on all 3: NotADirectoryError: [Errno 20] Not a directory: 'spam' NotADirectoryError: [Errno 20] Not a directory: 'spam/' NotADirectoryError: [Errno 20] Not a directory: 'spam/eggs' ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 15:10:45 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Fri, 30 Jul 2021 19:10:45 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627672245.69.0.0866097752426.issue44782@roundup.psfhosted.org> Dennis Sweeney added the comment: Related (regarding od.popitem()): https://bugs.python.org/issue27275 ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 15:31:23 2021 From: report at bugs.python.org (E. Paine) Date: Fri, 30 Jul 2021 19:31:23 +0000 Subject: [issue44785] test_pickle issues "DeprecationWarning: The Tix Tk.." In-Reply-To: <1627669471.31.0.97257359702.issue44785@roundup.psfhosted.org> Message-ID: <1627673483.52.0.463989777923.issue44785@roundup.psfhosted.org> Change by E. Paine : ---------- keywords: +patch nosy: +epaine nosy_count: 1.0 -> 2.0 pull_requests: +26012 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27496 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:05:07 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Fri, 30 Jul 2021 20:05:07 +0000 Subject: [issue44773] case_insensitive kwarg in str.replace() In-Reply-To: <1627578644.34.0.434278469351.issue44773@roundup.psfhosted.org> Message-ID: <1627675507.33.0.142588778887.issue44773@roundup.psfhosted.org> Serhiy Storchaka added the comment: I concur with Raymond and Eric. Note that in general case the problem is more complex that you may expect. First, some characters can match two characters (e.g. '?' matches 'SS'), and therefore indexes of characters are different in different cases. Second, you may want to take to account Unicode normalization, so '?' will match '??' (the former is a single character, the latter is two characters '?'+'\u0306'). The re module will not help with solving the first problem. You should use the third-party regex package. For the second problem you can use unicodedata.normalize(), ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:05:34 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Fri, 30 Jul 2021 20:05:34 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627675534.3.0.129781784016.issue44648@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 nosy_count: 5.0 -> 6.0 pull_requests: +26013 pull_request: https://github.com/python/cpython/pull/27484 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:24:45 2021 From: report at bugs.python.org (Marty) Date: Fri, 30 Jul 2021 20:24:45 +0000 Subject: [issue44787] Missing valid directive %D in datetime.strftime() documentation Message-ID: <1627676685.12.0.81634911114.issue44787@roundup.psfhosted.org> New submission from Marty : Output of: datetime.datetime.now().strftime('%D') is equivalent for: datetime.datetime.now().strftime('%m/%d/%y') Is there a reason that directive %D is missing in documentation? Are there other hidden directives? https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior ---------- messages: 398606 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: Missing valid directive %D in datetime.strftime() documentation versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:26:24 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 20:26:24 +0000 Subject: [issue44648] Inspect.getsource raises wrong error on classes in interactive session In-Reply-To: <1626373898.62.0.7619618577.issue44648@roundup.psfhosted.org> Message-ID: <1627676784.56.0.0836294318149.issue44648@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- nosy: +jaraco nosy_count: 6.0 -> 7.0 pull_requests: +26014 pull_request: https://github.com/python/cpython/pull/27436 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:28:25 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Jul 2021 20:28:25 +0000 Subject: [issue44738] io_uring as a new backend to selectors and asyncio In-Reply-To: <1627285790.87.0.178288680058.issue44738@roundup.psfhosted.org> Message-ID: <1627676905.62.0.711629505957.issue44738@roundup.psfhosted.org> Terry J. Reedy added the comment: Continue the discussion, including adding new info, to the #41271 ---------- nosy: +terry.reedy resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Add support for io_uring to cpython _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:30:12 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Jul 2021 20:30:12 +0000 Subject: [issue44744] [security] Open redirect attack due to insufficient validation in Urlparse In-Reply-To: <1627311512.81.0.173431010416.issue44744@roundup.psfhosted.org> Message-ID: <1627677012.65.0.982056442215.issue44744@roundup.psfhosted.org> Change by Terry J. Reedy : ---------- components: +Library (Lib) -Parser stage: -> test needed type: -> security _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:41:34 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Fri, 30 Jul 2021 20:41:34 +0000 Subject: [issue44748] argparse: a bool indicating if arg was encountered In-Reply-To: <1627377992.52.0.310829281762.issue44748@roundup.psfhosted.org> Message-ID: <1627677694.04.0.995221808673.issue44748@roundup.psfhosted.org> Terry J. Reedy added the comment: Joker, please don't mess with headers. Enhancements only appear in future versions; argparse is a library module, not a test module. ---------- components: +Library (Lib) -Tests nosy: +terry.reedy stage: -> test needed versions: +Python 3.11 -Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 16:58:48 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Fri, 30 Jul 2021 20:58:48 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627678728.29.0.043522934305.issue44771@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- pull_requests: +26015 pull_request: https://github.com/python/cpython/pull/27497 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 17:20:36 2021 From: report at bugs.python.org (Eric V. Smith) Date: Fri, 30 Jul 2021 21:20:36 +0000 Subject: [issue44787] Missing valid directive %D in datetime.strftime() documentation In-Reply-To: <1627676685.12.0.81634911114.issue44787@roundup.psfhosted.org> Message-ID: <1627680036.55.0.236786973663.issue44787@roundup.psfhosted.org> Eric V. Smith added the comment: It's dependent on the platform's C library's strftime(). I think (but don't promise) that we document the C89 codes, but each platform might provide additional ones. ---------- nosy: +eric.smith _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 17:42:07 2021 From: report at bugs.python.org (Roundup Robot) Date: Fri, 30 Jul 2021 21:42:07 +0000 Subject: [issue27498] Regression in repr() of class object In-Reply-To: <1468338842.06.0.843714859349.issue27498@psf.upfronthosting.co.za> Message-ID: <1627681327.22.0.726033606175.issue27498@roundup.psfhosted.org> Change by Roundup Robot : ---------- pull_requests: +26016 pull_request: https://github.com/python/cpython/pull/27498 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 17:55:13 2021 From: report at bugs.python.org (Eryk Sun) Date: Fri, 30 Jul 2021 21:55:13 +0000 Subject: [issue41737] Improper NotADirectoryError when opening a file in a fake directory In-Reply-To: <1599492997.14.0.974001441191.issue41737@roundup.psfhosted.org> Message-ID: <1627682113.29.0.337196204207.issue41737@roundup.psfhosted.org> Eryk Sun added the comment: > On MacOS, I get Not a directory error on all 3 Confirmation on Linux and macOS suffices for "most POSIX systems", based on market share for desktops and servers. It would be nice to also confirm this for FreeBSD, AIX, HP-UX, and Solaris, but I suppose it isn't necessary. A system that strictly conforms to POSIX will behave the same for those operations. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 18:28:57 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Fri, 30 Jul 2021 22:28:57 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627684137.04.0.81859701271.issue44667@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- keywords: +patch nosy: +pablogsal nosy_count: 1.0 -> 2.0 pull_requests: +26017 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27499 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 19:00:52 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Fri, 30 Jul 2021 23:00:52 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627686052.12.0.749623726497.issue44782@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- assignee: docs at python -> rhettinger nosy: +rhettinger _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 19:34:00 2021 From: report at bugs.python.org (Marty) Date: Fri, 30 Jul 2021 23:34:00 +0000 Subject: [issue44788] Possibility to specify port in __init__ of ftplib.FTP Message-ID: <1627688040.44.0.389798708985.issue44788@roundup.psfhosted.org> New submission from Marty : I think all that's needed is to add new parameter port in __init__ and then add it to self.connect() as argument: def __init__(self, host='', port=0, user='', passwd='', acct='', timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, encoding='utf-8'): self.encoding = encoding self.source_address = source_address self.timeout = timeout if host: self.connect(host, port) if user: self.login(user, passwd, acct) Currently if I need to specify port, I have to do it like this: with FTP() as ftp: ftp.connect(host, port) ftp.login(user, password) # my actions I the port parameter would be added, I could use it like this: with FTP(host, port, user, password) as ftp: # my actions Thank you. ---------- components: Library (Lib) messages: 398611 nosy: vpjtqwv0101 priority: normal severity: normal status: open title: Possibility to specify port in __init__ of ftplib.FTP type: enhancement versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 19:47:48 2021 From: report at bugs.python.org (Dennis Clarke) Date: Fri, 30 Jul 2021 23:47:48 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c Message-ID: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> New submission from Dennis Clarke : With release 3.9.6 I see failures in compile on three system architectures and with three compilers. I did check with GCC 10.2.1 ( Debian 10.2.1-6 ) on IBM Power and also with FreeBSD UNIX LLVM/Clang 12.0.1 on AMD64 and also with Oracle Studio C99 strict in Solaris UNIX on Fujitsu SPARC64 wherein we see a consistent fail within the source : Parser/pegen/pegen.c This is due to a standards compliance failure as per section 6.10.3 Macro replacement. Please see constraints item 4. This fails to compile on Solaris 10 UNIX, FreeBSD 14.0 AMD64 and on Debian Linux. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional ---------- components: C API messages: 398612 nosy: blastwave priority: normal severity: normal status: open title: Code compliance concern in Parser/pegen/pegen.c type: compile error versions: Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 20:37:40 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 31 Jul 2021 00:37:40 +0000 Subject: [issue44771] Adopt changes from importlib_resources 5.2 In-Reply-To: <1627526933.52.0.0424131606686.issue44771@roundup.psfhosted.org> Message-ID: <1627691860.14.0.682910954535.issue44771@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset e63e6311aa258a5f3f49a7aed9fdde445fd384d6 by Jason R. Coombs in branch 'main': bpo-44771: Sync with importlib_resources 5.2.2, fixing refleak. (#27497) https://github.com/python/cpython/commit/e63e6311aa258a5f3f49a7aed9fdde445fd384d6 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:04:34 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 31 Jul 2021 01:04:34 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627693474.91.0.668158980833.issue44789@roundup.psfhosted.org> Dennis Sweeney added the comment: To be specific, is this about the fact that .arg is a member of `struct _arg` (typedef'ed as `arg_ty`), while at the same time arg() is a macro? as in: https://github.com/python/cpython/blob/0f42b726c87f72d522893f927b4cb592b8875641/Parser/pegen/pegen.c#L37 ---------- components: +Parser nosy: +Dennis Sweeney, lys.nikolaou, pablogsal _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:17:12 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 01:17:12 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627694232.94.0.273459906435.issue44667@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset b6bde9fc42aecad5be0457198d17cfe7b481ad79 by Pablo Galindo Salgado in branch 'main': bpo-44667: Treat correctly lines ending with comments and no newlines in the Python tokenizer (GH-27499) https://github.com/python/cpython/commit/b6bde9fc42aecad5be0457198d17cfe7b481ad79 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:17:35 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 01:17:35 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627694255.49.0.469256126733.issue44667@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26019 pull_request: https://github.com/python/cpython/pull/27501 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:17:30 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 01:17:30 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627694250.19.0.51288301421.issue44667@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +26018 pull_request: https://github.com/python/cpython/pull/27500 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:17:51 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 01:17:51 +0000 Subject: [issue44667] tokenize.py emits spurious NEWLINE if file ends on a comment without a newline In-Reply-To: <1626616213.56.0.119364692181.issue44667@roundup.psfhosted.org> Message-ID: <1627694271.17.0.908740344169.issue44667@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 Jul 30 21:23:16 2021 From: report at bugs.python.org (Karthikeyan Singaravelan) Date: Sat, 31 Jul 2021 01:23:16 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627694596.61.0.0194863695148.issue44784@roundup.psfhosted.org> Change by Karthikeyan Singaravelan : ---------- nosy: +jaraco _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:25:53 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 01:25:53 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627694753.45.0.0128427364289.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Dennis Clarke, thanks for the report. Unfortunately we don't know how to reproduce the problems you mention. Could you please indicate what are you running? For instance, I can compile with 11.1.0 with absolutely no problems here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:34:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 31 Jul 2021 01:34:10 +0000 Subject: [issue44767] python -m flask run gives OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions In-Reply-To: <1627497989.44.0.166759062012.issue44767@roundup.psfhosted.org> Message-ID: <1627695250.07.0.723471732858.issue44767@roundup.psfhosted.org> Terry J. Reedy added the comment: This tracker is for fixing bugs in CPython and its stdlib, not for bugs in 3rd party applications or their usage. Your report does not point to a bug in python itself. Try asking about this issue on a flask forum, python-list, maybe stackoverflow.com, or maybe elsewhere. When you do, cut and paste the full traceback. Also clarify whether you ran 'python -m flask run' at a command line or simulation thereof or whether you loaded app.py into VS Code and ran the file. Those are different actions. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 21:40:18 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 31 Jul 2021 01:40:18 +0000 Subject: [issue44776] Docs on mobile do not use monospace font for code snippets, misaligning carets of improved error messages In-Reply-To: <1627639091.83.0.138517548588.issue44776@roundup.psfhosted.org> Message-ID: <1627695618.45.0.491508908924.issue44776@roundup.psfhosted.org> Terry J. Reedy added the comment: Wrong tracker. Not 3rd party, but not a bug in the doc .rst files or cpython code files. ---------- nosy: +terry.reedy resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 22:20:58 2021 From: report at bugs.python.org (Michael Wang) Date: Sat, 31 Jul 2021 02:20:58 +0000 Subject: [issue44790] Recursion causes Crash Message-ID: <1627698058.13.0.682147531833.issue44790@roundup.psfhosted.org> New submission from Michael Wang : Ultimately it seems that deep recursion after setting the recursion limit actually crashes python ---------- components: Interpreter Core files: bug.py messages: 398619 nosy: michaeljwang10 priority: normal severity: normal status: open title: Recursion causes Crash type: crash versions: Python 3.7 Added file: https://bugs.python.org/file50193/bug.py _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 22:24:35 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 31 Jul 2021 02:24:35 +0000 Subject: [issue44788] Possibility to specify port in __init__ of ftplib.FTP In-Reply-To: <1627688040.44.0.389798708985.issue44788@roundup.psfhosted.org> Message-ID: <1627698275.48.0.495921359526.issue44788@roundup.psfhosted.org> Jack DeVries added the comment: The only thing to consider is that connections are flakey, and the user might typically want to explicitly handle them in most cases. Therefore, it's a better API if the .connect() call appears in the user's code. If anything, it might be better to create a new context manager called Auto FTP connection or something, and include default error handling behavior. Have you discussed this idea in python- ideas? ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 22:25:31 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 31 Jul 2021 02:25:31 +0000 Subject: [issue44788] Possibility to specify port in __init__ of ftplib.FTP In-Reply-To: <1627688040.44.0.389798708985.issue44788@roundup.psfhosted.org> Message-ID: <1627698331.99.0.319406136424.issue44788@roundup.psfhosted.org> Jack DeVries added the comment: > user might typically want to explicitly handle them in most cases. *Explicitly handle exceptions ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 22:42:57 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 31 Jul 2021 02:42:57 +0000 Subject: [issue44790] Recursion causes Crash In-Reply-To: <1627698058.13.0.682147531833.issue44790@roundup.psfhosted.org> Message-ID: <1627699377.83.0.361075711192.issue44790@roundup.psfhosted.org> Jack DeVries added the comment: The default recursion limit is 1,000; you're increasing it by a factor of 10. It is documented that raising the recursion limit can cause crashes. What kind of crash are you seeing? Segmentation fault or stack overflow? Also, provide more details about your system: what OS and more importantly in this case, how much RAM? It's possible that this is not a bug. ---------- nosy: +jack__d _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 22:44:11 2021 From: report at bugs.python.org (Jack DeVries) Date: Sat, 31 Jul 2021 02:44:11 +0000 Subject: [issue44790] Recursion causes Crash In-Reply-To: <1627698058.13.0.682147531833.issue44790@roundup.psfhosted.org> Message-ID: <1627699451.09.0.380523628919.issue44790@roundup.psfhosted.org> Jack DeVries added the comment: Also, see related: bpo-44393 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:11:42 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 31 Jul 2021 03:11:42 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627701102.39.0.935908998107.issue44784@roundup.psfhosted.org> Jason R. Coombs added the comment: In addition to the two reported, there are two others: - test_entry_points_dict_construction - test_entry_points_by_index that also fail. I've been able to replicate the issue in importlib_metadata, so I'll fix it there first. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:12:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 31 Jul 2021 03:12:44 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627701164.33.0.307567420514.issue44784@roundup.psfhosted.org> Jason R. Coombs added the comment: All four of those tests had used `capture_warnings` in an attempt to capture them, but it did not alter the warnings filter. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:14:44 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 31 Jul 2021 03:14:44 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627701284.62.0.487705481435.issue44784@roundup.psfhosted.org> Jason R. Coombs added the comment: Patch at https://github.com/python/importlib_metadata/pull/333. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:45:53 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 31 Jul 2021 03:45:53 +0000 Subject: [issue44790] Recursion causes Crash In-Reply-To: <1627698058.13.0.682147531833.issue44790@roundup.psfhosted.org> Message-ID: <1627703153.0.0.924432422074.issue44790@roundup.psfhosted.org> Dennis Sweeney added the comment: Indeed, this behavior is documented at https://docs.python.org/3/library/sys.html?highlight=setrecursionlimit#sys.setrecursionlimit : "a too-high limit can lead to a crash". I'd recommend refactoring to use iteration rather than recursion: def fact(n): product = 1 for i in range(1, n+1): product *= i return product ---------- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:55:28 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 31 Jul 2021 03:55:28 +0000 Subject: [issue19270] Document that sched.cancel() doesn't distinguish equal events and can break order In-Reply-To: <1381913252.24.0.629122693277.issue19270@psf.upfronthosting.co.za> Message-ID: <1627703728.51.0.270740272905.issue19270@roundup.psfhosted.org> Andrei Kulakov added the comment: This can be closed as fixed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Fri Jul 30 23:58:11 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 31 Jul 2021 03:58:11 +0000 Subject: [issue42026] index function return first index for same element if repetitive in a list In-Reply-To: <1602581298.61.0.984431029548.issue42026@roundup.psfhosted.org> Message-ID: <1627703891.71.0.695578355956.issue42026@roundup.psfhosted.org> Andrei Kulakov added the comment: this can be closed I believe. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 00:17:31 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 31 Jul 2021 04:17:31 +0000 Subject: [issue42026] index function return first index for same element if repetitive in a list In-Reply-To: <1602581298.61.0.984431029548.issue42026@roundup.psfhosted.org> Message-ID: <1627705051.59.0.83858198088.issue42026@roundup.psfhosted.org> Change by Dennis Sweeney : ---------- status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 00:33:09 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 31 Jul 2021 04:33:09 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627705989.09.0.254074901865.issue44782@roundup.psfhosted.org> Raymond Hettinger added the comment: I'm thinking that the current LRU() recipe should be changed to lru_cache() API using an OrderedDict internally rather than inheriting from it. The current recipe was intended to be a sketch rather than a complete class; otherwise, methods like get() would also need to have been provided. Also, the resolution of issue 27275 doesn't look correct. The pop() method should not depend on the subclasses' __getitem__ method. In this regard, the pure python code for OrderedDict is correct and matches what regular dictionary's do (overriding __getitem__ has no effect on other methods). This leaves to the class "open for extension but closed for modification". Most of our container classes follow this pattern unless specifically documented to the contrary (i.e. a framework pattern). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 00:37:00 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sat, 31 Jul 2021 04:37:00 +0000 Subject: [issue44782] LRU class given as example in OrderedDict docs not work on pop In-Reply-To: <1627662154.37.0.411643198331.issue44782@roundup.psfhosted.org> Message-ID: <1627706220.4.0.436899923978.issue44782@roundup.psfhosted.org> Change by Raymond Hettinger : ---------- nosy: +eric.snow _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 01:47:59 2021 From: report at bugs.python.org (Dennis Sweeney) Date: Sat, 31 Jul 2021 05:47:59 +0000 Subject: [issue27275] KeyError thrown by optimised collections.OrderedDict.popitem() In-Reply-To: <1465446835.8.0.930561202137.issue27275@psf.upfronthosting.co.za> Message-ID: <1627710479.09.0.858796802316.issue27275@roundup.psfhosted.org> Dennis Sweeney added the comment: bpo-44782 was opened about the `class LRU(OrderedDict)` in the OrderedDict docs, and its pop() method failing. I think Serhiy's patch here (before revert) may be a good idea (to re-apply). I think it is reasonable to ignore user-implemented dunder methods from subclasses. Concrete type implementations generally do not behave as mix-ins: def never_called(self, *args): print("Never called.") raise ZeroDivisionError class MyList(list): __setitem__ = __delitem__ = __getitem__ = __len__ = __iter__ = __contains__ = never_called class MyDict(dict): __setitem__ = __delitem__ = __getitem__ = __len__ = __iter__ = __contains__ = never_called class MySet(set): __setitem__ = __delitem__ = __getitem__ = __len__ = __iter__ = __contains__ = never_called L = MyList([5, 4, 3, 2]) L.sort() L.pop(1) L.insert(0, 42) L.pop() L.reverse() assert type(L) is MyList D = MyDict({"a": 1, "b": 2, "c": 3}) assert D.get(0) is None assert D.get("a") == 1 assert D.pop("b") == 2 assert D.popitem() == ("c", 3) assert type(D) is MyDict S = MySet({"a", "b", "c"}) S.discard("a") S.remove("b") S.isdisjoint(S) S |= S S &= S S ^= S assert type(S) is MySet ---------- nosy: +Dennis Sweeney _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 06:25:14 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 10:25:14 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate Message-ID: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> New submission from Serhiy Storchaka : Substitution of ParamSpec in Concatenate produces weird results: >>> import typing >>> P = typing.ParamSpec('P') >>> typing.Concatenate[str, P][int] typing.Concatenate[str, int] >>> typing.Concatenate[str, P][[int]] typing.Concatenate[str, (,)] >>> typing.Concatenate[str, P][typing.Concatenate[int, P]] typing.Concatenate[str, typing.Concatenate[int, ~P]] But all these results are invalid: >>> typing.Concatenate[str, int] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 400, in __getitem__ return self._getitem(self, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 595, in Concatenate raise TypeError("The last parameter to Concatenate should be a " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: The last parameter to Concatenate should be a ParamSpec variable. >>> typing.Concatenate[str, (int,)] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 400, in __getitem__ return self._getitem(self, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 595, in Concatenate raise TypeError("The last parameter to Concatenate should be a " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: The last parameter to Concatenate should be a ParamSpec variable. >>> typing.Concatenate[str, [int]] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 400, in __getitem__ return self._getitem(self, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 595, in Concatenate raise TypeError("The last parameter to Concatenate should be a " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: The last parameter to Concatenate should be a ParamSpec variable. >>> typing.Concatenate[str, typing.Concatenate[int, P]] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 400, in __getitem__ return self._getitem(self, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 595, in Concatenate raise TypeError("The last parameter to Concatenate should be a " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: The last parameter to Concatenate should be a ParamSpec variable. I expect that 1. The last parameter to Concatenate can be a Concatenate. Inner Concatenate should merge with the external one: Concatenate[str, Concatenate[int, P]] -> Concatenate[str, int, P] Concatenate[str, P][Concatenate[int, P]] -> Concatenate[str, int, P] 2. The last parameter to Concatenate can be a list of types. The result should be a list of types. Concatenate[str, [int, dict]] -> [str, int, dict] Concatenate[str, P][[int, dict]] -> [str, int, dict] 3. The last parameter to Concatenate can be an ellipsis. Concatenate[str, ...] Concatenate[str, P][...] -> Concatenate[str, ...] ---------- components: Library (Lib) messages: 398632 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Substitution of ParamSpec in Concatenate versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 07:25:21 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 31 Jul 2021 11:25:21 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions Message-ID: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> New submission from Miguel Brito : Hi, I was playing around with Python's grammar and noticed that the error message for if expression is generic, so not very informative. I decided to improve it slightly. *From*: ``` >>> a = 42 if True File "", line 1 a = 42 if True ^ SyntaxError: invalid syntax ``` *To*: ``` $ ./python Python 3.10.0b4 (tags/v3.10.0b4-dirty:2ba4b20854, Jul 31 2021, 11:50:15) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a = 42 if True File "", line 1 a = 42 if True ^ SyntaxError: invalid syntax. Conditional expression expected an 'else' here. ``` ---------- messages: 398633 nosy: miguendes priority: normal severity: normal status: open title: Improve syntax errors for invalid if expressions _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 07:28:10 2021 From: report at bugs.python.org (Miguel Brito) Date: Sat, 31 Jul 2021 11:28:10 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627730890.76.0.259622575071.issue44792@roundup.psfhosted.org> Change by Miguel Brito : ---------- keywords: +patch pull_requests: +26020 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27506 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:11:49 2021 From: report at bugs.python.org (Dennis Clarke) Date: Sat, 31 Jul 2021 12:11:49 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627733509.13.0.20090366108.issue44789@roundup.psfhosted.org> Dennis Clarke added the comment: Let me see if I can be a bit more clear with the problem that I am seeing on three separate systems. It does seem to be an issue in a macro : 1) Debian Linux on IBM Power ppc64 big-endian : enceladus$ uname -a Linux enceladus 5.13.4-genunix #1 SMP Tue Jul 20 12:42:08 EDT 2021 ppc64 GNU/Linux enceladus$ gcc --version gcc (Debian 10.2.1-6) 10.2.1 20210110 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. enceladus$ enceladus$ enceladus$ ls Parser/pegen/pegen.c Parser/pegen/pegen.h Parser/pegen/pegen.c Parser/pegen/pegen.h enceladus$ enceladus$ /usr/bin/gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG \ > -fwrapv -Wall -std=iso9899:1999 -pedantic -g -O0 -fno-builtin -m64 \ > -mno-quad-memory-atomic -mfull-toc -mno-multiple -mupdate -mbig \ > -mregnames -fno-unsafe-math-optimizations -pedantic-errors \ > -Wextra -Wno-unused-result -Wno-unused-parameter \ > -Wno-missing-field-initializers \ > -Werror=implicit-function-declaration \ > -fvisibility=hidden \ > -I./Include/internal -I. -I./Include \ > -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE \ > -DPy_BUILD_CORE -o Parser/pegen/pegen.o Parser/pegen/pegen.c In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h: In function ?_RAISE_SYNTAX_ERROR_INVALID_TARGET?: Parser/pegen/pegen.h:297:47: error: ISO C99 requires at least one argument for the "..." in a variadic macro 297 | return RAISE_SYNTAX_ERROR("invalid syntax"); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_check_barry_as_flufl?: Parser/pegen/pegen.c:71:74: error: ISO C99 requires at least one argument for the "..." in a variadic macro 71 | RAISE_SYNTAX_ERROR("with Barry as BDFL, use '<>' instead of '!='"); | ^ Parser/pegen/pegen.c: In function ?tokenizer_error?: Parser/pegen/pegen.c:323:81: error: ISO C99 requires at least one argument for the "..." in a variadic macro 323 | RAISE_SYNTAX_ERROR("EOF while scanning triple-quoted string literal"); | ^ Parser/pegen/pegen.c:326:67: error: ISO C99 requires at least one argument for the "..." in a variadic macro 326 | RAISE_SYNTAX_ERROR("EOL while scanning string literal"); | ^ Parser/pegen/pegen.c:329:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro 329 | RAISE_SYNTAX_ERROR("unexpected EOF while parsing"); | ^ Parser/pegen/pegen.c:332:90: error: ISO C99 requires at least one argument for the "..." in a variadic macro 332 | RAISE_INDENTATION_ERROR("unindent does not match any outer indentation level"); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_number_token?: Parser/pegen/pegen.c:953:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro 953 | "in Python 3.6 and greater"); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_run_parser?: Parser/pegen/pegen.c:1132:73: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1132 | RAISE_SYNTAX_ERROR("error at start before reading any input"); | ^ Parser/pegen/pegen.c:1135:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1135 | RAISE_SYNTAX_ERROR("unexpected EOF while parsing"); | ^ Parser/pegen/pegen.c:1139:60: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1139 | RAISE_INDENTATION_ERROR("unexpected indent"); | ^ Parser/pegen/pegen.c:1142:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1142 | RAISE_INDENTATION_ERROR("unexpected unindent"); | ^ Parser/pegen/pegen.c:1145:52: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1145 | RAISE_SYNTAX_ERROR("invalid syntax"); | ^ Parser/pegen/pegen.c:1153:97: error: ISO C99 requires at least one argument for the "..." in a variadic macro 1153 | return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement"); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_concatenate_strings?: Parser/pegen/pegen.c:2053:72: error: ISO C99 requires at least one argument for the "..." in a variadic macro 2053 | RAISE_SYNTAX_ERROR("cannot mix bytes and nonbytes literals"); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_arguments_parsing_error?: Parser/pegen/pegen.c:2212:34: error: ISO C99 requires at least one argument for the "..." in a variadic macro 2212 | return RAISE_SYNTAX_ERROR(msg); | ^ Parser/pegen/pegen.c: In function ?_PyPegen_nonparen_genexp_in_call?: Parser/pegen/pegen.c:2233:5: error: ISO C99 requires at least one argument for the "..." in a variadic macro 2233 | ); | ^ enceladus$ 2) On FreeBSD UNIX with AMD64 and LLVM/Clang : europa$ uname -apKU FreeBSD europa 14.0-CURRENT FreeBSD 14.0-CURRENT #3: Sun Jul 25 13:50:33 GMT 2021 root at europa:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 amd64 1400026 1400026 europa$ europa$ cc --version FreeBSD clang version 12.0.1 (git at github.com:llvm/llvm-project.git llvmorg-12.0.1-0-gfed41342a82f) Target: x86_64-unknown-freebsd14.0 Thread model: posix InstalledDir: /usr/bin europa$ europa$ ls Parser/pegen/pegen.c Parser/pegen/pegen.h Parser/pegen/pegen.c Parser/pegen/pegen.h europa$ europa$ /usr/bin/cc -pthread -c -fno-strict-aliasing -Wsign-compare \ > -Wunreachable-code -DNDEBUG -g -fwrapv -Wall -std=iso9899:1999 \ > -pedantic -pedantic-errors -Weverything -Wno-reserved-id-macro \ > -Wno-missing-prototypes -m64 -O0 -fno-fast-math -fno-builtin \ > -Werror=implicit-function-declaration -fvisibility=hidden \ > -I./Include/internal -I. -I./Include \ > -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE \ > -DPy_BUILD_CORE -o Parser/pegen/pegen.o Parser/pegen/pegen.c In file included from Parser/pegen/pegen.c:1: In file included from ./Include/Python.h:94: In file included from ./Include/pytime.h:6: In file included from ./Include/object.h:615: ./Include/cpython/object.h:272:16: warning: padding struct 'struct _typeobject' with 4 bytes to align 'tp_finalize' [-Wpadded] destructor tp_finalize; ^ In file included from Parser/pegen/pegen.c:1: In file included from ./Include/Python.h:106: In file included from ./Include/unicodeobject.h:1026: ./Include/cpython/unicodeobject.h:218:14: warning: padding struct 'PyASCIIObject' with 4 bytes to align 'wstr' [-Wpadded] wchar_t *wstr; /* wchar_t representation (null-terminated) */ ^ In file included from Parser/pegen/pegen.c:5: In file included from Parser/pegen/pegen.h:7: ./Include/Python-ast.h:239:23: warning: padding struct 'struct _expr::(anonymous at ./Include/Python-ast.h:237:9)' with 4 bytes to align 'values' [-Wpadded] asdl_seq *values; ^ ./Include/Python-ast.h:452:20: warning: padding struct 'struct _type_ignore::(anonymous at ./Include/Python-ast.h:450:9)' with 4 bytes to align 'tag' [-Wpadded] string tag; ^ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:86: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:160:89: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] RAISE_ERROR_KNOWN_LOCATION(p, PyExc_SyntaxError, (a)->lineno, (a)->col_offset, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.c:12:45: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] PyObject *res = PyUnicode_DecodeUTF8(s, strlen(s), NULL); ~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~ In file included from Parser/pegen/pegen.c:1: In file included from ./Include/Python.h:105: In file included from ./Include/bytesobject.h:75: ./Include/cpython/bytesobject.h:5:9: warning: padding size of 'PyBytesObject' with 7 bytes to alignment boundary [-Wpadded] typedef struct { ^ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.c:83:44: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); ~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~ In file included from Parser/pegen/pegen.c:1: In file included from ./Include/Python.h:108: ./Include/longintrepr.h:85:8: warning: padding size of 'struct _longobject' with 4 bytes to alignment boundary [-Wpadded] struct _longobject { ^ Parser/pegen/pegen.c:163:13: warning: enumeration value 'Slice_kind' not explicitly handled in switch [-Wswitch-enum] switch (e->kind) { ^ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:86: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:157:86: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.h:158:94: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_INDENTATION_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_IndentationError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.c:351:60: warning: implicit conversion changes signedness: 'unsigned long' to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] col_offset = strlen(strtok(p->tok->buf, "\n")) - 1; ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ Parser/pegen/pegen.c:396:46: warning: implicit conversion changes signedness: 'unsigned long' to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] Py_ssize_t len = strlen(fstring_msg) + strlen(errmsg); ~~~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ Parser/pegen/pegen.c:398:48: warning: implicit conversion changes signedness: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] char *new_errmsg = PyMem_RawMalloc(len + 1); // Lengths of both strings plus NULL character ~~~~~~~~~~~~~~~ ~~~~^~~ Parser/pegen/pegen.c:449:31: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual] PyMem_RawFree((void *)errmsg); ^ Parser/pegen/pegen.c:457:31: warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual] PyMem_RawFree((void *)errmsg); ^ Parser/pegen/pegen.c:535:35: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (strncmp(k->str, name, name_len) == 0) { ~~~~~~~ ^~~~~~~~ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:50:15: warning: padding struct 'struct growable_comment_array::(anonymous at Parser/pegen/pegen.h:48:5)' with 4 bytes to align 'comment' [-Wpadded] char *comment; // The " " in "# type: ignore " ^ Parser/pegen/pegen.c:588:38: warning: implicit conversion changes signedness: 'long' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] char *tag = PyMem_Malloc(len + 1); ~~~~~~~~~~~~ ~~~~^~~ Parser/pegen/pegen.c:593:29: warning: implicit conversion changes signedness: 'Py_ssize_t' (aka 'long') to 'size_t' (aka 'unsigned long') [-Wsign-conversion] strncpy(tag, start, len); ~~~~~~~ ^~~ Parser/pegen/pegen.c:618:55: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] Token **new_tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); ^~~~~~~ ~ Parser/pegen/pegen.c:877:44: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] x = (long)PyOS_strtoul(s, (char **)&end, 0); ^ Parser/pegen/pegen.c:883:37: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] x = PyOS_strtol(s, (char **)&end, 0); ^ Parser/pegen/pegen.c:894:56: warning: cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual] compl.imag = PyOS_string_to_double(s, (char **)&end, NULL); ^ Parser/pegen/pegen.c:895:24: warning: comparing floating point with == or != is unsafe [-Wfloat-equal] if (compl.imag == -1.0 && PyErr_Occurred()) { ~~~~~~~~~~ ^ ~~~~ Parser/pegen/pegen.c:901:12: warning: comparing floating point with == or != is unsafe [-Wfloat-equal] if (dx == -1.0 && PyErr_Occurred()) { ~~ ^ ~~~~ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:61:14: warning: padding struct 'Parser' with 4 bytes to align 'arena' [-Wpadded] PyArena *arena; ^ Parser/pegen/pegen.h:67:15: warning: padding struct 'Parser' with 4 bytes to align 'normalize' [-Wpadded] PyObject* normalize; ^ Parser/pegen/pegen.h:73:28: warning: padding struct 'Parser' with 4 bytes to align 'type_ignore_comments' [-Wpadded] growable_comment_array type_ignore_comments; ^ Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.h:158:94: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_INDENTATION_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_IndentationError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:158:94: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] Parser/pegen/pegen.c:1382:61: warning: implicit conversion changes signedness: 'unsigned long' to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] Py_ssize_t len = strlen(first_str) + strlen(second_str) + 1; // +1 for the dot ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ Parser/pegen/pegen.c:1496:40: warning: implicit conversion changes signedness: 'cmpop_ty' (aka 'enum _cmpop') to 'int' [-Wsign-conversion] asdl_seq_SET(new_seq, i, pair->cmpop); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ ./Include/asdl.h:42:51: note: expanded from macro 'asdl_seq_SET' #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) ~ ^ Parser/pegen/pegen.c:1581:13: warning: 21 enumeration values not explicitly handled in switch: 'BoolOp_kind', 'NamedExpr_kind', 'BinOp_kind'... [-Wswitch-enum] switch (expr->kind) { ^ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ Parser/pegen/pegen.c:2115:46: warning: implicit conversion changes signedness: 'size_t' (aka 'unsigned long') to 'Py_ssize_t' (aka 'long') [-Wsign-conversion] Py_ssize_t num = p->type_ignore_comments.num_items; ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ Parser/pegen/pegen.c:2163:13: warning: 20 enumeration values not explicitly handled in switch: 'BoolOp_kind', 'NamedExpr_kind', 'BinOp_kind'... [-Wswitch-enum] switch (e->kind) { ^ In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h:157:84: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 32 warnings and 20 errors generated. europa$ 3) Solaris 10 UNIX with Oracle Studio 12.6 on Fujitsu SPARC64 beta $ beta $ uname -a SunOS beta 5.10 Generic_150400-65 sun4u sparc SUNW,SPARC-Enterprise beta $ cc -V cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30 beta $ c99 -V c99: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30 beta $ /opt/developerstudio12.6/bin/c99 -c -DNDEBUG -Xc -errtags=yes \ -errwarn=%none -m64 -xarch=sparc -xO0 -g -xs -errfmt=error \ -erroff=%none -errshort=full -xstrconst -xildoff -xmemalign=8s \ -xnolibmil -xcode=pic32 -xregs=no%appl -xlibmieee -mc \ -ftrap=%none -xbuiltin=%none -xunroll=1 -Qy -xdebugformat=dwarf \ -D_REENTRANT \ -I./Include/internal -I. -I./Include -I/opt/bw/include \ -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO \ -D_FILE_OFFSET_BITS=64 \ -DPy_BUILD_CORE -o Parser/pegen/pegen.o Parser/pegen/pegen.c "Parser/pegen/pegen.h", line 297: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.h", line 297: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 71: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 71: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 323: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 323: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 326: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 326: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 329: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 329: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 332: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 332: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 952: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 952: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1132: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1132: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1135: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1135: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1139: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1139: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1142: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1142: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1145: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1145: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 1153: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 1153: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 2053: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 2053: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 2212: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 2212: error: syntax error before or at: ) "Parser/pegen/pegen.c", line 2230: warning: argument mismatch (E_ARGUEMENT_MISMATCH) "Parser/pegen/pegen.c", line 2230: error: syntax error before or at: ) c99: acomp failed for Parser/pegen/pegen.c beta $ Also for the sake of some added flavour here we can look at Debian on AMD64 with whatever tools we get in Debian stable. I ran a trivial configure "./configure --without-pymalloc --prefix=/home/dclarke/local" and see the same failure. deimos$ deimos$ uname -a Linux deimos 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux deimos$ gcc --version gcc (Debian 8.3.0-6) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. deimos$ Then during make : gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=iso9899:1999 -pedantic -pedantic-errors -m64 -g -O0 -fno-builtin -march=k8 -mtune=k8 -mieee-fp -fno-fast-math -std=iso9899:1999 -pedantic -pedantic-errors -m64 -g -O0 -fno-builtin -march=k8 -mtune=k8 -mieee-fp -fno-fast-math -std=iso9899:1999 -pedantic -pedantic-errors -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -DPy_BUILD_CORE -o Parser/pegen/pegen.o Parser/pegen/pegen.c In file included from Parser/pegen/pegen.c:5: Parser/pegen/pegen.h: In function '_RAISE_SYNTAX_ERROR_INVALID_TARGET': Parser/pegen/pegen.h:297:47: error: ISO C99 requires at least one argument for the "..." in a variadic macro return RAISE_SYNTAX_ERROR("invalid syntax"); ^ Parser/pegen/pegen.c: In function '_PyPegen_check_barry_as_flufl': Parser/pegen/pegen.c:71:74: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("with Barry as BDFL, use '<>' instead of '!='"); ^ Parser/pegen/pegen.c: In function 'tokenizer_error': Parser/pegen/pegen.c:323:81: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("EOF while scanning triple-quoted string literal"); ^ Parser/pegen/pegen.c:326:67: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("EOL while scanning string literal"); ^ Parser/pegen/pegen.c:329:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("unexpected EOF while parsing"); ^ Parser/pegen/pegen.c:332:90: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_INDENTATION_ERROR("unindent does not match any outer indentation level"); ^ Parser/pegen/pegen.c: In function '_PyPegen_number_token': Parser/pegen/pegen.c:953:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro "in Python 3.6 and greater"); ^ Parser/pegen/pegen.c: In function '_PyPegen_run_parser': Parser/pegen/pegen.c:1132:73: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("error at start before reading any input"); ^ Parser/pegen/pegen.c:1135:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("unexpected EOF while parsing"); ^ Parser/pegen/pegen.c:1139:60: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_INDENTATION_ERROR("unexpected indent"); ^ Parser/pegen/pegen.c:1142:62: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_INDENTATION_ERROR("unexpected unindent"); ^ Parser/pegen/pegen.c:1145:52: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("invalid syntax"); ^ Parser/pegen/pegen.c:1153:97: error: ISO C99 requires at least one argument for the "..." in a variadic macro return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement"); ^ Parser/pegen/pegen.c: In function '_PyPegen_concatenate_strings': Parser/pegen/pegen.c:2053:72: error: ISO C99 requires at least one argument for the "..." in a variadic macro RAISE_SYNTAX_ERROR("cannot mix bytes and nonbytes literals"); ^ Parser/pegen/pegen.c: In function '_PyPegen_arguments_parsing_error': Parser/pegen/pegen.c:2212:34: error: ISO C99 requires at least one argument for the "..." in a variadic macro return RAISE_SYNTAX_ERROR(msg); ^ Parser/pegen/pegen.c: In function '_PyPegen_nonparen_genexp_in_call': Parser/pegen/pegen.c:2233:5: error: ISO C99 requires at least one argument for the "..." in a variadic macro ); ^ make: *** [Makefile:1803: Parser/pegen/pegen.o] Error 1 deimos$ So I can not get 3.9.6 to compile on any of four systems. ---------- components: -Parser _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:19:11 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 12:19:11 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627733951.04.0.592341516493.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Seems to me that you are not only running configure + make but you are adding things to the CFLAGS. Could you please add a list of all the extra complication flags you are adding? ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:24:26 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 12:24:26 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable Message-ID: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> New submission from Serhiy Storchaka : >>> import typing >>> T = typing.TypeVar('T') >>> P = typing.ParamSpec('P') >>> C = typing.Callable[P, T] >>> C[int, str, float] typing.Callable[[int], str] int substitutes P as [int], str substitutes T, and the third argument float is ignored. ---------- components: Library (Lib) messages: 398636 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Arguments ignored in substitution in typing.Callable type: behavior versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:40:31 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 12:40:31 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable Message-ID: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> New submission from Serhiy Storchaka : The proposed PR merges tests for typing.Callable (in test_typing.py) and collection.abc.Callable (in test_genericalias.py). All old tests are now executed for both implementations. It has exposed a bug in typing.Callable (see issue44793) and minor bug in error message for collection.abc.Callable (missed space). It will help to support consistency of implementations in future. ---------- components: Tests messages: 398637 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Merge tests for typing.Callable and collection.abc.Callable type: enhancement versions: Python 3.10, Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:42:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 12:42:10 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627735330.39.0.734327833975.issue44794@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26021 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27507 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:44:30 2021 From: report at bugs.python.org (Andreas H.) Date: Sat, 31 Jul 2021 12:44:30 +0000 Subject: [issue44795] asyncio.run does not allow for graceful shutdown of main task Message-ID: <1627735470.13.0.162641750734.issue44795@roundup.psfhosted.org> New submission from Andreas H. : The issue is that the main task (which was supplied to asyncio.run) has no chance to clean up its "own" sub-tasks and handle possible exceptions that occur during the sub-task clean up. It prevents a graceful shutdown. There is no way to prevent the current printing of the "unhandled" exeption, even though the sub-task exception was catched by the main task. (See example below) -- Current behavior -- When asyncio.run() receives an (unhanded) exception, all tasks are cancelled simultaneously. If any task generates an exception during its clean-up phase this is printed to the log, even though this exception is handled by the main task. -- Expected behavior -- asyncio.run() should first cancel the main task, wait for it to complete its shutdown (and possible cancel its own sub-tasks, with exception catching), and *afterwards* cancel the remaining tasks. -- Example Code -- For instance realize a graceful shutdown of a webserver when SIGTERM signal handler raises a SystemExit exception. import os import asyncio import logging async def main(): logging.basicConfig(level=logging.INFO) async def sub_task(): logging.info('sub_task: enter') try: while True: await asyncio.sleep(1) logging.info('some_task: action') finally: logging.info('sub_task: cleanup') await asyncio.sleep(3) logging.info('sub_task: cleanup generates exception') raise ValueError() logging.info('sub_task: cleanup end') task = asyncio.create_task(sub_task()) try: while True: await asyncio.sleep(1) except Exception as e: logging.info(f"Main: exception {repr(e)} received: something went wrong: cancelling sub-task") task.cancel() finally: logging.info("Main: cleanup") try: await task except Exception as e: logging.info(f"Main: catched exception {repr(e)} from await sub_task") try: asyncio.run( main() ) except KeyboardInterrupt: pass -- Script Output with Ctrl+C manually generating an KeyboardInterrupt exception -- INFO:root:sub_task: enter INFO:root:some_task: action <--- CtrlC pressed here INFO:root:Main: exception CancelledError() received: something went wrong: cancelling sub-task INFO:root:Main: cleanup INFO:root:sub_task: cleanup INFO:root:sub_task: cleanup generates exception INFO:root:Main: catched exception ValueError() from await sub_task ERROR:asyncio:unhandled exception during asyncio.run() shutdown task: .sub_task() done, defined at D:\Benutzer\projekte\iep\apps\data_player\_signals_test\test.py:10> exception=ValueError()> Traceback (most recent call last): File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\asyncio\runners.py", line 43, in run return loop.run_until_complete(main) File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\asyncio\base_events.py", line 574, in run_until_complete self.run_forever() File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\asyncio\base_events.py", line 541, in run_forever self._run_once() File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\asyncio\base_events.py", line 1750, in _run_once event_list = self._selector.select(timeout) File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\selectors.py", line 323, in select r, w, _ = self._select(self._readers, self._writers, [], timeout) File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\selectors.py", line 314, in _select r, w, x = select.select(r, w, w, timeout) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Benutzer\projekte\iep\apps\data_player\_signals_test\test.py", line 14, in sub_task await asyncio.sleep(1) File "C:\Users\z0013xar\AppData\Local\Continuum\anaconda3\lib\asyncio\tasks.py", line 595, in sleep return await future concurrent.futures._base.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Benutzer\projekte\iep\apps\data_player\_signals_test\test.py", line 34, in main await task File "D:\Benutzer\projekte\iep\apps\data_player\_signals_test\test.py", line 20, in sub_task raise ValueError() ValueError -- Expected Output -- Same as above but without "ERROR:asyncio:unhandled exception during asyncio.run() shutdown" and following traceback ---------- components: asyncio messages: 398638 nosy: andreash, asvetlov, yselivanov priority: normal severity: normal status: open title: asyncio.run does not allow for graceful shutdown of main task type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 08:47:20 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sat, 31 Jul 2021 12:47:20 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627735640.73.0.621092017346.issue44784@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- keywords: +patch pull_requests: +26022 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27508 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:07:56 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 31 Jul 2021 13:07:56 +0000 Subject: [issue4476] compileall fails if current dir has a "types" package In-Reply-To: <1228107974.27.0.161282978705.issue4476@psf.upfronthosting.co.za> Message-ID: <1627736876.87.0.948358613326.issue4476@roundup.psfhosted.org> Change by Felipe Rodrigues : ---------- nosy: +fbidu nosy_count: 5.0 -> 6.0 pull_requests: +26023 pull_request: https://github.com/python/cpython/pull/27509 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:08:23 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 13:08:23 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627736903.12.0.956857247786.issue44784@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26024 pull_request: https://github.com/python/cpython/pull/27510 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:08:21 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 13:08:21 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627736901.6.0.379531742438.issue44784@roundup.psfhosted.org> miss-islington added the comment: New changeset 1cf8424a62db38a041d421a46618e025bbb87f89 by Jason R. Coombs in branch 'main': bpo-44784: Apply changes from importlib_metadata 4.6.3 (GH-27508) https://github.com/python/cpython/commit/1cf8424a62db38a041d421a46618e025bbb87f89 ---------- nosy: +miss-islington _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:27:53 2021 From: report at bugs.python.org (Emmanuel Arias) Date: Sat, 31 Jul 2021 13:27:53 +0000 Subject: [issue44779] Checkouts stale following changes to .gitattributes In-Reply-To: <1627654865.8.0.668589058029.issue44779@roundup.psfhosted.org> Message-ID: <1627738073.0.0.284676473713.issue44779@roundup.psfhosted.org> Change by Emmanuel Arias : ---------- nosy: +eamanu _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:31:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 13:31:29 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec Message-ID: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> New submission from Serhiy Storchaka : Adding __parameters__ and __getitem__ in TypeVar and ParamSpec allows to generalize and simplify the code (especially the C code) and allows to add more runtime checks. It may open ways for further simplification. Unfortunately it is not compatible with issue44098, so the latter changes should be reverted. ---------- components: Library (Lib) messages: 398640 nosy: gvanrossum, kj, serhiy.storchaka priority: normal severity: normal status: open title: Add __parameters__ and __getitem__ in TypeVar and ParamSpec type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:32:02 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 13:32:02 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1627738322.77.0.305444903516.issue44796@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- dependencies: +Merge tests for typing.Callable and collection.abc.Callable _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:34:46 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 13:34:46 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1627738486.03.0.565486224985.issue44796@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26025 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27511 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 09:36:10 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 13:36:10 +0000 Subject: [issue44098] Remove ParamSpec from __parameters__ of most typing generics In-Reply-To: <1620639695.98.0.0136931922016.issue44098@roundup.psfhosted.org> Message-ID: <1627738570.53.0.17632666228.issue44098@roundup.psfhosted.org> Serhiy Storchaka added the comment: See issue44796. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 10:20:10 2021 From: report at bugs.python.org (=?utf-8?b?SmVzw7pzIENlYSBBdmnDs24=?=) Date: Sat, 31 Jul 2021 14:20:10 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread In-Reply-To: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> Message-ID: <1627741210.79.0.477315874521.issue42815@roundup.psfhosted.org> Change by Jes?s Cea Avi?n : ---------- nosy: +jcea _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 10:51:54 2021 From: report at bugs.python.org (Guido van Rossum) Date: Sat, 31 Jul 2021 14:51:54 +0000 Subject: [issue42815] new thread doesn't copy context of the parent thread In-Reply-To: <1609674214.71.0.941381845328.issue42815@roundup.psfhosted.org> Message-ID: <1627743114.59.0.0392077232695.issue42815@roundup.psfhosted.org> Guido van Rossum added the comment: Trust me, it's too late to fix this in 3.10. ---------- nosy: +gvanrossum _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 11:02:13 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 31 Jul 2021 15:02:13 +0000 Subject: [issue44766] [easy doc] Remove redundant info in README.valgrind In-Reply-To: <1627495632.91.0.703562512799.issue44766@roundup.psfhosted.org> Message-ID: <1627743733.68.0.124230334263.issue44766@roundup.psfhosted.org> Change by Felipe Rodrigues : ---------- keywords: +patch nosy: +fbidu nosy_count: 2.0 -> 3.0 pull_requests: +26026 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27509 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 11:02:50 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 31 Jul 2021 15:02:50 +0000 Subject: [issue4476] compileall fails if current dir has a "types" package In-Reply-To: <1228107974.27.0.161282978705.issue4476@psf.upfronthosting.co.za> Message-ID: <1627743769.99.0.820194907378.issue4476@roundup.psfhosted.org> Felipe Rodrigues added the comment: sorry about the noise, everyone. Missed an '6' in the end of the issue name ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 11:03:05 2021 From: report at bugs.python.org (Felipe Rodrigues) Date: Sat, 31 Jul 2021 15:03:05 +0000 Subject: [issue4476] compileall fails if current dir has a "types" package In-Reply-To: <1228107974.27.0.161282978705.issue4476@psf.upfronthosting.co.za> Message-ID: <1627743785.65.0.490966598495.issue4476@roundup.psfhosted.org> Change by Felipe Rodrigues : ---------- pull_requests: -26023 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:19:59 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 16:19:59 +0000 Subject: [issue44797] test_socket should expect warnings in truncated-data tests Message-ID: <1627748399.43.0.897184289547.issue44797@roundup.psfhosted.org> New submission from Irit Katriel : I believe these warnings are a feature so the tests should expect them. Patch included. % ./python.exe -E -We -m test -v test_socket ====================================================================== ERROR: testSecondCmsgTruncInData (test.test_socket.RecvmsgRFC3542AncillaryUDP6Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 4176, in testSecondCmsgTruncInData msg, ancdata, flags, addr = self.doRecvmsg( ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testSingleCmsgTruncInData (test.test_socket.RecvmsgRFC3542AncillaryUDP6Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 4072, in testSingleCmsgTruncInData msg, ancdata, flags, addr = self.doRecvmsg( ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testSecondCmsgTruncInData (test.test_socket.RecvmsgIntoRFC3542AncillaryUDP6Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 4176, in testSecondCmsgTruncInData msg, ancdata, flags, addr = self.doRecvmsg( ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testSingleCmsgTruncInData (test.test_socket.RecvmsgIntoRFC3542AncillaryUDP6Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 4072, in testSingleCmsgTruncInData msg, ancdata, flags, addr = self.doRecvmsg( ^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen0 (test.test_socket.RecvmsgSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3749, in testCmsgTruncLen0 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0), maxdata=0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen0Plus1 (test.test_socket.RecvmsgSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3755, in testCmsgTruncLen0Plus1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0) + 1, maxdata=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen1 (test.test_socket.RecvmsgSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3761, in testCmsgTruncLen1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(SIZEOF_INT), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen2Minus1 (test.test_socket.RecvmsgSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3768, in testCmsgTruncLen2Minus1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(2 * SIZEOF_INT) - 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2701, in doRecvmsg result = sock.recvmsg(bufsize, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen0 (test.test_socket.RecvmsgIntoSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3749, in testCmsgTruncLen0 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0), maxdata=0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen0Plus1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3755, in testCmsgTruncLen0Plus1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(0) + 1, maxdata=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3761, in testCmsgTruncLen1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(SIZEOF_INT), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ====================================================================== ERROR: testCmsgTruncLen2Minus1 (test.test_socket.RecvmsgIntoSCMRightsStreamTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3768, in testCmsgTruncLen2Minus1 self.checkTruncatedArray(ancbuf=socket.CMSG_LEN(2 * SIZEOF_INT) - 1, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 3729, in checkTruncatedArray msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/test/test_socket.py", line 2792, in doRecvmsg result = sock.recvmsg_into([buf], *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeWarning: received malformed or improperly-truncated ancillary data ---------------------------------------------------------------------- ---------- components: Tests messages: 398644 nosy: iritkatriel priority: normal severity: normal status: open title: test_socket should expect warnings in truncated-data tests type: behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:21:23 2021 From: report at bugs.python.org (Ken Jin) Date: Sat, 31 Jul 2021 16:21:23 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1627748483.68.0.529479491503.issue44791@roundup.psfhosted.org> Ken Jin added the comment: Should Concatenate support substitution to begin with? PEP 612 doesn't say anything, and I am fairly certain it's a special typing form, not a generic. So I don't really understand what it means to substitute Concatenate. Then again, Callable with a nested Concatenate can be substituted, and we currently implement that by using Concatenate's substitution behavior as proxy. But again, the meaning isn't clear to me. I also noticed this strange part in PEP 612 about user-defined generic classes: "`Generic[P]` makes a class generic on `parameters_expressions` (when P is a ParamSpec)": ... class X(Generic[T, P]): f: Callable[P, int] x: T def f(x: X[int, Concatenate[int, P_2]]) -> str: ... # Accepted (KJ: What?) ... The grammar for `parameters_expression` is: parameters_expression ::= | "..." | "[" [ type_expression ("," type_expression)* ] "]" | parameter_specification_variable | concatenate "[" type_expression ("," type_expression)* "," parameter_specification_variable "]" I'm very confused. Does this mean Concatenate is valid when substituting user generics? Maybe I should ask the PEP authors? My general sense when I implemented the PEP was that it was intended primarily for static type checking only. IMO, runtime correctness wasn't its concern. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:21:57 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 16:21:57 +0000 Subject: [issue44797] test_socket should expect warnings in truncated-data tests In-Reply-To: <1627748399.43.0.897184289547.issue44797@roundup.psfhosted.org> Message-ID: <1627748517.84.0.129672485625.issue44797@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26027 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:23:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 16:23:53 +0000 Subject: [issue44797] test_socket should expect warnings in truncated-data tests In-Reply-To: <1627748399.43.0.897184289547.issue44797@roundup.psfhosted.org> Message-ID: <1627748633.95.0.273044237507.issue44797@roundup.psfhosted.org> Change by Irit Katriel : ---------- nosy: +ncoghlan, vstinner _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:28:03 2021 From: report at bugs.python.org (Vinay Sajip) Date: Sat, 31 Jul 2021 16:28:03 +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: <1627748883.47.0.437303041299.issue37880@roundup.psfhosted.org> Vinay Sajip added the comment: New changeset 0ad173249d287794d53e6a1fe2d58bb2adee2276 by Jack DeVries in branch 'main': bpo-37880: for argparse add_argument with action='store_const', const now defaults to None. (GH-26707) https://github.com/python/cpython/commit/0ad173249d287794d53e6a1fe2d58bb2adee2276 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:32:45 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 16:32:45 +0000 Subject: [issue44798] test_enum emits a deprecation warning from test_custom_strenum_with_warning Message-ID: <1627749165.55.0.6553669311.issue44798@roundup.psfhosted.org> New submission from Irit Katriel : % ./python.exe -E -We -m test -v test_enum ====================================================================== ERROR: test_custom_strenum_with_warning (test.test_enum.TestEnum) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/iritkatriel/src/cpython-1/Lib/test/test_enum.py", line 2324, in test_custom_strenum_with_warning self.assertEqual(OkayEnum.one, '{}'.format(OkayEnum.one)) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/iritkatriel/src/cpython-1/Lib/enum.py", line 1006, in __format__ warnings.warn( ^^^^^^^^^^^^^^ DeprecationWarning: in 3.12 format() will use the enum member, not the enum member's value; use a format specifier, such as :d for an integer-based Enum, to maintain the current display ---------------------------------------------------------------------- ---------- components: Tests messages: 398647 nosy: ethan.furman, iritkatriel priority: normal severity: normal status: open title: test_enum emits a deprecation warning from test_custom_strenum_with_warning _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:39:54 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 16:39:54 +0000 Subject: [issue44798] test_enum emits a deprecation warning from test_custom_strenum_with_warning In-Reply-To: <1627749165.55.0.6553669311.issue44798@roundup.psfhosted.org> Message-ID: <1627749594.39.0.551252754872.issue44798@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch pull_requests: +26028 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27513 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 12:52:30 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 16:52:30 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627750350.07.0.364018668135.issue44793@roundup.psfhosted.org> Serhiy Storchaka added the comment: If Callable is nested, it works as expected: >>> typing.List[C][int, str, float] Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/typing.py", line 309, in inner return func(*args, **kwds) ^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 1028, in __getitem__ _check_generic(self, params, len(self.__parameters__)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/serhiy/py/cpython/Lib/typing.py", line 231, in _check_generic raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Too many parameters for typing.List[typing.Callable[~P, ~T]]; actual 3, expected 2 collections.abc.Callable raises an error too. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:05:54 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 17:05:54 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627751154.58.0.0592602380853.issue44794@roundup.psfhosted.org> Change by miss-islington : ---------- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +26029 pull_request: https://github.com/python/cpython/pull/27514 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:06:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:06:09 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627751169.45.0.748709636751.issue44794@roundup.psfhosted.org> Serhiy Storchaka added the comment: New changeset be4cb9089aaf58d5f90da5f9fa66dc3c6763b5a2 by Serhiy Storchaka in branch 'main': bpo-44794: Merge tests for typing.Callable and collection.abc.Callable (GH-27507) https://github.com/python/cpython/commit/be4cb9089aaf58d5f90da5f9fa66dc3c6763b5a2 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:19:44 2021 From: report at bugs.python.org (Komiya Takeshi) Date: Sat, 31 Jul 2021 17:19:44 +0000 Subject: [issue44799] typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar Message-ID: <1627751984.55.0.589090528607.issue44799@roundup.psfhosted.org> New submission from Komiya Takeshi : I found `typing.get_type_hints()` raises TypeError for a variable annotated by `dataclasses.InitVar` when lazy annotations evaluation-feature is enabled (a.k.a `__future__.annotations`). ``` $ cat test.py from __future__ import annotations from dataclasses import dataclass, InitVar from typing import get_type_hints @dataclass class Foo: attr: InitVar[int] get_type_hints(Foo) ``` ``` $ python -V Python 3.9.6 $ python test.py Traceback (most recent call last): File "/Users/tkomiya/work/sphinx/test.py", line 10, in get_type_hints(Foo) File "/Users/tkomiya/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 1424, in get_type_hints value = _eval_type(value, base_globals, localns) File "/Users/tkomiya/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 290, in _eval_type return t._evaluate(globalns, localns, recursive_guard) File "/Users/tkomiya/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 545, in _evaluate type_ =_type_check( File "/Users/tkomiya/.pyenv/versions/3.9.6/lib/python3.9/typing.py", line 164, in _type_check raise TypeError(f"{msg} Got {arg!r:.100}.") TypeError: Forward references must evaluate to types. Got dataclasses.InitVar[int]. ``` It goes well if lazy annotations evaluation is disabled. ---------- components: Library (Lib) messages: 398650 nosy: tkomiya priority: normal severity: normal status: open title: typing.get_type_hints() raises TypeError for a variable annotated by dataclasses.InitVar versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:25:30 2021 From: report at bugs.python.org (miss-islington) Date: Sat, 31 Jul 2021 17:25:30 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627752330.14.0.720861404316.issue44794@roundup.psfhosted.org> miss-islington added the comment: New changeset 76903ff9ce2d28f542c44ba97aa043dde8b55daa by Miss Islington (bot) in branch '3.10': bpo-44794: Merge tests for typing.Callable and collection.abc.Callable (GH-27507) https://github.com/python/cpython/commit/76903ff9ce2d28f542c44ba97aa043dde8b55daa ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:25:32 2021 From: report at bugs.python.org (Brandt Bucher) Date: Sat, 31 Jul 2021 17:25:32 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627752332.51.0.421382275097.issue34013@roundup.psfhosted.org> Brandt Bucher added the comment: Reopening as a release blocker. It appears that this new rule is far too eager, and matches a much wider range of inputs than intended. Here is a case where it changes an IndentationError into a SyntaxError: $ cat bug.py print() boom On 3.9 (correct): $ ./python.exe --version Python 3.9.6+ $ ./python.exe bug.py File "/Users/brandtbucher/Desktop/GitHub/cpython/bug.py", line 2 boom IndentationError: unexpected indent On 3.10 (incorrect): $ ./python.exe --version Python 3.10.0b4+ $ ./python.exe bug.py File "/Users/brandtbucher/Desktop/GitHub/cpython/bug.py", line 1 print() ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? On 3.11 (incorrect): $ ./python.exe --version Python 3.11.0a0 $ ./python.exe bug.py File "/Users/brandtbucher/Desktop/GitHub/cpython/bug.py", line 1 print() ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? I recommend that this either be fixed or reverted before the RC. ---------- components: +Parser -Interpreter Core nosy: +brandtbucher priority: normal -> release blocker resolution: fixed -> stage: resolved -> needs patch status: closed -> open type: enhancement -> behavior _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:35:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:35:59 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627752959.07.0.882089192455.issue44793@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26030 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27515 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:45:29 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:45:29 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627753529.99.0.427680245053.issue44794@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:47:34 2021 From: report at bugs.python.org (Marty) Date: Sat, 31 Jul 2021 17:47:34 +0000 Subject: [issue44788] Possibility to specify port in __init__ of ftplib.FTP In-Reply-To: <1627688040.44.0.389798708985.issue44788@roundup.psfhosted.org> Message-ID: <1627753654.29.0.909416269579.issue44788@roundup.psfhosted.org> Marty added the comment: Well, if it's possible to connect to ftp server within __init__, I think that adding port parameter makes sense. I mostly don't need to handle connect() and login() separately. All I need is to connect to ftp server and work with it. If there is some trouble with connection or login, the code still can't continue in this case. I haven't discussed this idea there. I'm going to create a topic for it and I will add the link here. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:49:40 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:49:40 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627753780.83.0.195558423438.issue44794@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is also similar bug in Generic: >>> from typing import * >>> T = TypeVar("T") >>> P = ParamSpec("P") >>> class X(Generic[T, P]): ... f: Callable[P, int] ... x: T ... >>> P_2 = ParamSpec("P_2") >>> X[int, P_2, str] __main__.X[int, ~P_2] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:50:01 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:50:01 +0000 Subject: [issue44794] Merge tests for typing.Callable and collection.abc.Callable In-Reply-To: <1627735230.99.0.0983589168782.issue44794@roundup.psfhosted.org> Message-ID: <1627753801.83.0.856130005574.issue44794@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg398654 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:50:22 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:50:22 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1627753822.61.0.700425021755.issue44796@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is also similar bug in Generic: >>> from typing import * >>> T = TypeVar("T") >>> P = ParamSpec("P") >>> class X(Generic[T, P]): ... f: Callable[P, int] ... x: T ... >>> P_2 = ParamSpec("P_2") >>> X[int, P_2, str] __main__.X[int, ~P_2] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:50:42 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:50:42 +0000 Subject: [issue44796] Add __parameters__ and __getitem__ in TypeVar and ParamSpec In-Reply-To: <1627738289.78.0.80035642919.issue44796@roundup.psfhosted.org> Message-ID: <1627753842.35.0.567087635446.issue44796@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- Removed message: https://bugs.python.org/msg398655 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 13:50:59 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 17:50:59 +0000 Subject: [issue44793] Arguments ignored in substitution in typing.Callable In-Reply-To: <1627734266.52.0.0397934894464.issue44793@roundup.psfhosted.org> Message-ID: <1627753859.0.0.481329839867.issue44793@roundup.psfhosted.org> Serhiy Storchaka added the comment: There is also similar bug in Generic: >>> from typing import * >>> T = TypeVar("T") >>> P = ParamSpec("P") >>> class X(Generic[T, P]): ... f: Callable[P, int] ... x: T ... >>> P_2 = ParamSpec("P_2") >>> X[int, P_2, str] __main__.X[int, ~P_2] ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:09:40 2021 From: report at bugs.python.org (Andre Roberge) Date: Sat, 31 Jul 2021 18:09:40 +0000 Subject: [issue44792] Improve syntax errors for invalid if expressions In-Reply-To: <1627730720.99.0.100491103427.issue44792@roundup.psfhosted.org> Message-ID: <1627754980.19.0.511226191248.issue44792@roundup.psfhosted.org> Change by Andre Roberge : ---------- nosy: +aroberge _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:14:14 2021 From: report at bugs.python.org (Ned Deily) Date: Sat, 31 Jul 2021 18:14:14 +0000 Subject: [issue44797] test_socket should expect warnings in truncated-data tests In-Reply-To: <1627748399.43.0.897184289547.issue44797@roundup.psfhosted.org> Message-ID: <1627755254.58.0.922700591758.issue44797@roundup.psfhosted.org> Ned Deily added the comment: Duplicate of Issue23828 ---------- nosy: +ned.deily _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:24:31 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 18:24:31 +0000 Subject: [issue23828] test_socket testCmsgTruncLen0 gets "received malformed or improperly-truncated ancillary data" warning under OS X In-Reply-To: <1427820936.86.0.258398348531.issue23828@psf.upfronthosting.co.za> Message-ID: <1627755871.81.0.285089566574.issue23828@roundup.psfhosted.org> Change by Irit Katriel : ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 3.8 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:24:52 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 18:24:52 +0000 Subject: [issue44797] test_socket should expect warnings in truncated-data tests In-Reply-To: <1627748399.43.0.897184289547.issue44797@roundup.psfhosted.org> Message-ID: <1627755892.95.0.080057423963.issue44797@roundup.psfhosted.org> Irit Katriel added the comment: Indeed, thanks. ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> test_socket fails in MacOS High Sierra when running with -Werror _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:25:39 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 18:25:39 +0000 Subject: [issue23828] test_socket testCmsgTruncLen0 gets "received malformed or improperly-truncated ancillary data" warning under OS X In-Reply-To: <1427820936.86.0.258398348531.issue23828@psf.upfronthosting.co.za> Message-ID: <1627755939.41.0.0479143546348.issue23828@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +26031 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27512 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:28:02 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 18:28:02 +0000 Subject: [issue23828] test_socket testCmsgTruncLen0 gets "received malformed or improperly-truncated ancillary data" warning under OS X In-Reply-To: <1427820936.86.0.258398348531.issue23828@psf.upfronthosting.co.za> Message-ID: <1627756082.27.0.0945430763122.issue23828@roundup.psfhosted.org> Irit Katriel added the comment: In PR27512 I tried to make the test expect the warning, but then it fails on ubuntu, so this is not the right solution. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 14:30:36 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 18:30:36 +0000 Subject: [issue44798] test_enum emits a deprecation warning from test_custom_strenum_with_warning In-Reply-To: <1627749165.55.0.6553669311.issue44798@roundup.psfhosted.org> Message-ID: <1627756236.2.0.33794742411.issue44798@roundup.psfhosted.org> Change by Irit Katriel : ---------- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> DeprecationWarning in test_enum over formatting _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 15:15:03 2021 From: report at bugs.python.org (Anthony Sottile) Date: Sat, 31 Jul 2021 19:15:03 +0000 Subject: [issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win) In-Reply-To: <1527524243.69.0.682650639539.issue33671@psf.upfronthosting.co.za> Message-ID: <1627758903.27.0.414388524089.issue33671@roundup.psfhosted.org> Change by Anthony Sottile : ---------- nosy: +Anthony Sottile nosy_count: 19.0 -> 20.0 pull_requests: +26032 pull_request: https://github.com/python/cpython/pull/27516 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 15:15:48 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 31 Jul 2021 19:15:48 +0000 Subject: [issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win) In-Reply-To: <1527524243.69.0.682650639539.issue33671@psf.upfronthosting.co.za> Message-ID: <1627758948.41.0.353265636412.issue33671@roundup.psfhosted.org> ?ric Araujo added the comment: New changeset b08c48e61745666df9aeee97d8bddbf1e5550627 by Anthony Sottile in branch 'main': bpo-33671 fix orphaned comment in shutil.copyfileobj (GH-27516) https://github.com/python/cpython/commit/b08c48e61745666df9aeee97d8bddbf1e5550627 ---------- nosy: +eric.araujo _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 15:27:18 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 19:27:18 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1627759638.52.0.660171564062.issue44791@roundup.psfhosted.org> Serhiy Storchaka added the comment: My understanding is that type expression is valid when substitute TypeVar and parameters expression is valid when substitute ParamSpec. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 16:21:09 2021 From: report at bugs.python.org (Serhiy Storchaka) Date: Sat, 31 Jul 2021 20:21:09 +0000 Subject: [issue44791] Substitution of ParamSpec in Concatenate In-Reply-To: <1627727114.02.0.621938171006.issue44791@roundup.psfhosted.org> Message-ID: <1627762869.1.0.91367344577.issue44791@roundup.psfhosted.org> Change by Serhiy Storchaka : ---------- keywords: +patch pull_requests: +26033 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27518 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 16:22:39 2021 From: report at bugs.python.org (=?utf-8?q?=C3=89ric_Araujo?=) Date: Sat, 31 Jul 2021 20:22:39 +0000 Subject: [issue44760] Turtle Documentation - Contents Hyperlink conflict In-Reply-To: <1627464661.57.0.766056732309.issue44760@roundup.psfhosted.org> Message-ID: <1627762959.48.0.859086611602.issue44760@roundup.psfhosted.org> Change by ?ric Araujo : ---------- keywords: +easy stage: -> needs patch type: enhancement -> behavior versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 16:23:53 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 20:23:53 +0000 Subject: [issue41914] test_pdb fails In-Reply-To: <1601671175.99.0.383994267715.issue41914@roundup.psfhosted.org> Message-ID: <1627763033.57.0.106835170826.issue41914@roundup.psfhosted.org> Irit Katriel added the comment: Sumagna, Thanks for the report. The test is passing on our buildbots, so this is not a general problem with it. It is hard to do anything about this without information about the platform and environment on which you saw the failure. If you are still seeing it, please create a new issue and include these details. ---------- nosy: +iritkatriel resolution: -> works for me stage: -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 16:55:18 2021 From: report at bugs.python.org (Dennis Clarke) Date: Sat, 31 Jul 2021 20:55:18 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627764918.5.0.830410841515.issue44789@roundup.psfhosted.org> Dennis Clarke added the comment: This was an excellent opportunity to review these CFLAGS and to ponder the value of each. This took me a day to write and was then reviewed by a team. I hope it answers your question. --------------------------------------------------------------- There is nothing too unusual in the CFLAGS on any system. I have used this sort of config for many years without too many problems. There are always some open source software packages that are a bit "special" and one can not expect strictly portable code everywhere. However some packages are really critical and Python would be one of those certainly. We have to agree that the usage of some gnu extensions breaks "-pedantic" always. Let us go over these compiler flags for a Solaris 10 SPARC64 system. beta $ echo $CC /opt/developerstudio12.6/bin/c99 Clearly that is the C99 compiler. Similar to running f77 in order to handle Fortran77 code. However the f77 is just a symlink these days and it points to f90. Such is life in the modern world. CFLAGS ? I guess we can go over these one by one however they are all clearly documented in the "Oracle(R) Developer Studio 12.6: C User's Guide" which we may see here : https://docs.oracle.com/cd/E77782_01/html/E77788/index.html There is a fairly extensive discussion regarding "Features of C 99" : https://docs.oracle.com/cd/E77782_01/html/E77788/bjayy.html OKay lets look at these flags that I have used almost everywhere for many years : -Xc is seen in section B.2.84 : (c = conformance) Issues errors and warnings for programs that use non-ISO C constructs. This option is strictly conformant ISO C without K&R C compatibility extensions. As a side comment here the compiler in use is C99 and this option is somewhat similar to saying "-pedantic" and yes I really do mean iso9899:1999 without any special flavour sauce added :) The documentation states : See D.1 for a discussion of supported 1999 ISO/IEC features. See Appendix H for a discussion of differences between ISO/IEC C and K&R C. All of that discussion is in the links above. -errtags=yes -errwarn=%none -errfmt=error -erroff=%none -errshort=full Lets look at these as a group of options that ensure we get a really verbose error message when needed. From section B.2.12 we see -errfmt[=[no%]error] which is used if you want to prefix the string "error:" to the beginning of error messages so they are more easily distinguishable from warning messages. The prefix is also attached to warnings that are converted to errors by -errwarn. Section B.2.17 we see -errwarn[=t] where I use t=%none such that "... any warning message from causing the compiler to exit with a fatal status should any warning message be issued." Around the same section we see -errtags=a for a being either a yes or no. From the manual "Displays the message tag for each warning message of the C compiler that can be suppressed with the -erroff option or made a fatal error with the -errwarn option." This brings us to the -erroff flag discussed in section B.2.14 where it simply says %none enables all warning messages. Finally there is -errshort which will determine how much data we get from an error message. The option "full" should be pretty clear and the section B.2.15 states "Error messages are printed with tag names for types which have tag names. If there is no tag name, the type is shown in expanded form." -m64 -xarch=sparc These are trivial and merely specify that we are building for a 64 bit platform and the target architecture is a SPARC. In this specific case we are using a Fujitsu SPARC64 based server where the full cpu description would be SPARC64-VII+ clock 2860 MHz. -xO0 -g -xs The -xO0 option is similar to what we see from GCC and LLVM/Clang and other compilers. The compiler optimization level where here we use a zero and this is not documented. It is in fact the default and the compiler accepts this flag just fine. Any other number from 1 upwards to 5 indicates a level of optimization that is ever more complex. To be blunt the use of a debugging switch -g with any level of optimization above 2 will result in limited debug data. Section B.2.150 lays out everything one would want to know for the SPARC and AMD64 platforms. The -xs option is a bit special in that it allows debug information to be encoded into the executable binaries. Section B.2.172 shows us the default is in fact -xs=yes. This is the same and simply -xs by itself. When the compile command forces linking (that is, -c is not specified) there will be no object file(s) and the debug info must be placed in the executable. I tend to always have -xs with the -g option and I do specify the -xO0 just to be really clear at a glance that this is a non-optimized debug build. -xstrconst Strangely this is a deprecated option that seems to be silently accepted. I have had this in my CFLAGS for at least twenty years and never had a problem. It still works and as section B.2.178 says it "might be removed in a future release." The manual suggests that we replace this switch with -features=conststrings which is documented in section B.2.20 thus : Enables the placement of string literals in read-only memory. The default is ?features=conststrings which places string literals into the read-only data section. Note that compiling a program that attempts to write to the memory location of a string literal will now cause a segmentation fault when compiled with this option. no% prefix disables this sub-option. -xildoff This is an oldie but a goodie as they say. Not even documented in the Oracle copy of the manual. Older manual revisions simply say : Turns off the incremental linker and forces the use of ld. Which is what I want. Also I can set LD_foo flags if needed and those are fully respected by ld. We may find this option mentioned here : https://docs.oracle.com/cd/E19957-01/806-3567/cc_options.html -xmemalign=8s Somewhat complicated but this flag suggests alignment of data to the compiler. The flag requires two options where the first is a number to suggest "at most X byte alignment" and the second is a flag to suggest behavior in the event of a misaligned access where the "s" means "Raise signal SIGBUS." This makes for an easy way to detect bad behavior as a sigbus is hard to miss on a machine where the operating system will trap the signal and then generate a core dump with all the data you could ask for. I have consistently used this alignment flag for years and ALL libraries are built with it. -xnolibmil Trivial. Do not inline math library routines. This may allow for more easy debugging later. Maybe. If I want to go with optimization then of course we inline. -xcode=pic32 From section B.2.103 we may specify code address space. Here I use "pic32" which results in : Generates position-independent code for use in shared libraries (large model). Equivalent to -KPIC. Permits references to at most 2**30 unique external symbols on 32-bit architectures, 2**29 on 64-bit architectures. There is a reasonable discussion about this in the manual of course. It is worth reading some key features here : A routine compiled with either -xcode=pic13 or -xcode=pic32 executes a few extra instructions upon entry to set a register to point at a table (_GLOBAL_OFFSET_TABLE_) used for accessing a shared library?s global or static variables. Each access to a global or static variable involves an extra indirect memory reference through _GLOBAL_OFFSET_TABLE_. If the compilation includes -xcode=pic32, there are two additional instructions per global and static memory reference. When considering these costs, remember that the use of -xcode=pic13 and -xcode=pic32 can significantly reduce system memory requirements due to the effect of library code sharing. Every page of code in a shared library compiled -xcode=pic13 or -xcode=pic32 can be shared by every process that uses the library. If a page of code in a shared library contains even a single non-pic (that is, absolute) memory reference, the page becomes nonsharable, and a copy of the page must be created each time a program using the library is executed. Therefore it seems very reasonable that code compiled on a 64bit system will be done with -xcode=pic32. -xregs=no%appl See section B.2.170 where we may specify the usage of registers for the generated code. I suggest not to use the application registers g2 and g3. The manual suggests "You should compile all system software and libraries using -xregs=no%appl." Well golly gee that is just what I do. Why? System software (including shared libraries) must preserve these registers? values for the application. Their use is intended to be controlled by the compilation system and must be consistent throughout the application. Clearly I am creating shared libs to be used in many ways long term. -xlibmieee This is trivial. In section B.2.131 we see : Forces IEEE 754 style return values for math routines in exceptional cases. In such cases, no exception message is printed, and you should not rely on errno. Generally when I work with floating point it is best to use the provided methods to detect fp-exceptions. Which certainly do happen ALL the time. -mc Trivial. From section B.2.55 we see : Removes duplicate strings from the .comment section of the object file. When you use the -mc flag, mcs -c is invoked. -ftrap=%none This flag seems to be confused in that one would think it means we do NOT trap any floating point exceptions. However this is entirely the opposite. There are a pile of options here and in section B.2.37 we see we can trap everything and get a SIGFPE along with our own handler. I find it is far better to check for floating point exceptions in my code and then deal with the issues without a SIGFPE : [no%]division Trap on division by zero. [no%]inexact Trap on inexact result. [no%]invalid Trap on invalid operation. [no%]overflow Trap on overflow. [no%]underflow Trap on underflow. %all Trap on all of the above. %none Trap on none of the above. common Trap on invalid, division by zero, and overflow. You can use ieee_handler(3M) or fex_set_handling(3M) to simultaneously enable traps and install a SIGFPE handler. If you do not specify -ftrap, the compiler assumes -ftrap=%none. So clearly I am being a bit verbose but at least there is no confusion about what is happening. -xbuiltin=%none In section B.2.95 we see where we can choose to inline some common library calls, or not. Since I am doing a debug and entirely non-optimized build here there is no reason to inline anything. So I don't. :) -xunroll=1 Section B.2.187 allows us to suggest to the compiler that it can unroll loops. When n is 1, it requires the compiler not to unroll loops. Pretty clear and also useful when debugging. -Qy Section B.2.69 tells us that -Qy is the default in any case and it determines whether to emit identification information to the output file. Generally very helpful to know every header as well as the tools that made a binary. Use mcs -p to print out loads of information from a binary that has not been stripped. I did take a look at https://www.python.org/dev/peps/pep-0007/ where we are clearly told to not use GNU extensions and that the code should be C89 clean with a few C99 features for everything recent. So this did take a day to write and it was a valuable exercise both for myself and a number of people who did review. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 16:56:31 2021 From: report at bugs.python.org (Dennis Clarke) Date: Sat, 31 Jul 2021 20:56:31 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627764991.9.0.31973523032.issue44789@roundup.psfhosted.org> Dennis Clarke added the comment: Minor note. I am going to change the component to the Parser. ---------- components: +Parser -C API _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 17:20:42 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 31 Jul 2021 21:20:42 +0000 Subject: [issue41983] Missing Documentation AF_PACKET In-Reply-To: <1602255549.69.0.358914707678.issue41983@roundup.psfhosted.org> Message-ID: <1627766442.19.0.651041248397.issue41983@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- keywords: +patch nosy: +andrei.avk nosy_count: 3.0 -> 4.0 pull_requests: +26034 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27519 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 17:21:44 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 31 Jul 2021 21:21:44 +0000 Subject: [issue41983] Missing Documentation AF_PACKET In-Reply-To: <1602255549.69.0.358914707678.issue41983@roundup.psfhosted.org> Message-ID: <1627766504.4.0.750700854687.issue41983@roundup.psfhosted.org> Andrei Kulakov added the comment: I've put up the PR here that makes availability clearer in the docs: https://github.com/python/cpython/pull/27519/files ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 17:22:53 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sat, 31 Jul 2021 21:22:53 +0000 Subject: [issue41983] Missing Documentation AF_PACKET In-Reply-To: <1602255549.69.0.358914707678.issue41983@roundup.psfhosted.org> Message-ID: <1627766573.55.0.840990897478.issue41983@roundup.psfhosted.org> Change by Andrei Kulakov : ---------- type: -> behavior versions: +Python 3.10, Python 3.11, Python 3.9 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 17:27:10 2021 From: report at bugs.python.org (Terry J. Reedy) Date: Sat, 31 Jul 2021 21:27:10 +0000 Subject: [issue44765] Misspelled Word In Docs In-Reply-To: <1627494924.73.0.555225161539.issue44765@roundup.psfhosted.org> Message-ID: <1627766830.37.0.975158217571.issue44765@roundup.psfhosted.org> Terry J. Reedy added the comment: Eesa, when responding by email, please delete the message you are responding to. When posted on the web page, the quoted copy becomes noisy and distracting. Visit https://bugs.python.org/issue44765 to see the result. ---------- nosy: +terry.reedy _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 17:55:14 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 21:55:14 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1627768514.99.0.100488179529.issue20703@roundup.psfhosted.org> Change by Irit Katriel : ---------- keywords: +patch nosy: +iritkatriel nosy_count: 5.0 -> 6.0 pull_requests: +26035 stage: -> patch review pull_request: https://github.com/python/cpython/pull/27520 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 18:06:46 2021 From: report at bugs.python.org (Irit Katriel) Date: Sat, 31 Jul 2021 22:06:46 +0000 Subject: [issue20703] RuntimeError caused by lazy imports in pdb In-Reply-To: <1392914840.47.0.865855778793.issue20703@psf.upfronthosting.co.za> Message-ID: <1627769206.14.0.907669913135.issue20703@roundup.psfhosted.org> Irit Katriel added the comment: I agree with both Eric and Xavier - any library calling a function that modifies sys.modules will see this issue, but pdb should try not to modify program semantics like this. It's fixed if we move the readline import as Louie suggested (the _bootlocale import was probably removed by now, I don't see it). ---------- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 18:23:23 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 31 Jul 2021 22:23:23 +0000 Subject: [issue35673] Loader for namespace packages In-Reply-To: <1546781003.0.0.391060889435.issue35673@roundup.psfhosted.org> Message-ID: <1627770203.0.0.217653907772.issue35673@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 18:27:11 2021 From: report at bugs.python.org (=?utf-8?q?Filipe_La=C3=ADns?=) Date: Sat, 31 Jul 2021 22:27:11 +0000 Subject: [issue42839] SourceFileLoader does not (fully) accept path-like objects In-Reply-To: <1609943532.78.0.260162878801.issue42839@roundup.psfhosted.org> Message-ID: <1627770431.35.0.0442688800444.issue42839@roundup.psfhosted.org> Change by Filipe La?ns : ---------- nosy: +FFY00 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 18:59:16 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 22:59:16 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627772356.32.0.790128199274.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: You cannot compile CPython with `-pedantic`. For example, if i add that to my collection of CFLAGS with gcc 11, many object files do not compile (too many to report here). That is not a supported compilation flag and certainly this problem is not only about the parser. I would suggest to close this issue and maybe reopen another one regarding "CPython doesn't compile with -pedantic". ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:02:48 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:02:48 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627772568.44.0.486172570843.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: For example, if I remove -Werror, you will get tons of warnings that will eventually become errors even if the parser code is "fixed": ./Modules/posixmodule.c:13781:18: note: (near initialization for ?DirEntryType_slots[1].pfunc?) ./Modules/posixmodule.c: In function ?ScandirIterator_dealloc?: ./Modules/posixmodule.c:14198:26: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 14198 | freefunc free_func = PyType_GetSlot(tp, Py_tp_free); | ^~~~~~~~~~~~~~ ./Modules/posixmodule.c: At top level: ./Modules/posixmodule.c:14211:21: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 14211 | {Py_tp_dealloc, ScandirIterator_dealloc}, | ^~~~~~~~~~~~~~~~~~~~~~~ ./Modules/posixmodule.c:14211:21: note: (near initialization for ?ScandirIteratorType_slots[0].pfunc?) ./Modules/posixmodule.c:14212:22: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 14212 | {Py_tp_finalize, ScandirIterator_finalize}, | ^~~~~~~~~~~~~~~~~~~~~~~~ ./Modules/posixmodule.c:14212:22: note: (near initialization for ?ScandirIteratorType_slots[1].pfunc?) ./Modules/posixmodule.c:14213:18: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 14213 | {Py_tp_iter, PyObject_SelfIter}, | ^~~~~~~~~~~~~~~~~ ./Modules/posixmodule.c:14213:18: note: (near initialization for ?ScandirIteratorType_slots[2].pfunc?) ./Modules/posixmodule.c:14214:22: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 14214 | {Py_tp_iternext, ScandirIterator_iternext}, | ^~~~~~~~~~~~~~~~~~~~~~~~ ./Modules/posixmodule.c:14214:22: note: (near initialization for ?ScandirIteratorType_slots[3].pfunc?) ./Modules/posixmodule.c:15802:19: warning: ISO C forbids initialization between function pointer and ?void *? [-Wpedantic] 15802 | {Py_mod_exec, posixmodule_exec}, | ^~~~~~~~~~~~~~~~ ./Modules/posixmodule.c:15802:19: note: (near initialization for ?posixmodile_slots[0].value?) make: *** [Makefile:2045: Modules/posixmodule.o] Error 1 odules/gcmodule.c:2034:19: note: (near initialization for ?gcmodule_slots[0].value?) gcc -pthread -Wno-unused-result -Wsign-compare -g -Og -Wall -pedantic -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include -DPy_BUILD_CORE_BUILTIN -DPy_BUILD_CORE_BUILTIN -I./Include/internal -c ./Modules/posixmodule.c -o Modules/posixmodule.o In file included from ./Include/Python.h:51, from ./Modules/posixmodule.c:12: ./Modules/posixmodule.c:6838:11: error: array size missing in ?os_sched_param__doc__? 6838 | PyDoc_VAR(os_sched_param__doc__); Python/ceval.c:1223:25: warning: ISO C forbids ?goto *expr;? [-Wpedantic] 1223 | #define DISPATCH_GOTO() goto *opcode_targets[opcode] | ^~~~ Python/ceval.c:1236:9: note: in expansion of macro ?DISPATCH_GOTO? 1236 | DISPATCH_GOTO(); \ | ^~~~~~~~~~~~~ Python/ceval.c:4205:13: note: in expansion of macro ?DISPATCH? 4205 | DISPATCH(); | ^~~~~~~~ Python/ceval.c:1223:25: warning: ISO C forbids ?goto *expr;? [-Wpedantic] 1223 | #define DISPATCH_GOTO() goto *opcode_targets[opcode] | ^~~~ Python/ceval.c:1236:9: note: in expansion of macro ?DISPATCH_GOTO? 1236 | DISPATCH_GOTO(); \ | ^~~~~~~~~~~~~ Python/ceval.c:4252:13: note: in expansion of macro ?DISPATCH? 4252 | DISPATCH(); ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:03:55 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:03:55 +0000 Subject: [issue44789] Code compliance concern in Parser/pegen/pegen.c In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627772635.52.0.730556779433.issue44789@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: I'm removing the parser component, as this is a general problem (the only reason you see the parser is because with -Werror that is reported first). ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:05:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:05:29 +0000 Subject: [issue44789] CPython cannot be compiled with -pedantic In-Reply-To: <1627688868.52.0.444945703099.issue44789@roundup.psfhosted.org> Message-ID: <1627772729.51.0.0488735058788.issue44789@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- title: Code compliance concern in Parser/pegen/pegen.c -> CPython cannot be compiled with -pedantic _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:12:37 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:12:37 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627773157.61.0.221317043162.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Is not about the eagerness, the problem is that it matches *first*, the parser never gets to the indentation error in the second phase. For example, with: print(3) $ 34 ? ./python bug.py File "/home/pablogsal/github/python/main/bug.py", line 1 print(3) $ 34 ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? The problem is that is matching the (3) as print + a number between parentheses. We just need to disallow to continue matching on the right if it finds a '('. ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:15:58 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:15:58 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627773358.8.0.988841662374.issue34013@roundup.psfhosted.org> Change by Pablo Galindo Salgado : ---------- pull_requests: +26036 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27521 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 19:21:29 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sat, 31 Jul 2021 23:21:29 +0000 Subject: [issue44645] Python 3.10: Under some trivial circunstances, GIL not released In-Reply-To: <1626355567.97.0.494557003743.issue44645@roundup.psfhosted.org> Message-ID: <1627773689.46.0.312910332037.issue44645@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 Jul 31 20:50:02 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 00:50:02 +0000 Subject: [issue42028] Regression in mimetypes for image/bmp In-Reply-To: <1602623702.59.0.922962266093.issue42028@roundup.psfhosted.org> Message-ID: <1627779002.06.0.840172948607.issue42028@roundup.psfhosted.org> Andrei Kulakov added the comment: This was fixed in https://github.com/python/cpython/pull/26300 so the issue can be closed as fixed, and the PR can also be closed. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:11:17 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Aug 2021 01:11:17 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627780277.16.0.969534795852.issue34013@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: New changeset 208a7e957b812ad3b3733791845447677a704f3e by Pablo Galindo Salgado in branch 'main': bpo-34013: Don't consider a grouped expression when reporting legacy print syntax errors (GH-27521) https://github.com/python/cpython/commit/208a7e957b812ad3b3733791845447677a704f3e ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:11:14 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 01 Aug 2021 01:11:14 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627780274.64.0.564139331325.issue34013@roundup.psfhosted.org> Change by miss-islington : ---------- pull_requests: +26037 pull_request: https://github.com/python/cpython/pull/27522 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:11:49 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Aug 2021 01:11:49 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627780309.9.0.867121576707.issue34013@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 Jul 31 21:31:51 2021 From: report at bugs.python.org (miss-islington) Date: Sun, 01 Aug 2021 01:31:51 +0000 Subject: [issue34013] Inconsistent SyntaxError for print In-Reply-To: <1530380578.04.0.56676864532.issue34013@psf.upfronthosting.co.za> Message-ID: <1627781511.54.0.254230514047.issue34013@roundup.psfhosted.org> miss-islington added the comment: New changeset 35035bc35a9cb8617ab9fe9aac38aaf67c926aef by Miss Islington (bot) in branch '3.10': bpo-34013: Don't consider a grouped expression when reporting legacy print syntax errors (GH-27521) https://github.com/python/cpython/commit/35035bc35a9cb8617ab9fe9aac38aaf67c926aef ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:48:31 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 01:48:31 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames Message-ID: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> New submission from Nick Coghlan : When merging the bpo-44590 changes into my PEP 558 implementation branch, I found it very hard to follow when the code was referring to the new interpreter frames rather than the existing Python frame objects that were historically used for both execution and introspection. The "interpreter frame" name was also a little confusing, since the introspection frames are still associated with a specific interpreter, they're just not required for code execution anymore, only for code introspection APIs that call for a full Python object. So, inspired by the "gi_xframe" (etc) attributes added in https://github.com/python/cpython/pull/27077, I'm proposing the following internal refactoring: * Rename "pycore_frame.h" to "pycore_xframe.h" * Rename the _interpreter_frame struct to _execution_frame * Rename the type from InterpreterFrame to ExecFrame * Use "xf_" rather than "f_" as the struct field prefix on execution frames * Use "xframe" and "xf" rather than "frame" and "f" for execution frame variables * Consistently use _PyExecFrame as the access function prefix, rather than a confusing mixture of _PyFrame and _PyInterpreterFrame * Rename _PyThreadState_PushFrame to _PyThreadState_PushExecFrame * Rename _PyThreadState_PopFrame to _PyThreadState_PopExecFrame ---------- messages: 398675 nosy: Mark.Shannon, ncoghlan priority: normal severity: normal stage: needs patch status: open title: Code readability: rename interpreter frames to execution frames type: enhancement versions: Python 3.11 _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:48:47 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 01:48:47 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1627782527.78.0.00653426745951.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- dependencies: +Create frame objects lazily when needed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:50:29 2021 From: report at bugs.python.org (Nick Coghlan) Date: Sun, 01 Aug 2021 01:50:29 +0000 Subject: [issue44800] Code readability: rename interpreter frames to execution frames In-Reply-To: <1627782511.03.0.274598412143.issue44800@roundup.psfhosted.org> Message-ID: <1627782629.17.0.0268004660372.issue44800@roundup.psfhosted.org> Change by Nick Coghlan : ---------- assignee: -> ncoghlan _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 21:57:59 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 01:57:59 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1627783079.35.0.209083749606.issue42053@roundup.psfhosted.org> Andrei Kulakov added the comment: dubiousjim: I agree, it should be `and` or have the form `not (isinstance(..) or hasattr(..))`. If you would like to make the patch, I can review. ---------- nosy: +andrei.avk _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 22:54:30 2021 From: report at bugs.python.org (Pablo Galindo Salgado) Date: Sun, 01 Aug 2021 02:54:30 +0000 Subject: [issue44206] Add a version number to dict keys. In-Reply-To: <1621611493.74.0.261277793426.issue44206@roundup.psfhosted.org> Message-ID: <1627786470.12.0.330012082158.issue44206@roundup.psfhosted.org> Pablo Galindo Salgado added the comment: Reopening this and marking as a release blocker. Seems that a buildbot has found some cases where an assert fails: https://buildbot.python.org/all/#/builders/562/builds/110/steps/5/logs/stdio ..python: Objects/dictobject.c:350: dictkeys_set_index: Assertion `keys->dk_version == 0' failed. Fatal Python error: Aborted Current thread 0x00007f7dba340740 (most recent call first): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/test_importlib/test_api.py", line 290 in test_reload_location_changed File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/case.py", line 592 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/case.py", line 652 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/unittest/runner.py", line 176 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/support/__init__.py", line 979 in _run_suite File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/support/__init__.py", line 1104 in run_unittest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/runtest.py", line 261 in _test_module File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/refleak.py", line 90 in dash_R File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/runtest.py", line 295 in _runtest_inner2 File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/runtest.py", line 335 in _runtest_inner File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/runtest.py", line 215 in _runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/runtest.py", line 245 in runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/main.py", line 334 in rerun_failed_tests File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/main.py", line 712 in _main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/main.py", line 655 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/libregrtest/main.py", line 733 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/test/__main__.py", line 2 in File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/runpy.py", line 86 in _run_code File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.refleak/build/Lib/runpy.py", line 196 in _run_module_as_main ---------- priority: normal -> release blocker resolution: fixed -> status: closed -> open _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 23:01:42 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 01 Aug 2021 03:01:42 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627786902.33.0.622985875649.issue44784@roundup.psfhosted.org> Jason R. Coombs added the comment: New changeset 21d5897982698a461215203ab51f56ad05648001 by Miss Islington (bot) in branch '3.10': bpo-44784: Apply changes from importlib_metadata 4.6.3 (GH-27508) (#27510) https://github.com/python/cpython/commit/21d5897982698a461215203ab51f56ad05648001 ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 23:01:58 2021 From: report at bugs.python.org (Jason R. Coombs) Date: Sun, 01 Aug 2021 03:01:58 +0000 Subject: [issue44784] test_importlib uses deprecated SelectableGroups interface In-Reply-To: <1627669188.18.0.876816151356.issue44784@roundup.psfhosted.org> Message-ID: <1627786918.37.0.807951825944.issue44784@roundup.psfhosted.org> Change by Jason R. Coombs : ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 23:15:56 2021 From: report at bugs.python.org (Andrei Kulakov) Date: Sun, 01 Aug 2021 03:15:56 +0000 Subject: [issue42053] fwalk: incorrect boolean test for non-fd arguments In-Reply-To: <1602869505.61.0.789643368245.issue42053@roundup.psfhosted.org> Message-ID: <1627787756.14.0.375953742604.issue42053@roundup.psfhosted.org> Andrei Kulakov added the comment: By the way I confirmed that fixing this doesn't break any tests (perhaps unsurprising ;) ) ---------- _______________________________________ Python tracker _______________________________________ From report at bugs.python.org Sat Jul 31 23:36:05 2021 From: report at bugs.python.org (Raymond Hettinger) Date: Sun, 01 Aug 2021 03:36:05 +0000 Subject: [issue43468] functools.cached_property incorrectly locks the entire descriptor on class instead of per-instance locking In-Reply-To: <1615444667.91.0.948817723419.issue43468@roundup.psfhosted.org> Message-ID: <1627788965.3.0.0866461024078.issue43468@roundup.psfhosted.org> Raymond Hettinger added the comment: Antti Haapala, I agree that this situation is catastrophic and that we need some way to avoid blocking parallel calculations of cached values for distinct instances of the same class. Here's an idea that might possibly work. Perhaps, hold one lock only briefly to atomically test and set a variable to track which instances are actively being updated. If another thread is performing the update, use a separate condition condition variable to wait for the update to complete. If no other thread is doing the update, we don't need to hold a lock while performing the I/O bound underlying function. And when we're done updating this specific instance, atomically update the set of instances being actively updated and notify threads waiting on the condition variable to wake-up. The key idea is to hold the lock only for variable updates (which are fast) rather than for the duration of the underlying function call (which is slow). Only when this specific instance is being updated do we use a separate lock (wrapped in a condition variable) to block until the slow function call is complete. The logic is hairy, so I've added Serhiy and Tim to the nosy list to help think it through. --- Untested sketch --------------------------------- class cached_property: def __init__(self, func): self.update_lock = RLock() self.instances_other_thread_is_updating = {} self.cv = Condition(RLock()) ... def __get__(self, instance, owner=None): if instance is None: return self if self.attrname is None: raise TypeError( "Cannot use cached_property instance without calling __set_name__ on it.") try: cache = instance.__dict__ except AttributeError: # not all objects have __dict__ (e.g. class defines slots) msg = ( f"No '__dict__' attribute on {type(instance).__name__!r} " f"instance to cache {self.attrname!r} property." ) raise TypeError(msg) from None val = cache.get(self.attrname, _NOT_FOUND) if val is not _NOT_FOUND: return val # Now we need to either call the function or wait for another thread to do it with self.update_lock: # Invariant: no more than one thread can report # that the instance is actively being updated other_thread_is_updating = instance in instance_being_updated if other_thread_is_updating: instance_being_updated.add(instance) # ONLY if this is the EXACT instance being updated # will we block and wait for the computed result. # Other instances won't have to wait if other_thread_is_updating: with self.cv: while instance in instance_being_updated: self.cv.wait() return cache[self.attrname] # Let this thread do the update in this thread val = self.func(instance) try: cache[self.attrname] = val except TypeError: msg = ( f"The '__dict__' attribute on {type(instance).__name__!r} instance " f"does not support item assignment for caching {self.attrname!r} property." ) raise TypeError(msg) from None with self.update_lock: instance_being_updated.discard(instance) self.cv.notify_all() return val # XXX What to do about waiting threads when an exception occurs? # We don't want them to hang. Should they repeat the underlying # function call to get their own exception to propagate upwards? ---------- nosy: +serhiy.storchaka, tim.peters _______________________________________ Python tracker _______________________________________